@sylphx/sdk 0.3.3 → 0.3.4

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/index.d.cts CHANGED
@@ -41,7 +41,7 @@ interface SylphxConfig {
41
41
  */
42
42
  readonly secretKey?: string;
43
43
  /**
44
- * Project ref — short 16-char alphanumeric nanoid (e.g. "abc123def456ghij").
44
+ * Project ref — short 12-char lowercase alphanumeric string (e.g. "abc123def456").
45
45
  *
46
46
  * The SDK targets: https://{ref}.api.sylphx.com/v1
47
47
  *
@@ -63,7 +63,7 @@ interface SylphxConfig {
63
63
  interface SylphxConfigInput {
64
64
  secretKey?: string;
65
65
  /**
66
- * Project ref — short 16-char alphanumeric nanoid.
66
+ * Project ref — short 12-char lowercase alphanumeric string.
67
67
  *
68
68
  * The SDK automatically targets: https://{ref}.api.sylphx.com/v1
69
69
  *
@@ -76,7 +76,7 @@ interface SylphxConfigInput {
76
76
  * Create a Sylphx configuration object
77
77
  *
78
78
  * Validates the secretKey (if provided) using the SSOT key-validation module.
79
- * Validates the ref format (if provided) — must be a 16-char alphanumeric nanoid.
79
+ * Validates the ref format (if provided) — must be a 12-char lowercase alphanumeric string.
80
80
  * Sanitizes keys with common issues (whitespace, newlines) and logs warnings.
81
81
  * Throws if key format is invalid.
82
82
  *
@@ -18579,7 +18579,7 @@ interface components {
18579
18579
  OrgInvitation: {
18580
18580
  /**
18581
18581
  * @description Invitation ID
18582
- * @example ivt_3Zb83qVQxkHMJPZ8VrJfQ2
18582
+ * @example inv_3Zb83qVQxkHMJPZ8VrJfQ2
18583
18583
  */
18584
18584
  id: string
18585
18585
  /**
@@ -18649,7 +18649,7 @@ interface components {
18649
18649
  /**
18650
18650
  * Format: uuid
18651
18651
  * @description Invitation token (ID)
18652
- * @example ivt_3Zb83qVQxkHMJPZ8VrJfQ2
18652
+ * @example inv_3Zb83qVQxkHMJPZ8VrJfQ2
18653
18653
  */
18654
18654
  token: string
18655
18655
  }
package/dist/index.d.ts CHANGED
@@ -41,7 +41,7 @@ interface SylphxConfig {
41
41
  */
42
42
  readonly secretKey?: string;
43
43
  /**
44
- * Project ref — short 16-char alphanumeric nanoid (e.g. "abc123def456ghij").
44
+ * Project ref — short 12-char lowercase alphanumeric string (e.g. "abc123def456").
45
45
  *
46
46
  * The SDK targets: https://{ref}.api.sylphx.com/v1
47
47
  *
@@ -63,7 +63,7 @@ interface SylphxConfig {
63
63
  interface SylphxConfigInput {
64
64
  secretKey?: string;
65
65
  /**
66
- * Project ref — short 16-char alphanumeric nanoid.
66
+ * Project ref — short 12-char lowercase alphanumeric string.
67
67
  *
68
68
  * The SDK automatically targets: https://{ref}.api.sylphx.com/v1
69
69
  *
@@ -76,7 +76,7 @@ interface SylphxConfigInput {
76
76
  * Create a Sylphx configuration object
77
77
  *
78
78
  * Validates the secretKey (if provided) using the SSOT key-validation module.
79
- * Validates the ref format (if provided) — must be a 16-char alphanumeric nanoid.
79
+ * Validates the ref format (if provided) — must be a 12-char lowercase alphanumeric string.
80
80
  * Sanitizes keys with common issues (whitespace, newlines) and logs warnings.
81
81
  * Throws if key format is invalid.
82
82
  *
@@ -18579,7 +18579,7 @@ interface components {
18579
18579
  OrgInvitation: {
18580
18580
  /**
18581
18581
  * @description Invitation ID
18582
- * @example ivt_3Zb83qVQxkHMJPZ8VrJfQ2
18582
+ * @example inv_3Zb83qVQxkHMJPZ8VrJfQ2
18583
18583
  */
18584
18584
  id: string
18585
18585
  /**
@@ -18649,7 +18649,7 @@ interface components {
18649
18649
  /**
18650
18650
  * Format: uuid
18651
18651
  * @description Invitation token (ID)
18652
- * @example ivt_3Zb83qVQxkHMJPZ8VrJfQ2
18652
+ * @example inv_3Zb83qVQxkHMJPZ8VrJfQ2
18653
18653
  */
18654
18654
  token: string
18655
18655
  }
package/dist/index.js CHANGED
@@ -740,7 +740,7 @@ function httpStatusToErrorCode(status) {
740
740
  return status >= 500 ? "INTERNAL_SERVER_ERROR" : "BAD_REQUEST";
741
741
  }
742
742
  }
743
- var REF_PATTERN = /^[a-z0-9]{16}$/;
743
+ var REF_PATTERN = /^[a-z0-9]{12}$/;
744
744
  function createConfig(input) {
745
745
  let secretKey;
746
746
  if (input.secretKey) {
@@ -759,7 +759,7 @@ function createConfig(input) {
759
759
  const trimmedRef = input.ref.trim();
760
760
  if (!REF_PATTERN.test(trimmedRef)) {
761
761
  throw new SylphxError(
762
- `[Sylphx] Invalid project ref format: "${input.ref}". Expected a 16-character lowercase alphanumeric string (e.g. "abc123def456ghij"). Get your ref from Platform Console \u2192 Projects \u2192 Your Project \u2192 Overview.`,
762
+ `[Sylphx] Invalid project ref format: "${input.ref}". Expected a 12-character lowercase alphanumeric string (e.g. "abc123def456"). Get your ref from Platform Console \u2192 Projects \u2192 Your Project \u2192 Overview.`,
763
763
  { code: "BAD_REQUEST" }
764
764
  );
765
765
  }