@faable/auth-sdk 1.3.15 → 1.3.16
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/.github/workflows/sync-from-auth.yml +25 -35
- package/package.json +2 -2
- package/spec/openapi.json +17268 -0
|
@@ -1,29 +1,39 @@
|
|
|
1
1
|
name: Sync from Auth
|
|
2
|
+
# Regenera el spec/tipos desde el release de auth y pushea a main.
|
|
3
|
+
# NO publica: el push (hecho con el token del GitHub App, no el GITHUB_TOKEN)
|
|
4
|
+
# dispara release.yml, que es el único workflow autorizado en npm Trusted
|
|
5
|
+
# Publishing (un solo workflow filename permitido por paquete).
|
|
2
6
|
permissions:
|
|
3
|
-
contents:
|
|
4
|
-
pull-requests: write
|
|
5
|
-
issues: write
|
|
6
|
-
id-token: write # OIDC para publicar en npm (igual que release.yml)
|
|
7
|
+
contents: read
|
|
7
8
|
on:
|
|
8
9
|
repository_dispatch:
|
|
9
10
|
types: [auth-released]
|
|
10
11
|
workflow_dispatch:
|
|
11
12
|
inputs:
|
|
12
13
|
version:
|
|
13
|
-
description: Auth version to sync (e.g. 1.8.
|
|
14
|
+
description: Auth version to sync (e.g. 1.8.13)
|
|
14
15
|
required: true
|
|
15
16
|
jobs:
|
|
16
17
|
sync:
|
|
17
18
|
name: sync
|
|
18
19
|
runs-on: ubuntu-latest
|
|
19
20
|
timeout-minutes: 10
|
|
20
|
-
env:
|
|
21
|
-
AUTH_OPENAPI: openapi.json # gentypes lee este archivo en vez de la URL viva
|
|
22
21
|
steps:
|
|
22
|
+
- name: Generate app token
|
|
23
|
+
id: app-token
|
|
24
|
+
uses: actions/create-github-app-token@v2
|
|
25
|
+
with:
|
|
26
|
+
app-id: ${{ secrets.APP_SYNC_SDK_ID }}
|
|
27
|
+
private-key: ${{ secrets.APP_SYNC_SDK_PRIVATE_KEY }}
|
|
28
|
+
owner: faablecloud
|
|
29
|
+
repositories: | # read auth (asset) + write auth-sdk (push que dispara release.yml)
|
|
30
|
+
auth
|
|
31
|
+
auth-sdk
|
|
32
|
+
|
|
23
33
|
- uses: actions/checkout@v6
|
|
24
34
|
with:
|
|
25
35
|
ref: main
|
|
26
|
-
|
|
36
|
+
token: ${{ steps.app-token.outputs.token }} # el push hereda este token → dispara release.yml
|
|
27
37
|
- uses: actions/setup-node@v6
|
|
28
38
|
with:
|
|
29
39
|
cache: npm
|
|
@@ -34,44 +44,24 @@ jobs:
|
|
|
34
44
|
id: ver
|
|
35
45
|
run: echo "version=${{ github.event.client_payload.version || inputs.version }}" >> "$GITHUB_OUTPUT"
|
|
36
46
|
|
|
37
|
-
- name: Generate app token
|
|
38
|
-
id: app-token
|
|
39
|
-
uses: actions/create-github-app-token@v2
|
|
40
|
-
with:
|
|
41
|
-
app-id: ${{ secrets.APP_SYNC_SDK_ID }}
|
|
42
|
-
private-key: ${{ secrets.APP_SYNC_SDK_PRIVATE_KEY }}
|
|
43
|
-
owner: faablecloud
|
|
44
|
-
repositories: auth
|
|
45
|
-
|
|
46
47
|
- name: Download OpenAPI spec from auth release
|
|
47
48
|
env:
|
|
48
|
-
GH_TOKEN: ${{ steps.app-token.outputs.token }}
|
|
49
|
+
GH_TOKEN: ${{ steps.app-token.outputs.token }}
|
|
49
50
|
VERSION: ${{ steps.ver.outputs.version }}
|
|
50
|
-
run: gh release download "v$VERSION" --repo faablecloud/auth --pattern openapi.json --output openapi.json
|
|
51
|
+
run: gh release download "v$VERSION" --repo faablecloud/auth --pattern openapi.json --output spec/openapi.json --clobber
|
|
51
52
|
|
|
52
|
-
- run: npm run gentypes #
|
|
53
|
+
- run: npm run gentypes # default: spec/openapi.json
|
|
53
54
|
|
|
54
|
-
- name: Commit
|
|
55
|
-
id: commit
|
|
55
|
+
- name: Commit and push (triggers release.yml)
|
|
56
56
|
env:
|
|
57
57
|
VERSION: ${{ steps.ver.outputs.version }}
|
|
58
58
|
run: |
|
|
59
|
-
if git diff --quiet -- src/api/types.ts; then
|
|
60
|
-
echo "
|
|
61
|
-
echo "Sin cambios de API para auth v$VERSION; no se publica."
|
|
59
|
+
if git diff --quiet -- spec/openapi.json src/api/types.ts; then
|
|
60
|
+
echo "Sin cambios de API para auth v$VERSION; nada que publicar."
|
|
62
61
|
exit 0
|
|
63
62
|
fi
|
|
64
63
|
git config user.name "github-actions[bot]"
|
|
65
64
|
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
|
66
|
-
git add src/api/types.ts
|
|
65
|
+
git add spec/openapi.json src/api/types.ts
|
|
67
66
|
git commit -m "fix: sync with auth v$VERSION"
|
|
68
67
|
git push origin main
|
|
69
|
-
echo "changed=true" >> "$GITHUB_OUTPUT"
|
|
70
|
-
|
|
71
|
-
- run: npm run build
|
|
72
|
-
if: steps.commit.outputs.changed == 'true'
|
|
73
|
-
- run: npm run release
|
|
74
|
-
if: steps.commit.outputs.changed == 'true'
|
|
75
|
-
env:
|
|
76
|
-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
77
|
-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@faable/auth-sdk",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.16",
|
|
4
4
|
"author": "Marc Pomar <marc@faable.com>",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"typescript": "^5.3.3"
|
|
26
26
|
},
|
|
27
27
|
"scripts": {
|
|
28
|
-
"gentypes": "openapi-typescript ${AUTH_OPENAPI:-
|
|
28
|
+
"gentypes": "openapi-typescript ${AUTH_OPENAPI:-spec/openapi.json} -o src/api/types.ts",
|
|
29
29
|
"build": "rimraf dist && tsc",
|
|
30
30
|
"prebuild": "npm run gentypes",
|
|
31
31
|
"prepublishOnly": "npm run build",
|