@workos/oagen 0.19.0 → 0.19.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.
@@ -6930,16 +6930,17 @@ function apiSurfaceToSnapshot(surface) {
6930
6930
  /** Convert a legacy ApiParam to a CompatParameter. */
6931
6931
  function apiParamToCompatParam(param, position, language) {
6932
6932
  const policy = getDefaultPolicy(language);
6933
+ const passing = param.passingStyle ?? inferPassingStyle(language);
6933
6934
  return {
6934
6935
  publicName: param.name,
6935
6936
  position,
6936
6937
  required: !param.optional,
6937
6938
  nullable: false,
6938
6939
  hasDefault: param.optional,
6939
- passing: param.passingStyle ?? inferPassingStyle(language),
6940
+ passing,
6940
6941
  type: { name: param.type },
6941
6942
  sensitivity: {
6942
- order: policy.constructorOrderMatters,
6943
+ order: passing === "positional",
6943
6944
  publicName: policy.methodParameterNamesArePublicApi,
6944
6945
  requiredness: true,
6945
6946
  type: true
@@ -7273,10 +7274,9 @@ function classifyParameterChanges(baseline, candidate, policy, specRef) {
7273
7274
  policy,
7274
7275
  specRef
7275
7276
  }));
7276
- if (baseParam.position !== candParam.position) if (isConstructor ? policy.constructorOrderMatters : baseParam.sensitivity.order) {
7277
- const category = isConstructor ? "constructor_position_changed_order_sensitive" : "parameter_position_changed_order_sensitive";
7278
- changes.push(makeChange({
7279
- category,
7277
+ if (baseParam.position !== candParam.position) {
7278
+ if (isConstructor) if (policy.constructorOrderMatters) changes.push(makeChange({
7279
+ category: "constructor_position_changed_order_sensitive",
7280
7280
  symbol: baseline.fqName,
7281
7281
  old: {
7282
7282
  parameter: baseParam.publicName,
@@ -7290,21 +7290,52 @@ function classifyParameterChanges(baseline, candidate, policy, specRef) {
7290
7290
  policy,
7291
7291
  specRef
7292
7292
  }));
7293
- } else changes.push(makeChange({
7294
- category: "constructor_reordered_named_friendly",
7295
- symbol: baseline.fqName,
7296
- old: {
7297
- parameter: baseParam.publicName,
7298
- position: String(baseParam.position)
7299
- },
7300
- new: {
7301
- parameter: candParam.publicName,
7302
- position: String(candParam.position)
7303
- },
7304
- message: `Parameter "${baseParam.publicName}" reordered on "${baseline.displayName}" (named-friendly language)`,
7305
- policy,
7306
- specRef
7307
- }));
7293
+ else changes.push(makeChange({
7294
+ category: "constructor_reordered_named_friendly",
7295
+ symbol: baseline.fqName,
7296
+ old: {
7297
+ parameter: baseParam.publicName,
7298
+ position: String(baseParam.position)
7299
+ },
7300
+ new: {
7301
+ parameter: candParam.publicName,
7302
+ position: String(candParam.position)
7303
+ },
7304
+ message: `Parameter "${baseParam.publicName}" reordered on "${baseline.displayName}" (named-friendly language)`,
7305
+ policy,
7306
+ specRef
7307
+ }));
7308
+ else if (baseParam.passing === "positional") changes.push(makeChange({
7309
+ category: "parameter_position_changed_order_sensitive",
7310
+ symbol: baseline.fqName,
7311
+ old: {
7312
+ parameter: baseParam.publicName,
7313
+ position: String(baseParam.position)
7314
+ },
7315
+ new: {
7316
+ parameter: candParam.publicName,
7317
+ position: String(candParam.position)
7318
+ },
7319
+ message: `Parameter "${baseParam.publicName}" moved from position ${baseParam.position} to ${candParam.position} on "${baseline.displayName}"`,
7320
+ policy,
7321
+ specRef
7322
+ }));
7323
+ else if (baseParam.passing === "named") changes.push(makeChange({
7324
+ category: "constructor_reordered_named_friendly",
7325
+ symbol: baseline.fqName,
7326
+ old: {
7327
+ parameter: baseParam.publicName,
7328
+ position: String(baseParam.position)
7329
+ },
7330
+ new: {
7331
+ parameter: candParam.publicName,
7332
+ position: String(candParam.position)
7333
+ },
7334
+ message: `Parameter "${baseParam.publicName}" reordered on "${baseline.displayName}" (named-friendly language)`,
7335
+ policy,
7336
+ specRef
7337
+ }));
7338
+ }
7308
7339
  }
7309
7340
  for (const candParam of candParams) if (!baseByName.has(candParam.publicName)) {
7310
7341
  if (changes.some((c) => c.category === "parameter_renamed" && c.new.parameter === candParam.publicName)) continue;