@stardeck-customer-apps/testing 0.17.0 → 0.18.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.
package/SKILL.md CHANGED
@@ -350,6 +350,9 @@ externalId })` helper models a trusted platform/channel link, and
350
350
  platform turning one down. `completeClaim` flips the claimed contact to
351
351
  `verified`, or records `invalidated` when the contact is no longer on that
352
352
  profile and `refused` / `contact_owned` when someone else already proved it.
353
+ A contact the claimant already proved on their own login profile is not
354
+ "someone else": the claim completes and the one verified copy ends up on the
355
+ claimed profile.
353
356
  Completing a finished claim replays the recorded result. Completion attaches
354
357
  the claimant's login to the profile (moving it off any profile it was on), but
355
358
  does not move history — the platform's merge core is not modelled.
package/dist/index.d.mts CHANGED
@@ -185,7 +185,9 @@ interface TestDirectory {
185
185
  * Test setup only: model the customer finishing the platform-hosted claim —
186
186
  * Clerk proof plus their confirmation. Flips the claimed contact to verified,
187
187
  * or records `invalidated` (the contact was removed from that profile) or
188
- * `refused` with `contact_owned` (someone else already proved it). Replaying a
188
+ * `refused` with `contact_owned` (someone else already proved it — the
189
+ * claimant's own login profile does not count; its verified copy is dropped
190
+ * so the claimed profile holds the only one). Replaying a
189
191
  * finished claim returns the recorded result unchanged.
190
192
  *
191
193
  * It does NOT attach a login link or move history: the platform's merge core
package/dist/index.d.ts CHANGED
@@ -185,7 +185,9 @@ interface TestDirectory {
185
185
  * Test setup only: model the customer finishing the platform-hosted claim —
186
186
  * Clerk proof plus their confirmation. Flips the claimed contact to verified,
187
187
  * or records `invalidated` (the contact was removed from that profile) or
188
- * `refused` with `contact_owned` (someone else already proved it). Replaying a
188
+ * `refused` with `contact_owned` (someone else already proved it — the
189
+ * claimant's own login profile does not count; its verified copy is dropped
190
+ * so the claimed profile holds the only one). Replaying a
189
191
  * finished claim returns the recorded result unchanged.
190
192
  *
191
193
  * It does NOT attach a login link or move history: the platform's merge core
package/dist/index.js CHANGED
@@ -1415,8 +1415,12 @@ function completeClaim(claimId, params) {
1415
1415
  claim.state = "invalidated";
1416
1416
  return claim;
1417
1417
  }
1418
+ const claimantIdentityId = state.identityLinks.find(
1419
+ (link) => link.kind === "project_auth_user" && link.externalId === params.clerkUserId
1420
+ )?.identityId;
1418
1421
  const otherVerified = rows.find((link) => link.verified && link.identityId !== claim.identityId);
1419
- if (otherVerified) {
1422
+ const ownProof = otherVerified !== void 0 && otherVerified.identityId === claimantIdentityId;
1423
+ if (otherVerified && !ownProof) {
1420
1424
  claim.state = "refused";
1421
1425
  claim.refusalReason = "contact_owned";
1422
1426
  return claim;
@@ -1426,6 +1430,7 @@ function completeClaim(claimId, params) {
1426
1430
  claim.refusalReason = "owned_elsewhere";
1427
1431
  return claim;
1428
1432
  }
1433
+ if (ownProof) state.identityLinks = state.identityLinks.filter((link) => link !== otherVerified);
1429
1434
  target.verified = true;
1430
1435
  connectLogin(claim, params.clerkUserId);
1431
1436
  claim.state = "completed";
package/dist/index.mjs CHANGED
@@ -1366,8 +1366,12 @@ function completeClaim(claimId, params) {
1366
1366
  claim.state = "invalidated";
1367
1367
  return claim;
1368
1368
  }
1369
+ const claimantIdentityId = state.identityLinks.find(
1370
+ (link) => link.kind === "project_auth_user" && link.externalId === params.clerkUserId
1371
+ )?.identityId;
1369
1372
  const otherVerified = rows.find((link) => link.verified && link.identityId !== claim.identityId);
1370
- if (otherVerified) {
1373
+ const ownProof = otherVerified !== void 0 && otherVerified.identityId === claimantIdentityId;
1374
+ if (otherVerified && !ownProof) {
1371
1375
  claim.state = "refused";
1372
1376
  claim.refusalReason = "contact_owned";
1373
1377
  return claim;
@@ -1377,6 +1381,7 @@ function completeClaim(claimId, params) {
1377
1381
  claim.refusalReason = "owned_elsewhere";
1378
1382
  return claim;
1379
1383
  }
1384
+ if (ownProof) state.identityLinks = state.identityLinks.filter((link) => link !== otherVerified);
1380
1385
  target.verified = true;
1381
1386
  connectLogin(claim, params.clerkUserId);
1382
1387
  claim.state = "completed";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stardeck-customer-apps/testing",
3
- "version": "0.17.0",
3
+ "version": "0.18.0",
4
4
  "description": "Vitest test harness for Stardeck customer apps — in-process Postgres (PGlite) plus a control-plane simulator so the real Stardeck SDKs run unmodified in tests",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -47,9 +47,9 @@
47
47
  "scripts": {
48
48
  "build": "tsup src/index.ts src/config.ts src/setup.ts src/next/headers-shim.ts src/server-only-shim.ts --format cjs,esm --dts --no-splitting",
49
49
  "dev": "tsup src/index.ts src/config.ts src/setup.ts src/next/headers-shim.ts src/server-only-shim.ts --format cjs,esm --dts --no-splitting --watch",
50
- "format": "prettier --write . && eslint . --fix",
50
+ "format": "prettier --write . && oxlint . --fix",
51
51
  "typecheck": "tsc --noEmit && tsc -p tsconfig.test.json",
52
- "lint": "eslint src/",
52
+ "lint": "oxlint src/",
53
53
  "test": "vitest run",
54
54
  "test:watch": "vitest"
55
55
  },
@@ -94,7 +94,6 @@
94
94
  }
95
95
  },
96
96
  "devDependencies": {
97
- "@eslint/js": "^9.0.0",
98
97
  "@neondatabase/serverless": "^1.0.0",
99
98
  "@stardeck-customer-apps/data-store-sdk": "*",
100
99
  "@stardeck-customer-apps/edge-sdk": "*",
@@ -109,7 +108,6 @@
109
108
  "next": "^16.3.0",
110
109
  "tsup": "^8.0.0",
111
110
  "typescript": "^5.0.0",
112
- "typescript-eslint": "^8.0.0",
113
111
  "vitest": "^3.2.4",
114
112
  "@stardeck-customer-apps/starlens": "*",
115
113
  "zod": "^4.3.5"