@faable/auth-sdk 2.6.2 → 2.6.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/version.js CHANGED
@@ -9,13 +9,13 @@
9
9
  // login pages could not import the SDK at all. Same pattern as auth-js.
10
10
  //
11
11
  // The sentinels MUST stay byte-identical to the `from` values in `.releaserc`.
12
- export const version = "2.6.2";
12
+ export const version = "2.6.4";
13
13
  // Short git SHA of the released commit. The version dates a build; this names
14
14
  // the exact tree, so a canonical log line or an audit entry leads straight to
15
15
  // `git show <sha>`. Deliberately NOT hex: an unreleased build (dev, a local
16
16
  // link) cannot be mistaken for a real commit — auth only records values that
17
17
  // look like a SHA, and this one never will.
18
- export const commit = "6d035ad";
18
+ export const commit = "6b995b1";
19
19
  // What this SDK writes in `x-faable-client`. Exported for a consumer that
20
20
  // builds a strategy on its own (outside `FaableAuthApi`) and still wants the
21
21
  // token request attributed — a bare `authClientCredentials` stamps only what
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@faable/auth-sdk",
3
- "version": "2.6.2",
3
+ "version": "2.6.4",
4
4
  "author": "Marc Pomar <marc@faable.com>",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/spec/openapi.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "info": {
4
4
  "title": "@faablecloud/auth",
5
5
  "description": "Auth Platform made by Faable. Manage Users and Roles",
6
- "version": "2.11.0",
6
+ "version": "2.12.0",
7
7
  "license": {
8
8
  "name": "private",
9
9
  "url": "https://faable.com/docs/platform/privacy-policy"
@@ -28,27 +28,39 @@ const sentinels = JSON.parse(readFileSync(join(ROOT, ".releaserc"), "utf8"))
28
28
  .plugins.find((p) => Array.isArray(p) && p[0] === "semantic-release-replace-plugin")[1]
29
29
  .replacements.map((r) => r.from);
30
30
 
31
- const tmp = mkdtempSync(join(tmpdir(), "faable-auth-sdk-published-"));
32
- try {
33
- // The registry needs a moment to serve a brand-new version.
34
- let tarball;
35
- for (let attempt = 1; attempt <= 10; attempt++) {
31
+ // Ask the registry itself rather than `npm pack`: the packument is what
32
+ // propagates first, and npm's own cache on a runner can report a
33
+ // just-published version as missing for a while (2.6.2 was live and this
34
+ // guard still called it "never available"). Up to 5 minutes, because
35
+ // propagation is the only thing being waited on here.
36
+ const fetchTarballUrl = async () => {
37
+ const url = `https://registry.npmjs.org/${pkg.name.replace("/", "%2F")}`;
38
+ for (let attempt = 1; attempt <= 30; attempt++) {
36
39
  try {
37
- tarball = execSync(`npm pack ${pkg.name}@${version} --silent`, {
38
- cwd: tmp,
39
- encoding: "utf8",
40
- }).trim();
41
- break;
40
+ const res = await fetch(url, { headers: { "cache-control": "no-cache" } });
41
+ if (res.ok) {
42
+ const doc = await res.json();
43
+ const tarball = doc.versions?.[version]?.dist?.tarball;
44
+ if (tarball) return tarball;
45
+ }
42
46
  } catch {
43
- console.log(`→ ${pkg.name}@${version} not served yet (attempt ${attempt}/10)`);
44
- execSync("sleep 10");
47
+ // network blip — keep waiting
45
48
  }
49
+ console.log(`→ ${pkg.name}@${version} not served yet (attempt ${attempt}/30)`);
50
+ await new Promise((r) => setTimeout(r, 10_000));
46
51
  }
47
- if (!tarball) {
52
+ return undefined;
53
+ };
54
+
55
+ const tmp = mkdtempSync(join(tmpdir(), "faable-auth-sdk-published-"));
56
+ try {
57
+ const tarballUrl = await fetchTarballUrl();
58
+ if (!tarballUrl) {
48
59
  console.error(`✖ ${pkg.name}@${version} never became available on the registry`);
49
60
  process.exit(1);
50
61
  }
51
-
62
+ const tarball = "published.tgz";
63
+ execSync(`curl -sfL "${tarballUrl}" -o ${tarball}`, { cwd: tmp });
52
64
  execSync(`tar xzf ${tarball}`, { cwd: tmp });
53
65
  const published = readFileSync(join(tmp, "package/dist/version.js"), "utf8");
54
66
  for (const sentinel of sentinels) {