wcz-layout 9.6.5 → 9.7.0

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.
Files changed (36) hide show
  1. package/dist/components.mjs +7 -7
  2. package/dist/components.mjs.map +1 -1
  3. package/dist/data/client.d.mts +2 -1
  4. package/dist/data/client.mjs +2 -2
  5. package/dist/data/client.mjs.map +1 -1
  6. package/dist/data/server.d.mts +1 -1
  7. package/dist/data/server.mjs +2 -2
  8. package/dist/entra-CJSyeQsx.mjs.map +1 -1
  9. package/dist/{file-BTFDDalH.mjs → file-BWcNzq55.mjs} +4 -4
  10. package/dist/file-BWcNzq55.mjs.map +1 -0
  11. package/dist/{file-CuvAmdJW.mjs → file-DimNsRly.mjs} +3 -4
  12. package/dist/{file-CuvAmdJW.mjs.map → file-DimNsRly.mjs.map} +1 -1
  13. package/dist/index.d.mts +1 -0
  14. package/dist/index.mjs +53 -43
  15. package/dist/index.mjs.map +1 -1
  16. package/dist/{peoplesoft-D4w8d4s1.d.mts → peoplesoft-CskGsqd6.d.mts} +2 -1
  17. package/dist/{peoplesoft-DGdM1bws.mjs → peoplesoft-DTPGpN2h.mjs} +2 -2
  18. package/dist/{peoplesoft-DGdM1bws.mjs.map → peoplesoft-DTPGpN2h.mjs.map} +1 -1
  19. package/dist/utils-DjdexspV.mjs.map +1 -1
  20. package/dist/vite.mjs.map +1 -1
  21. package/package.json +128 -127
  22. package/skills/client-db/SKILL.md +18 -3
  23. package/skills/data-grid/SKILL.md +142 -142
  24. package/skills/db-schema/SKILL.md +9 -2
  25. package/skills/general/SKILL.md +94 -73
  26. package/skills/migrations/SKILL.md +6 -0
  27. package/skills/migrations/versions/migrate-v9-to-v10.tsx +9 -0
  28. package/skills/server-functions/SKILL.md +2 -1
  29. package/skills/services/SKILL.md +31 -31
  30. package/skills/start/SKILL.md +47 -47
  31. package/skills/start/steps/01-git-setup.md +0 -1
  32. package/skills/start/steps/04-wicop-setup.md +105 -80
  33. package/skills/start/steps/05-database-setup.md +52 -44
  34. package/skills/start/steps/06-entra-setup.md +96 -98
  35. package/skills/start/steps/07-vault-setup.md +114 -62
  36. package/dist/file-BTFDDalH.mjs.map +0 -1
@@ -1,44 +1,52 @@
1
- # Database Setup
2
-
3
- > Create `.env.local` if it does not exist.
4
-
5
- ## User Input
6
-
7
- Ask via **AskUserQuestion**: **"Do you already have a Postgres database created for this project?"** — options `Yes` / `No`.
8
-
9
- ## Branch A — Existing database
10
-
11
- 1. Ask: **"Please provide the database connection details**.
12
-
13
- 2. Update `.env.local`:
14
- - Set `DATABASE_URL=postgres://<schema-username>:<password>@<server-address>:5432/<database-name>`.
15
- - Set `DATABASE_SCHEMA=<schema-username>`.
16
-
17
- ## Branch B — No database
18
-
19
- Ask via **AskUserQuestion**: **"Would you like me to create a local Postgres database using Docker?"** — options `Yes` / `No`.
20
-
21
- - **No** → continue to next step.
22
- - **Yes** → execute the Docker flow below.
23
-
24
- ### Docker flow
25
-
26
- The container name is `<project-name>-postgres` where `<project-name>` is the kebab-case project name (read from the `name` field in `package.json`).
27
-
28
- 1. Ensure the Docker daemon is running. If not, start Docker Desktop via terminal automatically.
29
- 2. Auto-generate password.
30
- 3. Discover occupied ports by listing **all** containers (including stopped) and pick the first port in **5432 → 5450** that does **not** appear in the output. If all ports are occupied, stop and inform the user.
31
- 4. Run the container on the chosen port:
32
-
33
- ```powershell
34
- docker run --name <project-name>-postgres -e POSTGRES_PASSWORD=<password> -d -p <PORT>:5432 postgres
35
- ```
36
-
37
- - **Success** → continue.
38
- - **Error** → stop and show the full error to the user.
39
-
40
- 5. Update `.env.local`:
41
- - Set `DATABASE_URL=postgres://postgres:<password>@localhost:<PORT>/postgres`.
42
- - Set `DATABASE_SCHEMA=public`.
43
- 6. Output exactly:
44
- > ✅ Local Postgres database created successfully on port [PORT]
1
+ # Database Setup
2
+
3
+ > Create `.env.local` if it does not exist.
4
+ > The app pins `search_path` to the `DATABASE_URL` username, so a schema with that
5
+ > exact name must exist. `public` cannot be a username — it is a reserved role.
6
+
7
+ ## User Input
8
+
9
+ Ask via **AskUserQuestion**: **"Do you already have a Postgres database created for this project?"** — options `Yes` / `No`.
10
+
11
+ ## Branch A — Existing database
12
+
13
+ 1. Ask: **"Please provide the database connection details"**.
14
+
15
+ Fill the host in automatically — QAS is always `10.82.36.60:5432`, PRD is always `10.82.36.50:5432`.
16
+
17
+ 2. Update `.env.local`:
18
+ - Set `DATABASE_URL=postgres://<schema-username>:<password>@<server-address>:5432/<database-name>`.
19
+
20
+ ## Branch B — No database
21
+
22
+ Ask via **AskUserQuestion**: **"Would you like me to create a local Postgres database using Docker?"** — options `Yes` / `No`.
23
+
24
+ - **No** → continue to next step.
25
+ - **Yes** → execute the Docker flow below.
26
+
27
+ ### Docker flow
28
+
29
+ The container name is `<project-name>-postgres` where `<project-name>` is the kebab-case project name (read from the `name` field in `package.json`).
30
+
31
+ 1. Ensure the Docker daemon is running. If not, start Docker Desktop via terminal automatically.
32
+ 2. Auto-generate password.
33
+ 3. Discover occupied ports by listing **all** containers (including stopped) and pick the first port in **5432 → 5450** that does **not** appear in the output. If all ports are occupied, stop and inform the user.
34
+ 4. Run the container on the chosen port:
35
+
36
+ ```powershell
37
+ docker run --name <project-name>-postgres -e POSTGRES_PASSWORD=<password> -d -p <PORT>:5432 postgres
38
+ ```
39
+
40
+ - **Success** → continue.
41
+ - **Error** → stop and show the full error to the user.
42
+
43
+ 5. Create the schema matching the username:
44
+
45
+ ```powershell
46
+ docker exec <project-name>-postgres psql -U postgres -c "CREATE SCHEMA IF NOT EXISTS postgres AUTHORIZATION postgres;"
47
+ ```
48
+
49
+ 6. Update `.env.local`:
50
+ - Set `DATABASE_URL=postgres://postgres:<password>@localhost:<PORT>/postgres`.
51
+ 7. Output exactly:
52
+ > ✅ Local Postgres database created successfully on port [PORT]
@@ -1,98 +1,96 @@
1
- # Entra ID Setup
2
-
3
- Ask the user only through the **AskUserQuestion** pop-up, never as chat text
4
- waiting for a typed reply, and never with a single `Continue`-style option —
5
- that is a wait, not a question. Ask only when there is a real choice, always
6
- with at least two concrete options; enable free text only for open-ended
7
- values (client ID, user count), not for yes/no decisions.
8
-
9
- To wait for something the user does in the browser — signing in, filling a
10
- field, clicking Submit — poll in a tool loop: wait ~5 s, re-read the page,
11
- repeat until the expected state appears or ~5 minutes pass, then carry
12
- straight on. Never end your turn while waiting; announcing "I'll continue
13
- once you have signed in" and stopping ends the session, and nothing resumes
14
- it. A page that renders blank is usually still loading or still on the
15
- sign-in gate — keep polling instead of reporting it as a problem.
16
-
17
- ---
18
-
19
- ## Part A — Application Creation
20
-
21
- Ask via **AskUserQuestion**: **"Is the Entra ID application already created for this project?"** — options `Yes` / `No`.
22
-
23
- - **Yes** → proceed to Part B.
24
- - **No** → Open `https://itsr.wistron.com/homepage/apply` in the browser and perform the request with the user:
25
-
26
- 1. Select Service Type → Azure AD - Application Management - Add or Modify → Submit.
27
- 2. Select Add Application → Add Applicant.
28
- 3. Fill in the required application details:
29
- - Set the English application name from the chat context. Do not ask the user for it. If it is absent from the context, read the `name` property in `package.json`, convert it to spaced Pascal Case, and prefix it with `WCZ` (for example, `my-project` becomes `WCZ My Project`).
30
- - Write a concise, single-sentence reason for creating the application based on its name and purpose. Do not ask the user for this.
31
- - Ask via **AskUserQuestion** for the expected user count, and separately: **"Who can reach the app?"** — options `Internal network only (OA)` / `Also from the public internet`. Do not choose either value on their behalf. In the ITSR form, `Internal network only` is the OA-restricted choice.
32
- - Ask via **AskUserQuestion** for the application manager's employee ID, alongside the questions above, with free text enabled. Then use the form's search control to resolve and select that person.
33
- 4. Once every field is filled, click Submit yourself to add the applicant. The applicant appears in the page's summary table and enables the page-level final Submit.
34
- 5. On the summary page, ask via **AskUserQuestion**: **"Submit the ITSR request?"** — options `Submit` / `Add another application`.
35
- - `Add another application` → click **+ Add Applicant** above the summary table, fill the dialog exactly as in step 3, submit the dialog so the new row joins the table, then return to this question. Ask again for the new application's name, its expected user count, and its access scope — these are unique per application, so never carry them over from an existing row. Write its reason yourself.
36
- - `Submit` → click the page-level final Submit and confirm the portal accepted the request.
37
-
38
- Repeat until the user answers `Submit`. Only that answer may trigger the final Submit — the request goes to approvers.
39
-
40
- When the portal needs sign-in, poll until the ITSR request form is visible and continue — do not end the turn.
41
-
42
- Once the request is submitted, close the ITSR browser session, **skip Part B**, and continue to the next step — the applications do not exist until the request is approved.
43
-
44
- ---
45
-
46
- ## Part B — Application Configuration
47
-
48
- Ask via **AskUserQuestion**: **"Have you configured the Entra ID application settings?"** — options `Yes` / `No`.
49
-
50
- - **Yes** → skip to **Credentials** below.
51
- - **No** → Open `https://entra.microsoft.com/` and complete every Part B step in one uninterrupted run. Reuse this signed-in tab and the portal's own navigation; for slow controls, poll and re-read the current blade instead of reloading or opening another tab. Derive every value from the app name and the fixed values below. Do not ask for owners; the owner list is fixed. Ask only before an explicitly user-approved irreversible action.
52
-
53
- Gradually write all the data to `.env.local` with exactly these keys — keep any values already set by earlier steps (if this file does not exist, create it). If empty - fill `SESSION_SECRET` with a freshly generated value, and leave the rest empty until you know the values:
54
-
55
- ```dotenv
56
- ENTRA_CLIENT_ID=
57
- ENTRA_TENANT_ID=
58
- ENTRA_CLIENT_SECRET=
59
- SESSION_SECRET=<generated-64-char-hex>
60
- ```
61
-
62
- **Left navigation: App Registrations:**
63
-
64
- 1. Use the application's display name already present in chat context. Ask via **AskUserQuestion** only if it is genuinely absent; otherwise open **App registrations**, filter by the exact name, and click the matching row. Its **Overview** page shows **Application (client) ID** and **Directory (tenant) ID** — read both and write them to `.env.local` as `ENTRA_CLIENT_ID` and `ENTRA_TENANT_ID` straight away, before configuring anything else. Never ask the user for these two values. Leave `ENTRA_CLIENT_SECRET` empty only until the client secret is created in step 3.
65
- 2. **Authentication (Preview)** — the left-nav item is named that, and it opens on the **Redirect URI configuration** tab. Three URIs are needed, where `<app-name>` is the `name` from `package.json`:
66
- - `http://localhost:3000/auth/callback`
67
- - `https://<app-name>.wcz-sat-qas-01.k8s.wistron.com/auth/callback`
68
- - `https://<app-name>.wcz-sat-prd-01.k8s.wistron.com/auth/callback`
69
-
70
- The portal only accepts them one panel at a time:
71
-
72
- a. **+ Add Redirect URI** → platform picker → **Web** → **Select**. The login flow is server-side (confidential client), so never pick **Single-page application**.
73
- b. The panel takes a single URI. Enter the localhost one and click **Configure**. A success toast appears and the platform picker reopens — click **Cancel** to return to the list.
74
- c. The list now shows a **Web** group row with an **Edit** link. Click **Edit**: the panel lists the saved URIs plus one empty row, and filling a row spawns another empty row below it. Add the `qas` and `prd` URIs, then click **Configure**.
75
- d. Verify all three appear as Web rows in the list.
76
-
77
- 3. **Certificates & secrets:** open the **Client secrets** tab → **+ New client secret**. Leave **Description** empty and set **Expires** to `730 days (24 months)` — always these values, never ask the user — then click **Add**. Read the new row's **Secret ID** and write it into `ENTRA_CLIENT_SECRET` in `.env.local` before navigating anywhere else. Never print the secret ID in chat or in a commit.
78
- 4. **Token configuration:** click **Add groups claim**. In the panel tick **Security groups** only, then expand each of **ID**, **Access**, and **SAML** in "Customize token properties by type" and switch the radio from `Group ID` to `sAMAccountName`. Click **Add**. The list should then show a `groups` claim with token type `ID, Access, SAML`.
79
- 5. **Expose an API:** next to **Application ID URI** click **Add** (or **Edit** if one exists). The portal prefills `api://<client-id>` — replace it with `api://wistron.com/<app-name>` (for `wh-fg-preparation`: `api://wistron.com/wh-fg-preparation`) and **Save**. Then **+ Add a scope** named `access_as_user`, set **Who can consent?** to `Admins and users`, and fill only the two required fields — **Admin consent display name** and **Admin consent description**. Leave the user consent fields empty (optional) and **State** on `Enabled`, then click **Add scope**. Do not navigate away or report progress as complete until the saved `api://wistron.com/<app-name>` URI and enabled `access_as_user` scope are both visible in the portal.
80
- 6. **Owners:** first read the current table once. Add only missing people from this fixed list: Radim Staworowski, Martin Husar, Dalibor Homola, Patrik Lorenc, Tien Thanh Tran, Sebastian Ondruska. In the picker, search each missing full name, wait for the exact name and Wistron UPN match, select it, then replace the search text with the next name without closing the picker. Submit the batch once and verify all six names in the refreshed table.
81
- 7. **Manifest:** the page opens the **Microsoft Graph App Manifest (New)** JSON in a code editor. Inside the `api` object change `"acceptMappedClaims": null` to `true` and `"requestedAccessTokenVersion": null` to `2`, then click **Save**.
82
-
83
- **Left navigation: Enterprise Applications:**
84
-
85
- 1. Open **Enterprise apps → All applications** and search with the exact display name already resolved in App Registrations; do not ask for it again.
86
- 2. **Owners:** repeat the batched owner process from App Registrations. Inspect the table once, keep the picker open while searching and selecting every missing exact Wistron record, and confirm the selected-user count increments after each selection. Click **Select** once, wait for `Owner assignment succeeded`, then verify all six names in the refreshed table. The toolbar and table may load after the heading; keep polling until both appear.
87
- 3. **Single sign-on** opens as **OIDC-based Sign-on**; there is no SAML wizard. Wait for the embedded OIDC content, then click the visible **Edit** pencil under **② Attributes & Claims**. If its reference is stale, re-read this page and click the new reference. Ignore background `400`/`403` console messages while the requested controls remain usable. Confirm the claims list already holds `groups → user.groups`, then add each missing row with **+ Add new claim**:
88
-
89
- | Claim Name | Source Attribute |
90
- | ------------------ | --------------------------- |
91
- | `department` | `user.department` |
92
- | `employeeId` | `user.extensionattribute5` |
93
- | `employeeCategory` | `user.extensionattribute13` |
94
- | `companyName` | `user.companyname` |
95
-
96
- For each one: type the claim name in **Name** and leave **Source** on `Attribute`. **Source attribute** is a dropdown, not a text field: click it, use its filter input when needed, and select the plain unquoted attribute option (never the quoted constant). Click **Save**, then wait for the editor to close and verify the exact name/value row in **Additional claims** before adding the next claim. During the close transition the old form may briefly mark every field invalid even though the save succeeded; the refreshed claims row or `Successfully saved SSO user claims` notification is authoritative. Leave **Claim conditions** and **Advanced SAML claims options** untouched. Finish by verifying all four rows plus the existing `groups → user.groups` row in one claims-table read.
97
-
98
- 4. After all owners and claims are verified, close the Entra browser session and report Part B complete.
1
+ # Entra ID Setup
2
+
3
+ Ask the user only through the **AskUserQuestion** pop-up, never as chat text
4
+ waiting for a typed reply, and never with a single `Continue`-style option —
5
+ that is a wait, not a question. Ask only when there is a real choice, always
6
+ with at least two concrete options; enable free text only for open-ended
7
+ values (client ID, user count), not for yes/no decisions.
8
+
9
+ To wait for something the user does in the browser — signing in, filling a
10
+ field, clicking Submit — poll in a tool loop: wait ~5 s, re-read the page,
11
+ repeat until the expected state appears or ~5 minutes pass, then carry
12
+ straight on. Never end your turn while waiting; announcing "I'll continue
13
+ once you have signed in" and stopping ends the session, and nothing resumes
14
+ it. A page that renders blank is usually still loading or still on the
15
+ sign-in gate — keep polling instead of reporting it as a problem.
16
+
17
+ ---
18
+
19
+ Ask via **AskUserQuestion** once, before anything else: **"What do you need for the Entra ID application?"** — options `Request a new application` / `Configure an existing application`. Run only the matching part and never ask this again: `Request a new application` → **Part A**; `Configure an existing application` → **Part B**.
20
+
21
+ ---
22
+
23
+ ## Part A — Application Creation
24
+
25
+ Open `https://itsr.wistron.com/homepage/apply` in the browser and perform the request with the user:
26
+
27
+ 1. Click **Select Service Type**. The dialog holds hundreds of radios — never read the full snapshot. Type `Azure AD - Application Management` into its search box, click the matching `Add or Modify` radio, then click the **Submit** at the bottom of the dialog (the page's own Submit stays disabled until later).
28
+ 2. Select Add Application → Add Applicant.
29
+ 3. Fill in the required application details:
30
+ - Set the English application name from the chat context. Do not ask the user for it. If it is absent from the context, read the `name` property in `package.json` and convert it to spaced Pascal Case. Every name carries a company prefix in UPPERCASE: if the name already starts with `SMS` (any casing), uppercase that prefix and keep it — `sms-my-project` becomes `SMS My Project`. Otherwise prefix it with `WCZ` — `my-project` becomes `WCZ My Project`.
31
+ - Write a concise, single-sentence reason for creating the application based on its name and purpose. Do not ask the user for this.
32
+ - Ask via **AskUserQuestion** for the expected user count, and separately: **"Who can reach the app?"** — options `Internal network only (OA)` / `Also from the public internet`. Do not choose either value on their behalf. In the ITSR form, `Internal network only` is the OA-restricted choice.
33
+ - Application Manager: never ask. Take the signed-in user's name from the page header (top-right), type it into the **Application Manager** field, click its search button, and verify the resolved `<employee-id> (<dept><name>)` line appears under the field.
34
+ 4. Once every field is filled, click Submit yourself to add the applicant. The applicant appears in the page's summary table and enables the page-level final Submit.
35
+ 5. On the summary page, ask via **AskUserQuestion**: **"Submit the ITSR request?"** — options `Submit` / `Add another application`.
36
+ - `Add another application` → click **+ Add Applicant** above the summary table, fill the dialog exactly as in step 3, submit the dialog so the new row joins the table, then return to this question. Ask again for the new application's name, its expected user count, and its access scope — these are unique per application, so never carry them over from an existing row. Write its reason yourself.
37
+ - `Submit` → click the page-level final Submit and confirm the portal accepted the request.
38
+
39
+ Repeat until the user answers `Submit`. Only that answer may trigger the final Submit — the request goes to approvers.
40
+
41
+ When the portal needs sign-in, poll until the ITSR request form is visible and continue — do not end the turn.
42
+
43
+ Once the request is submitted, close the ITSR browser session and continue to the next step — the applications do not exist until the request is approved, so Part B cannot run yet.
44
+
45
+ ---
46
+
47
+ ## Part B — Application Configuration
48
+
49
+ Open `https://entra.microsoft.com/` and complete every Part B step in one uninterrupted run. Reuse this signed-in tab and the portal's own navigation; for slow controls, poll and re-read the current blade instead of reloading or opening another tab. Deep-linking a blade by URL hash is unreliable — some bounce back to **Overview** — so click the left-nav item instead. Derive every value from the app name and the fixed values below. Do not ask for owners; the owner list is fixed. Ask only before an explicitly user-approved irreversible action.
50
+
51
+ Gradually write all the data to `.env.local` with exactly these keys — keep any values already set by earlier steps (if this file does not exist, create it). If empty - fill `SESSION_SECRET` with a freshly generated value, and leave the rest empty until you know the values:
52
+
53
+ ```dotenv
54
+ ENTRA_CLIENT_ID=
55
+ ENTRA_TENANT_ID=
56
+ ENTRA_CLIENT_SECRET=
57
+ SESSION_SECRET=<generated-64-char-hex>
58
+ ```
59
+
60
+ **Left navigation: App Registrations:**
61
+
62
+ 1. Use the application's display name already present in chat context. Ask via **AskUserQuestion** only if it is genuinely absent; otherwise open **App registrations**, filter by the exact name, and click the matching row. Its **Overview** page shows **Application (client) ID** and **Directory (tenant) ID** — read both and write them to `.env.local` as `ENTRA_CLIENT_ID` and `ENTRA_TENANT_ID` straight away, before configuring anything else. Never ask the user for these two values. Leave `ENTRA_CLIENT_SECRET` empty only until the client secret is created in step 3.
63
+ 2. **Authentication (Preview)** — the left-nav item is named that, and it opens on the **Redirect URI configuration** tab. Three URIs are needed, where `<app-name>` is the app's display name in kebab-case — usually identical to the `name` in `package.json`:
64
+ - `http://localhost:3000/auth/callback`
65
+ - `https://<app-name>.wcz-sat-qas-01.k8s.wistron.com/auth/callback`
66
+ - `https://<app-name>.wcz-sat-prd-01.k8s.wistron.com/auth/callback`
67
+
68
+ The portal only accepts them one panel at a time:
69
+
70
+ a. **+ Add Redirect URI** → platform picker → **Web** → **Select**. The login flow is server-side (confidential client), so never pick **Single-page application**.
71
+ b. The panel takes a single URI. Enter the localhost one and click **Configure**. A success toast appears and the platform picker reopens — click **Cancel** to return to the list.
72
+ c. The list now shows a **Web** group row with an **Edit** link. Click **Edit**: the panel lists the saved URIs plus one empty row, and filling a row spawns another empty row below it. Add the `qas` and `prd` URIs, then click **Configure**.
73
+ d. Verify all three appear as Web rows in the list.
74
+
75
+ 3. **Certificates & secrets:** open the **Client secrets** tab → **+ New client secret**. Leave **Description** empty and set **Expires** to `730 days (24 months)` — always these values, never ask the user — then click **Add**. **CRITICAL — one chance only:** the new row's **Value** column holds the secret and is shown _only_ immediately after creation; once you leave or reload the blade it is masked forever and the app must get a brand-new secret. Read that **Value** from the row's textbox in the page snapshot, and write it into `ENTRA_CLIENT_SECRET` in `.env.local` as your very next action, before any other click or navigation. The neighbouring **Secret ID** column is a plain GUID and is _not_ the secret — writing it there is a silent, unrecoverable mistake. The cell renders truncated with `…`, so take the textbox's full value from the snapshot, and never print it in chat or a commit.
76
+ 4. **Token configuration:** click **Add groups claim**. In the panel tick **Security groups** only, then expand each of **ID**, **Access**, and **SAML** in "Customize token properties by type" and switch the radio from `Group ID` to `sAMAccountName`. Click **Add**. The list should then show a `groups` claim with token type `ID, Access, SAML`.
77
+ 5. **Expose an API:** next to **Application ID URI** click **Add** (or **Edit** if one exists). The portal prefills `api://<client-id>` — replace it with `api://wistron.com/<app-name>` (for `wh-fg-preparation`: `api://wistron.com/wh-fg-preparation`) and **Save**. Then **+ Add a scope** named `access_as_user`, set **Who can consent?** to `Admins and users`, and fill only the two required fields — **Admin consent display name** and **Admin consent description**. Leave the user consent fields empty (optional) and **State** on `Enabled`, then click **Add scope**. Do not navigate away or report progress as complete until the saved `api://wistron.com/<app-name>` URI and enabled `access_as_user` scope are both visible in the portal. Then set the `api` key in `src/lib/auth/scopes.ts` to `["api://wistron.com/<app-name>/access_as_user"]`, matching the scope exactly as the portal lists it; leave the other keys untouched.
78
+ 6. **Owners:** first read the current table once. Add only missing people from this fixed list: Radim Staworowski, Martin Husar, Dalibor Homola, Patrik Lorenc, Tien Thanh Tran, Sebastian Ondruska. In the picker, search each missing full name, wait for the exact name and Wistron UPN match, select it, then replace the search text with the next name without closing the picker. Submit the batch once and verify all six names in the refreshed table.
79
+ 7. **Manifest:** the page opens the **Microsoft Graph App Manifest (New)** JSON in a Monaco editor. Do not retype the JSON — click into the editor, press `Ctrl+H`, and run Replace All twice: `"acceptMappedClaims": null` → `"acceptMappedClaims": true`, then `"requestedAccessTokenVersion": null` → `"requestedAccessTokenVersion": 2` (both live in the `api` object, one match each). Verify both edited lines, then click **Save**.
80
+
81
+ **Left navigation: Enterprise Applications:**
82
+
83
+ 1. Open **Enterprise apps → All applications** and search with the exact display name already resolved in App Registrations; do not ask for it again.
84
+ 2. **Owners:** repeat the batched owner process from App Registrations. Inspect the table once, keep the picker open while searching and selecting every missing exact Wistron record, and confirm the selected-user count increments after each selection. Click **Select** once, wait for `Owner assignment succeeded`, then verify all six names in the refreshed table. The toolbar and table may load after the heading; keep polling until both appear.
85
+ 3. **Single sign-on** opens as **OIDC-based Sign-on**; there is no SAML wizard. Wait for the embedded OIDC content, then click the visible **Edit** pencil under **② Attributes & Claims**. If its reference is stale, re-read this page and click the new reference. Ignore background `400`/`403` console messages while the requested controls remain usable. Confirm the claims list already holds `groups → user.groups`, then add each missing row with **+ Add new claim**:
86
+
87
+ | Claim Name | Source Attribute |
88
+ | ------------------ | --------------------------- |
89
+ | `department` | `user.department` |
90
+ | `employeeId` | `user.extensionattribute5` |
91
+ | `employeeCategory` | `user.extensionattribute13` |
92
+ | `companyName` | `user.companyname` |
93
+
94
+ For each one: type the claim name in **Name** and leave **Source** on `Attribute`. **Source attribute** is a dropdown, not a text field: click it, use its filter input when needed, and select the plain unquoted attribute option (never the quoted constant). Click **Save**, then wait for the editor to close and verify the exact name/value row in **Additional claims** before adding the next claim. The claims table can lag a save by several reads — keep re-reading, and reload the blade once if the new row still has not appeared. During the close transition the old form may briefly mark every field invalid even though the save succeeded; the refreshed claims row or `Successfully saved SSO user claims` notification is authoritative. Leave **Claim conditions** and **Advanced SAML claims options** untouched. Finish by verifying all four rows plus the existing `groups → user.groups` row in one claims-table read.
95
+
96
+ 4. After all owners and claims are verified, close the Entra browser session and report Part B complete.
@@ -1,69 +1,121 @@
1
1
  # Vault Setup
2
2
 
3
- Never print user-provided secret values into chat, files, or logs — reference only the env keys and where each value lives. The one value the AI generates itself is `SESSION_SECRET`: a fresh 64-char hex string via `node -e "console.log(require('crypto').randomBytes(32).toString('hex'))"`. The template ships only `VITE_MUI_LICENSE_KEY` in `.env`; all project configuration goes into the gitignored `.env.local`, which may have been created by an earlier setup step and is normalized in this step.
4
-
5
- ## User Input
6
-
7
- Ask via **AskUserQuestion**: **"Do you use Vault for this project?"** — options `Yes` / `No`.
8
-
9
- - **Yes** → Branch A.
10
- - **No** → Branch B.
11
-
12
- ---
13
-
14
- ## Branch A — Vault
15
-
16
- ### Part 1 — Vault secrets (user fills these in the Vault UI)
17
-
18
- Output:
19
-
20
- > 1. Navigate to your Vault UI and log in.
21
- > 2. In your app's root path, create a secret named exactly `harborvault`: toggle 'JSON' mode, then copy-paste the JSON values from another app's `harborvault` secret and save.
22
- > 3. Open your app's `default` secret, click 'Edit' (toggle 'View as JSON'), fill in these keys, then save. Provide user this in JSON to copy-paste — empty string values, except `SESSION_SECRET`, which you pre-fill with a freshly generated value:
23
- >
24
- > | Key | Value source |
25
- > | ----------------------- | ----------------------------------------------------- |
26
- > | `ENTRA_CLIENT_ID` | the Entra ID step |
27
- > | `ENTRA_TENANT_ID` | same for all Wistron apps — copy from another project |
28
- > | `ENTRA_CLIENT_SECRET` | your Entra ID application |
29
- > | `SESSION_SECRET` | already pre-filled in the JSON — generated by the AI |
30
- > | `DATABASE_SCHEMA` | the database step |
31
- > | `DATABASE_AUTO_MIGRATE` | `true` unless you manage migrations manually |
32
- > | `DATABASE_URL` | the database step |
33
- >
34
- Then ask via **AskUserQuestion**: **"Are the Vault secrets filled in and saved?"** — options `Done` / `Not yet`. On `Not yet`, wait and ask again.
35
-
36
- ### Part 2 — Normalize `.env.local`
37
-
38
- Rewrite `.env.local` so it contains **only** the keys below. Never fill in secret values yourself — keep values empty except `DATABASE_URL` and `DATABASE_SCHEMA`, where you keep the values if the database step already set them (drizzle-kit reads both):
3
+ Move the secrets that currently live in `.env.local` into Vault, then shrink
4
+ `.env.local` down to the Vault connection only.
5
+
6
+ Before starting, ask the user via **AskUserQuestion** which environment(s) to
7
+ set up: **QAS**, **PRD** or **both**. Both environments follow the same steps —
8
+ the login credentials, the Vault path (QAS lives under `sat-qas-01`, PRD under
9
+ `sat-prd-01`; each has its own Vault account and password) and a few
10
+ environment-specific payload values differ (see Part 2, step 0). When doing
11
+ both, run through Parts 1–2 once per environment. In Part 3, always write the
12
+ **QAS** connection into `.env.local` (if available).
13
+
14
+ To wait for something the user does in the browser — signing in, saving a
15
+ secret — poll in a tool loop: wait ~5 s, re-read the page, repeat until the
16
+ expected state appears or ~5 minutes pass, then carry straight on. Never end
17
+ your turn while waiting; announcing "I'll continue once you have signed in"
18
+ and stopping ends the session, and nothing resumes it.
19
+
20
+ Do not print secret values into chat, logs, or a commit — reference them by
21
+ key name. Values move from `.env.local` into the browser and nowhere else.
22
+
23
+ ## Part 1 — Collect the payload from `.env.local`
24
+
25
+ 1. Read `.env.local`. Note: it is typically gitignored, so glob/searches may not
26
+ find it — read it directly by path. If it does not exist, create it. Also
27
+ check `.env`: in the template repo some keys (e.g. `*_BASE_URL`) live there
28
+ instead — include them in the payload too.
29
+ 2. If `SESSION_SECRET` is empty or missing, generate one.
30
+ 3. Build the JSON payload from every key in `.env.local` (except `DATABASE_AUTOMIGRATE`). A typical payload that goes to Vault.
31
+
32
+ ```json
33
+ {
34
+ "ENTRA_CLIENT_ID": "...",
35
+ "ENTRA_TENANT_ID": "...",
36
+ "ENTRA_CLIENT_SECRET": "...",
37
+ "SESSION_SECRET": "...",
38
+ "DATABASE_URL": "..."
39
+ }
40
+ ```
41
+
42
+ ## Part 2 — Write the secrets in the Vault UI
43
+
44
+ Repeat this part once per selected environment (QAS and/or PRD) — same steps,
45
+ different credentials and path.
46
+
47
+ 0. Derive the environment-specific payload. The Part 1 payload reflects the
48
+ local/QAS setup — before writing to a given environment, adjust these keys:
49
+ - **`*_BASE_URL`** keys: if the host contains `qas` or `dev`, swap the
50
+ environment segment for the target environment. The pattern is
51
+ `https://<service>-api.wcz-sat-<env>-01.k8s.wistron.com`, e.g.
52
+ `https://<service>-api.wcz-sat-qas-01.k8s.wistron.com` becomes
53
+ `https://<service>-api.wcz-sat-prd-01.k8s.wistron.com`. Hosts that don't
54
+ match this k8s pattern stay untouched. Do this automatically — never ask the user for these.
55
+ - **`DATABASE_URL`**: the host is fixed per environment — QAS is always
56
+ `10.82.36.60:5432`, PRD is always `10.82.36.50:5432`. Set the host
57
+ automatically. The **username and password** cannot be derived: local
58
+ usually uses `postgres`, but the provisioned per-app user is
59
+ `wcz-<projectname>` with a **different password per environment** (QAS
60
+ and PRD passwords differ). Ask the user for the target environment's DB
61
+ info block (from the provisioning/WiCOP material, looks like
62
+ `name: wcz-<project>-db / username: wcz-<project> / password: ...`) and
63
+ substitute both username and password into the URL.
64
+ - All other keys (`ENTRA_*`, `SESSION_SECRET`, ...) stay
65
+ as-is.
66
+ 1. Ask for the screenshot of WiCOP email or the **Vault path**, **Vault Account** and **Vault Password** one-by-one. The password is needed as a
67
+ value in Part 3 (`VAULT_PASSWORD`), so it must be given in chat — do not
68
+ have the user type it into the browser only. Note that **QAS and PRD live
69
+ on different Vault hosts** (QAS is typically `vault-dev.wistron.com:8200`,
70
+ PRD `vault-oss-prd.wistron.com:8200`) — the Vault path the user provides
71
+ contains the right host; use it as-is.
72
+ 2. Open the Vault address in the browser. Login with provided account and password and redirect to provided path:
73
+ - The URL already contains the secret path, so it redirects there after login.
74
+ - On the "Sign in to Vault" screen, open the **Method** dropdown and select **Userpass** (not the default Token).
75
+ - Enter the **Username** (Vault Account), then the **Password**, then click **Sign in**.
76
+ - You land on the secret list for the project path, e.g. `release/wcz/sat-<environment>-01/<project>-wcz`, containing a `default` secret.
77
+ 3. Update the `default` secret with the derived environment payload from step 0:
78
+ - Click the `default` secret to open it, then open the **Secret** tab.
79
+ - Click **Create new version**.
80
+ - Toggle the **JSON** switch in the toolbar, select all in the JSON editor (`Ctrl+A`) and replace it with the payload JSON from Part 1 (this also removes any pre-existing keys like `cog_test`).
81
+ - Click **Save**. Verify the success toast "Successfully saved secret data" and that the new version lists every expected key.
82
+ 4. Create the `harborvault` secret:
83
+ - In the breadcrumb, click `<projectname>-wcz` to go one level up.
84
+ - Click **Create secret**.
85
+ - In **Path for this secret**, append `harborvault` to the pre-filled project path (i.e. `wcz/<env>/<projectname>-wcz/harborvault`).
86
+ - Toggle the **JSON** switch, then ask the user to copy-paste the harborvault JSON from another project into the JSON editor (contains the `HARBOR_SECRET` key). The same JSON is used for both environments — it
87
+ points to the shared PRD harbor registry (`wcz-sat-prd-harbor...`) even in
88
+ QAS; that is intentional. Autonomously poll the editor until the content
89
+ is there — do not end the session while waiting.
90
+ - Click **Save**. Verify the success toast.
91
+ 5. Close the Vault browser session.
92
+
93
+ ## Part 3 — Rewrite `.env.local`
94
+
95
+ Use the **QAS** credentials here when both environments were set up.
96
+
97
+ Rewrite the file so it contains **only** these keys. Every app secret is now
98
+ served by Vault, so its local value is removed — a leftover value would
99
+ override Vault. `DATABASE_URL` stay filled because
100
+ drizzle-kit reads them directly and never goes through Vault.
101
+
102
+ `VAULT_SECRET_PATH` is the secret path **without** the mount point (`release`)
103
+ and **including** the trailing `/default` — the app builds
104
+ `/v1/<mount>/data/<VAULT_SECRET_PATH>` (see `src/lib/vite-plugin.ts`).
105
+ `VAULT_MOUNT_POINT` defaults to `release` and only needs to be set if the
106
+ engine is mounted elsewhere. If `VAULT_ADDRESS` is unset, Vault fetching is
107
+ skipped silently (plain local-dev fallback).
39
108
 
40
109
  ```dotenv
41
- VAULT_ADDRESS=
42
- VAULT_SECRET_PATH=
43
- VAULT_USERNAME=
44
- VAULT_PASSWORD=
45
-
46
- DATABASE_URL=
47
- DATABASE_SCHEMA=
48
- ```
49
-
50
- Then ask the user to fill in the empty values directly in `.env.local` (not in chat), and confirm via **AskUserQuestion**: **"Are the `.env.local` values filled in?"** — options `Done` / `Not yet`. On `Not yet`, wait and ask again.
110
+ VAULT_ADDRESS=<scheme://host:port from Part 2, no path>
111
+ VAULT_SECRET_PATH=wcz/sat-qas-01/<project>-wcz/default
112
+ VAULT_USERNAME=<from Part 2>
113
+ VAULT_PASSWORD=<from Part 2>
51
114
 
52
- ---
53
-
54
- ## Branch B — No Vault
55
-
56
- Create `.env.local` to contain exactly these keys — keep any values already set by earlier steps, fill `SESSION_SECRET` with a freshly generated value, and leave the rest empty:
57
-
58
- ```dotenv
59
- ENTRA_CLIENT_ID=
60
- ENTRA_TENANT_ID=
61
- ENTRA_CLIENT_SECRET=
62
- SESSION_SECRET=<generated-64-char-hex>
63
-
64
- DATABASE_SCHEMA=
65
- DATABASE_AUTO_MIGRATE=
66
- DATABASE_URL=
115
+ DATABASE_URL=<kept — local dev DB or QAS, per user choice>
116
+ DATABASE_AUTOMIGRATE=<kept>
67
117
  ```
68
118
 
69
- Then ask the user to fill in the empty values directly in `.env.local` (not in chat), and confirm via **AskUserQuestion**: **"Are the `.env.local` values filled in?"** — options `Done` / `Not yet`. On `Not yet`, wait and ask again.
119
+ After writing, verify end-to-end: start the dev server (or replicate the
120
+ login + fetch from `src/lib/vite-plugin.ts`) and confirm all expected keys
121
+ come back from Vault.
@@ -1 +0,0 @@
1
- {"version":3,"file":"file-BTFDDalH.mjs","names":[],"sources":["../src/lib/createApi.ts","../src/data/server/file.ts"],"sourcesContent":["import { createServerOnlyFn } from \"@tanstack/react-start\";\r\nimport axios, { AxiosError, type AxiosInstance } from \"axios\";\r\nimport https from \"node:https\";\r\nimport type { serverEnv } from \"virtual:wcz-layout\";\r\nimport { scopes as definedScopes } from \"virtual:wcz-layout\";\r\nimport { getAppToken } from \"~/lib/auth/msalServer\";\r\nimport { getAccessToken, getSessionUser } from \"~/lib/auth/user\";\r\n\r\nexport interface ApiOptions {\r\n baseURL: keyof typeof serverEnv & `${string}BASE_URL${string}`;\r\n scopeKey: keyof typeof definedScopes;\r\n}\r\n\r\nconst httpsAgent = new https.Agent({\r\n rejectUnauthorized: false,\r\n});\r\n\r\nexport const createApi = createServerOnlyFn(\r\n async ({ baseURL, scopeKey }: ApiOptions): Promise<AxiosInstance> => {\r\n const resolvedBaseURL = process.env[baseURL];\r\n if (!resolvedBaseURL) throw new Error(`\"${baseURL}\" env variable is not set.`);\r\n\r\n const accessToken = (await getSessionUser())\r\n ? await getAccessToken(scopeKey)\r\n : await getAppToken(scopeKey);\r\n\r\n const api = axios.create({\r\n baseURL: resolvedBaseURL,\r\n httpsAgent,\r\n headers: { Authorization: `Bearer ${accessToken}` },\r\n });\r\n\r\n api.interceptors.response.use(undefined, (error: unknown) => {\r\n if (error instanceof AxiosError)\r\n throw new Error(error.response?.data?.message ?? error.message);\r\n throw error;\r\n });\r\n\r\n return api;\r\n },\r\n);\r\n","import { createServerOnlyFn } from \"@tanstack/react-start\";\r\nimport type { AxiosResponse } from \"axios\";\r\nimport https from \"node:https\";\r\nimport { Readable } from \"node:stream\";\r\nimport { DefaultHttpStack, Upload } from \"tus-js-client\";\r\nimport { z } from \"zod\";\r\nimport { serverEnv } from \"~/env\";\r\nimport { uuidv7 } from \"~/exports/utils\";\r\nimport { getAppToken } from \"~/lib/auth/msalServer\";\r\nimport { getAccessToken, getSessionUser } from \"~/lib/auth/user\";\r\nimport { createApi } from \"~/lib/createApi\";\r\nimport type { FileMeta } from \"~/models/file/FileMeta\";\r\nimport { FileMetaSchema } from \"~/models/file/FileMeta\";\r\n\r\nexport const GetFileMetasSchema = z.object({\r\n appName: z.string().min(1).max(255),\r\n subId: z.uuid(),\r\n});\r\n\r\nexport const FileSchema = z.object({\r\n appName: z.string().min(1).max(255),\r\n id: z.uuid(),\r\n});\r\n\r\nexport const UpdateFileMetaSchema = FileMetaSchema.extend({\r\n fileName: z.string().min(1).max(255),\r\n});\r\n\r\nconst DeleteFileSchema = FileSchema;\r\n\r\nconst BatchDeleteFilesSchema = GetFileMetasSchema;\r\n\r\nexport interface UploadFileResult {\r\n id: string;\r\n appName: string;\r\n subId: string;\r\n fileName: string;\r\n}\r\n\r\nexport const UploadFileMetaSchema = z.object({\r\n appName: z.string().min(1).max(255),\r\n subId: z.uuid(),\r\n file: z.instanceof(File),\r\n});\r\n\r\nconst fileApi = () => createApi({ baseURL: \"FILE_BASE_URL\", scopeKey: \"file\" });\r\n\r\nfunction toFileResponse(response: AxiosResponse<Readable>, disposition?: string): Response {\r\n const headers = new Headers({\r\n \"Cache-Control\": \"private, max-age=3600, immutable\",\r\n \"Content-Type\": String(response.headers[\"content-type\"] ?? \"application/octet-stream\"),\r\n });\r\n const contentLength = response.headers[\"content-length\"];\r\n if (contentLength) headers.set(\"Content-Length\", String(contentLength));\r\n if (disposition) headers.set(\"Content-Disposition\", disposition);\r\n\r\n return new Response(Readable.toWeb(response.data) as ReadableStream, { headers });\r\n}\r\n\r\nexport const getFileMetas = createServerOnlyFn(\r\n async ({ data }: { data: z.input<typeof GetFileMetasSchema> }): Promise<Array<FileMeta>> => {\r\n const input = GetFileMetasSchema.parse(data);\r\n const queryParams = new URLSearchParams();\r\n queryParams.append(\"appName\", input.appName);\r\n queryParams.append(\"subId\", input.subId);\r\n\r\n const api = await fileApi();\r\n const { data: fileMetas } = await api.request<Array<FileMeta>>({\r\n url: `/v1/meta?${queryParams.toString()}`,\r\n method: \"GET\",\r\n });\r\n return fileMetas;\r\n },\r\n);\r\n\r\nexport const getFileThumbnail = createServerOnlyFn(\r\n async ({ data }: { data: z.input<typeof FileSchema> }): Promise<Response> => {\r\n const input = FileSchema.parse(data);\r\n const queryParams = new URLSearchParams();\r\n queryParams.append(\"appName\", input.appName);\r\n queryParams.append(\"id\", input.id);\r\n\r\n const api = await fileApi();\r\n const response = await api.request<Readable>({\r\n url: `/v1/thumbnail?${queryParams.toString()}`,\r\n method: \"GET\",\r\n responseType: \"stream\",\r\n });\r\n\r\n return toFileResponse(response);\r\n },\r\n);\r\n\r\nexport const getFile = createServerOnlyFn(\r\n async ({ data }: { data: z.input<typeof FileSchema> }): Promise<Response> => {\r\n const input = FileSchema.parse(data);\r\n const queryParams = new URLSearchParams();\r\n queryParams.append(\"appName\", input.appName);\r\n queryParams.append(\"id\", input.id);\r\n\r\n const api = await fileApi();\r\n const response = await api.request<Readable>({\r\n url: `/v1?${queryParams.toString()}`,\r\n method: \"GET\",\r\n responseType: \"stream\",\r\n });\r\n\r\n return toFileResponse(response, \"inline\");\r\n },\r\n);\r\n\r\nexport const downloadFile = createServerOnlyFn(\r\n async ({ data }: { data: z.input<typeof FileSchema> }): Promise<Response> => {\r\n const input = FileSchema.parse(data);\r\n const queryParams = new URLSearchParams();\r\n queryParams.append(\"appName\", input.appName);\r\n queryParams.append(\"id\", input.id);\r\n\r\n const api = await fileApi();\r\n const response = await api.request<Readable>({\r\n url: `/v1/download?${queryParams.toString()}`,\r\n method: \"GET\",\r\n responseType: \"stream\",\r\n });\r\n\r\n return toFileResponse(response);\r\n },\r\n);\r\n\r\nexport const updateFileMeta = createServerOnlyFn(\r\n async ({ data }: { data: z.input<typeof UpdateFileMetaSchema> }): Promise<void> => {\r\n const input = UpdateFileMetaSchema.parse(data);\r\n const queryParams = new URLSearchParams();\r\n queryParams.append(\"appName\", input.appName);\r\n queryParams.append(\"id\", input.id);\r\n\r\n const api = await fileApi();\r\n await api.request({ url: `/v1/meta?${queryParams.toString()}`, method: \"PUT\", data: input });\r\n },\r\n);\r\n\r\nexport const deleteFile = createServerOnlyFn(\r\n async ({ data }: { data: z.input<typeof DeleteFileSchema> }): Promise<void> => {\r\n const input = DeleteFileSchema.parse(data);\r\n const queryParams = new URLSearchParams();\r\n queryParams.append(\"appName\", input.appName);\r\n queryParams.append(\"id\", input.id);\r\n\r\n const api = await fileApi();\r\n await api.request({ url: `/v1?${queryParams.toString()}`, method: \"DELETE\" });\r\n },\r\n);\r\n\r\nexport const batchDeleteFiles = createServerOnlyFn(\r\n async ({ data }: { data: z.input<typeof BatchDeleteFilesSchema> }): Promise<void> => {\r\n const input = BatchDeleteFilesSchema.parse(data);\r\n const queryParams = new URLSearchParams();\r\n queryParams.append(\"appName\", input.appName);\r\n queryParams.append(\"subId\", input.subId);\r\n\r\n const api = await fileApi();\r\n await api.request({ url: `/v1?${queryParams.toString()}`, method: \"DELETE\" });\r\n },\r\n);\r\n\r\nconst insecureHttpsAgent = new https.Agent({ rejectUnauthorized: false });\r\n\r\nexport const uploadFile = createServerOnlyFn(\r\n async ({ data }: { data: z.input<typeof UploadFileMetaSchema> }): Promise<UploadFileResult> => {\r\n const input = UploadFileMetaSchema.parse(data);\r\n const accessToken = (await getSessionUser())\r\n ? await getAccessToken(\"file\")\r\n : await getAppToken(\"file\");\r\n const stream = Readable.fromWeb(\r\n input.file.stream() as import(\"node:stream/web\").ReadableStream,\r\n );\r\n\r\n const id = uuidv7();\r\n\r\n await new Promise<void>((resolve, reject) => {\r\n const upload = new Upload(stream, {\r\n endpoint: `${serverEnv.FILE_BASE_URL}/v1/upload`,\r\n httpStack: new DefaultHttpStack({ agent: insecureHttpsAgent }),\r\n uploadSize: input.file.size,\r\n chunkSize: 1_048_576,\r\n metadata: {\r\n id,\r\n appName: input.appName,\r\n subId: input.subId,\r\n filename: input.file.name,\r\n filetype: input.file.type,\r\n },\r\n headers: { Authorization: `Bearer ${accessToken}` },\r\n onError: reject,\r\n onSuccess: () => resolve(),\r\n });\r\n upload.start();\r\n });\r\n\r\n return {\r\n id,\r\n appName: input.appName,\r\n subId: input.subId,\r\n fileName: input.file.name,\r\n };\r\n },\r\n);\r\n"],"mappings":";;;;;;;;;;;;AAaA,MAAM,aAAa,IAAI,MAAM,MAAM,EACjC,oBAAoB,MACtB,CAAC;AAED,MAAa,YAAY,mBACvB,OAAO,EAAE,SAAS,eAAmD;CACnE,MAAM,kBAAkB,QAAQ,IAAI;CACpC,IAAI,CAAC,iBAAiB,MAAM,IAAI,MAAM,IAAI,QAAO,2BAA4B;CAE7E,MAAM,cAAe,MAAM,eAAe,IACtC,MAAM,eAAe,QAAQ,IAC7B,MAAM,YAAY,QAAQ;CAE9B,MAAM,MAAM,MAAM,OAAO;EACvB,SAAS;EACT;EACA,SAAS,EAAE,eAAe,UAAU,cAAc;CACpD,CAAC;CAED,IAAI,aAAa,SAAS,IAAI,KAAA,IAAY,UAAmB;EAC3D,IAAI,iBAAiB,YACnB,MAAM,IAAI,MAAM,MAAM,UAAU,MAAM,WAAW,MAAM,OAAO;EAChE,MAAM;CACR,CAAC;CAED,OAAO;AACT,CACF;;;AC1BA,MAAa,qBAAqB,IAAE,OAAO;CACzC,SAAS,IAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,GAAG;CAClC,OAAO,IAAE,KAAK;AAChB,CAAC;AAED,MAAa,aAAa,IAAE,OAAO;CACjC,SAAS,IAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,GAAG;CAClC,IAAI,IAAE,KAAK;AACb,CAAC;AAED,MAAa,uBAAuB,eAAe,OAAO,EACxD,UAAU,IAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,GAAG,EACrC,CAAC;AAED,MAAM,mBAAm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