@noodleseed/one 0.84.3 → 0.84.5
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/assistant-embed-scaffold-template.d.ts.map +1 -1
- package/dist/assistant-embed-scaffold-template.js +3 -1
- package/dist/assistant-embed-scaffold-template.js.map +1 -1
- package/dist/commands/assistant-embed-ops.d.ts +1 -1
- package/dist/commands/assistant-embed-ops.d.ts.map +1 -1
- package/dist/commands/assistant-embed-ops.js +145 -1
- package/dist/commands/assistant-embed-ops.js.map +1 -1
- package/dist/commands/assistant-ops.js +1 -1
- package/dist/commands/assistant-ops.js.map +1 -1
- package/dist/commands/catalog-data-assistant.d.ts.map +1 -1
- package/dist/commands/catalog-data-assistant.js +14 -0
- package/dist/commands/catalog-data-assistant.js.map +1 -1
- package/node_modules/@noodle-borg/agent-kit/dist/behavior-skills.d.ts.map +1 -1
- package/node_modules/@noodle-borg/agent-kit/dist/behavior-skills.js +1 -0
- package/node_modules/@noodle-borg/agent-kit/dist/behavior-skills.js.map +1 -1
- package/node_modules/@noodle-borg/agent-kit/dist/generated/example-files.js +1 -1
- package/node_modules/@noodle-borg/agent-kit/dist/generated/example-files.js.map +1 -1
- package/node_modules/@noodle-borg/agent-kit/dist/skill-embedded-assistant-ref.d.ts.map +1 -1
- package/node_modules/@noodle-borg/agent-kit/dist/skill-embedded-assistant-ref.js +34 -2
- package/node_modules/@noodle-borg/agent-kit/dist/skill-embedded-assistant-ref.js.map +1 -1
- package/node_modules/@noodle-borg/agent-kit/package.json +1 -1
- package/node_modules/@noodle-borg/service/dist/platform-account-reset-legacy-materialization-postgres.d.ts +10 -0
- package/node_modules/@noodle-borg/service/dist/platform-account-reset-legacy-materialization-postgres.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/platform-account-reset-legacy-materialization-postgres.js +121 -0
- package/node_modules/@noodle-borg/service/dist/platform-account-reset-legacy-materialization-postgres.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/platform-account-reset-legacy-workspace-postgres.d.ts +23 -0
- package/node_modules/@noodle-borg/service/dist/platform-account-reset-legacy-workspace-postgres.d.ts.map +1 -0
- package/node_modules/@noodle-borg/service/dist/platform-account-reset-legacy-workspace-postgres.js +94 -0
- package/node_modules/@noodle-borg/service/dist/platform-account-reset-legacy-workspace-postgres.js.map +1 -0
- package/node_modules/@noodle-borg/service/dist/platform-account-reset-operation-postgres.d.ts +4 -0
- package/node_modules/@noodle-borg/service/dist/platform-account-reset-operation-postgres.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/platform-account-reset-operation-postgres.js +17 -0
- package/node_modules/@noodle-borg/service/dist/platform-account-reset-operation-postgres.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/platform-account-reset-operator.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/platform-account-reset-operator.js +13 -0
- package/node_modules/@noodle-borg/service/dist/platform-account-reset-operator.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/platform-account-reset-ownership-postgres.d.ts +3 -0
- package/node_modules/@noodle-borg/service/dist/platform-account-reset-ownership-postgres.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/platform-account-reset-ownership-postgres.js +11 -2
- package/node_modules/@noodle-borg/service/dist/platform-account-reset-ownership-postgres.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/platform-account-reset-preview-local-postgres.d.ts +3 -0
- package/node_modules/@noodle-borg/service/dist/platform-account-reset-preview-local-postgres.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/platform-account-reset-preview-local-postgres.js +117 -38
- package/node_modules/@noodle-borg/service/dist/platform-account-reset-preview-local-postgres.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/platform-account-reset-preview-persistence-postgres.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/platform-account-reset-preview-persistence-postgres.js +28 -9
- package/node_modules/@noodle-borg/service/dist/platform-account-reset-preview-persistence-postgres.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/platform-account-reset-preview-postgres.d.ts +1 -0
- package/node_modules/@noodle-borg/service/dist/platform-account-reset-preview-postgres.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/platform-account-reset-preview-postgres.js +16 -6
- package/node_modules/@noodle-borg/service/dist/platform-account-reset-preview-postgres.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/platform-account-reset-preview-result.d.ts +3 -0
- package/node_modules/@noodle-borg/service/dist/platform-account-reset-preview-result.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/platform-account-reset-preview-result.js +2 -0
- package/node_modules/@noodle-borg/service/dist/platform-account-reset-preview-result.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/platform-account-reset-quarantine-postgres.d.ts +2 -1
- package/node_modules/@noodle-borg/service/dist/platform-account-reset-quarantine-postgres.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/platform-account-reset-quarantine-postgres.js +21 -2
- package/node_modules/@noodle-borg/service/dist/platform-account-reset-quarantine-postgres.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/platform-account-reset-rollback-postgres.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/platform-account-reset-rollback-postgres.js +7 -0
- package/node_modules/@noodle-borg/service/dist/platform-account-reset-rollback-postgres.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/platform-account-reset-schema-postgres.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/platform-account-reset-schema-postgres.js +148 -0
- package/node_modules/@noodle-borg/service/dist/platform-account-reset-schema-postgres.js.map +1 -1
- package/node_modules/@noodle-borg/service/dist/platform-auth-inventory-source-fence-postgres.d.ts +2 -2
- package/node_modules/@noodle-borg/service/dist/platform-auth-inventory-source-fence-postgres.d.ts.map +1 -1
- package/node_modules/@noodle-borg/service/dist/platform-auth-inventory-source-fence-postgres.js +3 -1
- package/node_modules/@noodle-borg/service/dist/platform-auth-inventory-source-fence-postgres.js.map +1 -1
- package/package.json +1 -1
|
@@ -6,6 +6,7 @@ export function renderEmbeddedAssistantReference() {
|
|
|
6
6
|
'## Contents',
|
|
7
7
|
'',
|
|
8
8
|
'- Architecture',
|
|
9
|
+
'- Choose the host experience',
|
|
9
10
|
'- Author and validate',
|
|
10
11
|
'- Customize the presentation',
|
|
11
12
|
'- Configure and deploy',
|
|
@@ -16,6 +17,7 @@ export function renderEmbeddedAssistantReference() {
|
|
|
16
17
|
'- Verified session context (identity and claims)',
|
|
17
18
|
'- The session response',
|
|
18
19
|
'- Choose a browser renderer',
|
|
20
|
+
'- Host readiness and promotion',
|
|
19
21
|
'- Toolchain requirements',
|
|
20
22
|
'- Verify the boundary',
|
|
21
23
|
'- Troubleshooting: symptom to diagnosis',
|
|
@@ -24,12 +26,19 @@ export function renderEmbeddedAssistantReference() {
|
|
|
24
26
|
'',
|
|
25
27
|
'The browser never receives a model key, assistant client secret, MCP token, or raw application session. The embedding SaaS authenticates its own user, its backend exchanges that verified identity through `@noodleseed/assistant/server`, and the browser receives only a short-lived assistant session.',
|
|
26
28
|
'',
|
|
27
|
-
'Keep
|
|
29
|
+
'Keep every credential and identity layer separate:',
|
|
28
30
|
'',
|
|
29
31
|
'| Owner | Values | Destination |',
|
|
30
32
|
'| --- | --- | --- |',
|
|
33
|
+
'| Noodle operator | Login, selected org/app/env | Plugin-managed CLI profile and explicit target; never the SaaS runtime |',
|
|
31
34
|
'| Noodle deployment | `ASSISTANT_MODEL_BASE_URL`, `ASSISTANT_MODEL`, `ASSISTANT_MODEL_API_KEY` | `noodle variables set` / `noodle secrets set`; never the SaaS environment |',
|
|
32
|
-
'|
|
|
35
|
+
'| Connector/delegated exchange | Connector credentials and any customer-owned token-exchange client | Noodle managed configuration plus the matching customer backend secret manager |',
|
|
36
|
+
'| SaaS backend | `NOODLE_SERVICE_URL`, `NOODLE_ASSISTANT_CLIENT_ID`, `NOODLE_ASSISTANT_CLIENT_SECRET`, `PUBLIC_APP_ORIGIN` | Backend-only environment or secret manager; never browser code or public-prefixed variables |',
|
|
37
|
+
'| Browser | Short-lived assistant session only | In memory; never a client secret, model key, connector credential, or raw application session |',
|
|
38
|
+
'',
|
|
39
|
+
'## Choose the host experience',
|
|
40
|
+
'',
|
|
41
|
+
'Before choosing code, ask the user which experience belongs in the existing product: the built-in floating, inline, or drawer assistant; a custom chat-first renderer; or a headless client feeding application-owned UI. Default to the built-in floating assistant only when the user has no preference. Preserve the host application until the user opens or submits into the assistant; do not copy one flagship layout into every product.',
|
|
33
42
|
'',
|
|
34
43
|
'## Author and validate',
|
|
35
44
|
'',
|
|
@@ -467,6 +476,23 @@ export function renderEmbeddedAssistantReference() {
|
|
|
467
476
|
'',
|
|
468
477
|
'`clientContext` and typed `pageContext` are recomputed for each turn. `updateContext(...)` remains the legacy session-exchange context; `updatePageContext(...)` replaces the fresh per-turn application hint. `updateModelContext({ content, structuredContent })` publishes one cohesive renderer snapshot for later message turns without starting a turn; every call replaces the prior snapshot rather than merging fields. These are untrusted data, not conversation history or authorization input, and the boundaries reject credential-shaped or unbounded updates. A message may re-exchange once after a pre-execution `401`; the client never auto-retries interaction decisions. `tool_proposed.arguments` is a complete schema-aware review projection and, for connector-backed tools, names the sole exact connector version/operation/resolved arguments. Sensitive/write-only fields are redacted; truncating or omitting any non-sensitive action field fails closed. Accept is bound to the server-held action and claims at most one execution attempt—clients cannot replace it. Normal terminal outcomes scrub private arguments and continuations immediately; only an accepted action still executing retains them for the one-hour unknown-outcome recovery window, after which it records `interaction_outcome_unknown` and scrubs. Without downstream idempotency this is not an exactly-once business-effect guarantee. To reconcile a lost response, explicitly repeat the same id and decision: the service returns its durable stored outcome without re-execution.',
|
|
469
478
|
'',
|
|
479
|
+
'## Host readiness and promotion',
|
|
480
|
+
'',
|
|
481
|
+
'Run the non-mutating host preflight from the embedding application before its production build:',
|
|
482
|
+
'',
|
|
483
|
+
'```sh',
|
|
484
|
+
'noodle assistant embed --check --json',
|
|
485
|
+
'noodle assistant embed --check --json --require-env EXAMPLE_DELEG_CLIENT_SECRET',
|
|
486
|
+
'```',
|
|
487
|
+
'',
|
|
488
|
+
'The check reports only required and missing environment names, never their values. It checks both `connect-src` and `frame-src` when a common static host CSP is determinable, fails on missing directives, and marks a dynamic expression unverified instead of guessing. Additional `--require-env` names are application-owned; use them for the customer side of delegated exchange or other backend-only integration requirements.',
|
|
489
|
+
'',
|
|
490
|
+
'Inspect the host repository for generated environment bindings after adding names. Run its existing generator, review the diff, commit generated types only when that repository requires them, then run the production-equivalent host build. Do not invent a framework command or add a second generator.',
|
|
491
|
+
'',
|
|
492
|
+
'Promotion checklist: provision each environment in the backend secret manager; map names through the CI environment and any secret allowlist or secrets file; run the presence-only preflight before asset upload; promote configuration before code; run the post-deploy probes from the JSON contract; rotate the assistant client and delegated credential independently, then rerun the same checks.',
|
|
493
|
+
'',
|
|
494
|
+
"Devtools privacy gate: default model and connector exercises to synthetic or mock data. Before Devtools Chat sends real connector data to an external model, disclose the data flow and obtain the user's approval. A local validation pass is not that approval.",
|
|
495
|
+
'',
|
|
470
496
|
'## Toolchain requirements',
|
|
471
497
|
'',
|
|
472
498
|
'- Node.js 20+ for `@noodleseed/assistant/server`.',
|
|
@@ -482,6 +508,8 @@ export function renderEmbeddedAssistantReference() {
|
|
|
482
508
|
'- An expired turn re-exchanges once; interaction decisions never auto-retry. An explicit same-decision repeat returns the stored outcome without executing again.',
|
|
483
509
|
'- Accept, decline, and cancel are single-use. Only accept executes; the server ignores replacement tool arguments.',
|
|
484
510
|
'- Wrong-origin and malformed-origin requests fail closed.',
|
|
511
|
+
'- Run the production-equivalent host build after regenerating environment bindings.',
|
|
512
|
+
'- In a real browser, submit with the keyboard, inspect console and network failures, complete session exchange and one tool turn, and render one linked App before claiming the host works.',
|
|
485
513
|
'',
|
|
486
514
|
'## Troubleshooting: symptom to diagnosis',
|
|
487
515
|
'',
|
|
@@ -495,6 +523,10 @@ export function renderEmbeddedAssistantReference() {
|
|
|
495
523
|
'| Validate rejects an origin | Non-loopback HTTP origin in `allowedOrigins` | Use the exact HTTPS production origin; HTTP is only for `localhost`/`127.0.0.1` |',
|
|
496
524
|
'| Session exchange returns 404 | `serviceUrl` points at the deployment MCP endpoint | Use the control-plane service URL printed by `noodle assistant clients create` |',
|
|
497
525
|
'| Session exchange returns 403 `origin is not allowed` | Request origin differs from `allowedOrigins` character-for-character | Align the exact scheme/host/port on both sides and redeploy |',
|
|
526
|
+
'| Host session 503 | A required backend environment name is absent or mapped into the wrong deployment environment | Run `noodle assistant embed --check --json`, repair the host CI mapping, then probe the session route again |',
|
|
527
|
+
'| `HEAD` on a widget or session path looks broken | The route contract is `GET` for the hosted sandbox/widget document or `POST` for session exchange; `HEAD` is not the product flow | Exercise the documented method and inspect its response instead of inferring readiness from `HEAD` |',
|
|
528
|
+
'| Local server reports `listen EPERM` | The coding sandbox blocked loopback binding before application behavior ran | Rerun the same local/browser test with approved loopback permissions; do not change product code |',
|
|
529
|
+
'| Tool succeeds but the widget is empty | The linked App delivery layer failed: result shape, resource link, CSP frame, or bridge hydration | Inspect the typed result, `view_available`, resource URI, browser console, and hosted frame separately |',
|
|
498
530
|
'| Hydration or `HTMLElement is not defined` errors | The component mounted during server rendering | Mount client-only (`"use client"` or `next/dynamic` with `ssr: false`) |',
|
|
499
531
|
'| A tool runs without the expected confirmation | Its compiled annotations omit `confirm: true` or explicitly set `false` | Pass `{ confirm: true }` to the action helper; action hints alone never gate. `noodle check --target embedded-assistant` lists every confirm-gated tool |',
|
|
500
532
|
'| `${user.claims.<key>}` is empty | Claim not declared in `sessionClaims` (or key typo) — undeclared claims are dropped at exchange | Declare the key in `embeddedAssistant({ sessionClaims })` and redeploy |',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skill-embedded-assistant-ref.js","sourceRoot":"","sources":["../src/skill-embedded-assistant-ref.ts"],"names":[],"mappings":"AAAA,mGAAmG;AACnG,MAAM,UAAU,gCAAgC;IAC9C,OAAO;QACL,sBAAsB;QACtB,EAAE;QACF,aAAa;QACb,EAAE;QACF,gBAAgB;QAChB,uBAAuB;QACvB,8BAA8B;QAC9B,wBAAwB;QACxB,kCAAkC;QAClC,6BAA6B;QAC7B,kCAAkC;QAClC,iCAAiC;QACjC,kDAAkD;QAClD,wBAAwB;QACxB,6BAA6B;QAC7B,0BAA0B;QAC1B,uBAAuB;QACvB,yCAAyC;QACzC,EAAE;QACF,iBAAiB;QACjB,EAAE;QACF,4SAA4S;QAC5S,EAAE;QACF,
|
|
1
|
+
{"version":3,"file":"skill-embedded-assistant-ref.js","sourceRoot":"","sources":["../src/skill-embedded-assistant-ref.ts"],"names":[],"mappings":"AAAA,mGAAmG;AACnG,MAAM,UAAU,gCAAgC;IAC9C,OAAO;QACL,sBAAsB;QACtB,EAAE;QACF,aAAa;QACb,EAAE;QACF,gBAAgB;QAChB,8BAA8B;QAC9B,uBAAuB;QACvB,8BAA8B;QAC9B,wBAAwB;QACxB,kCAAkC;QAClC,6BAA6B;QAC7B,kCAAkC;QAClC,iCAAiC;QACjC,kDAAkD;QAClD,wBAAwB;QACxB,6BAA6B;QAC7B,gCAAgC;QAChC,0BAA0B;QAC1B,uBAAuB;QACvB,yCAAyC;QACzC,EAAE;QACF,iBAAiB;QACjB,EAAE;QACF,4SAA4S;QAC5S,EAAE;QACF,oDAAoD;QACpD,EAAE;QACF,kCAAkC;QAClC,qBAAqB;QACrB,4HAA4H;QAC5H,8KAA8K;QAC9K,wLAAwL;QACxL,4NAA4N;QAC5N,kJAAkJ;QAClJ,EAAE;QACF,+BAA+B;QAC/B,EAAE;QACF,kbAAkb;QAClb,EAAE;QACF,wBAAwB;QACxB,EAAE;QACF,6IAA6I;QAC7I,EAAE;QACF,OAAO;QACP,gDAAgD;QAChD,wEAAwE;QACxE,gCAAgC;QAChC,6BAA6B;QAC7B,oDAAoD;QACpD,yCAAyC;QACzC,gDAAgD;QAChD,OAAO;QACP,yEAAyE;QACzE,2DAA2D;QAC3D,KAAK;QACL,KAAK;QACL,EAAE;QACF,qUAAqU;QACrU,EAAE;Q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K,wKAAwK;QACxK,+LAA+L;QAC/L,oOAAoO;QACpO,8RAA8R;QAC9R,0NAA0N;QAC1N,wPAAwP;QACxP,+KAA+K;QAC/K,uRAAuR;QACvR,gNAAgN;QAChN,4JAA4J;QAC5J,yHAAyH;QACzH,oOAAoO;QACpO,mRAAmR;QACnR,mMAAmM;QACnM,6LAA6L;QAC7L,gbAAgb;QAChb,iPAAiP;KAClP,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACf,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { PlatformIdentityQueryable } from './platform-identity-postgres.js';
|
|
2
|
+
export type PlatformAccountResetLegacyMaterializationBoundary = 'legacy_principals_materialized' | 'legacy_links_materialized' | 'legacy_workspace_bindings_materialized' | 'legacy_targets_migrated';
|
|
3
|
+
export declare function materializePlatformAccountResetLegacyTargets(connection: PlatformIdentityQueryable, input: {
|
|
4
|
+
readonly operationId: string;
|
|
5
|
+
readonly targets: readonly string[];
|
|
6
|
+
readonly googleRealm: string;
|
|
7
|
+
readonly normalizedContacts: ReadonlyMap<string, string>;
|
|
8
|
+
readonly fault?: (boundary: PlatformAccountResetLegacyMaterializationBoundary) => void | Promise<void>;
|
|
9
|
+
}): Promise<void>;
|
|
10
|
+
//# sourceMappingURL=platform-account-reset-legacy-materialization-postgres.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"platform-account-reset-legacy-materialization-postgres.d.ts","sourceRoot":"","sources":["../src/platform-account-reset-legacy-materialization-postgres.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,iCAAiC,CAAC;AAEjF,MAAM,MAAM,iDAAiD,GACzD,gCAAgC,GAChC,2BAA2B,GAC3B,wCAAwC,GACxC,yBAAyB,CAAC;AAE9B,wBAAsB,4CAA4C,CAChE,UAAU,EAAE,yBAAyB,EACrC,KAAK,EAAE;IACL,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IACpC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,kBAAkB,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACzD,QAAQ,CAAC,KAAK,CAAC,EAAE,CACf,QAAQ,EAAE,iDAAiD,KACxD,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC3B,GACA,OAAO,CAAC,IAAI,CAAC,CA6Hf"}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { sha256Canonical } from './platform-account-reset-fingerprint.js';
|
|
2
|
+
import { createPlatformAccountResetLegacyWorkspacePlan, } from './platform-account-reset-legacy-workspace-postgres.js';
|
|
3
|
+
import { PlatformAccountResetPreviewError } from './platform-account-reset-preview-result.js';
|
|
4
|
+
export async function materializePlatformAccountResetLegacyTargets(connection, input) {
|
|
5
|
+
const targetFingerprints = input.targets.map((target) => sha256Canonical(target));
|
|
6
|
+
const contactValues = input.targets.map((target) => input.normalizedContacts.get(target) ?? '');
|
|
7
|
+
const evidence = await connection.query(`SELECT
|
|
8
|
+
(SELECT count(*)::int FROM platform_principals
|
|
9
|
+
WHERE principal_id = ANY($1::text[])
|
|
10
|
+
OR (billing_identity_issuer = 'https://accounts.google.com'
|
|
11
|
+
AND billing_subject = ANY($1::text[]))) AS principal_count,
|
|
12
|
+
(SELECT count(*)::int FROM platform_identity_links
|
|
13
|
+
WHERE principal_id = ANY($1::text[])
|
|
14
|
+
OR (provider = 'google' AND realm = $2
|
|
15
|
+
AND external_id = ANY($1::text[]))) AS link_count,
|
|
16
|
+
(SELECT count(*)::int FROM platform_verified_emails
|
|
17
|
+
WHERE principal_id = ANY($1::text[])
|
|
18
|
+
OR normalized_email = ANY($4::text[])) AS verified_count,
|
|
19
|
+
(SELECT count(*)::int FROM identity_backfill_ledger
|
|
20
|
+
WHERE source_subject = ANY($1::text[])
|
|
21
|
+
OR principal_id = ANY($1::text[])) AS backfill_count,
|
|
22
|
+
(SELECT count(*)::int FROM platform_identity_sync_outbox
|
|
23
|
+
WHERE principal_id = ANY($1::text[])
|
|
24
|
+
OR lease_normalized_email = ANY($4::text[])) AS outbox_count,
|
|
25
|
+
(SELECT count(*)::int FROM personal_workspace_bindings
|
|
26
|
+
WHERE principal_subject = ANY($1::text[])) AS binding_count,
|
|
27
|
+
(SELECT count(*)::int FROM workos_import_ledger
|
|
28
|
+
WHERE principal_id = ANY($1::text[])) AS import_count,
|
|
29
|
+
(SELECT count(*)::int FROM workos_import_attempt_evidence
|
|
30
|
+
WHERE principal_id = ANY($1::text[])
|
|
31
|
+
OR principal_fingerprint = ANY($3::text[])) AS attempt_count`, [input.targets, input.googleRealm, targetFingerprints, contactValues]);
|
|
32
|
+
const counts = evidence.rows[0];
|
|
33
|
+
if (counts === undefined ||
|
|
34
|
+
counts.principal_count !== 0 ||
|
|
35
|
+
counts.link_count !== 0 ||
|
|
36
|
+
counts.verified_count !== 0 ||
|
|
37
|
+
counts.backfill_count !== 0 ||
|
|
38
|
+
counts.outbox_count !== 0 ||
|
|
39
|
+
counts.binding_count !== 0 ||
|
|
40
|
+
counts.import_count !== 0 ||
|
|
41
|
+
counts.attempt_count !== 0)
|
|
42
|
+
throw new PlatformAccountResetPreviewError('operation_conflict');
|
|
43
|
+
const workspacePlans = await loadLegacyWorkspacePlans(connection, input.operationId, input.targets);
|
|
44
|
+
const principals = await connection.query(`INSERT INTO platform_principals
|
|
45
|
+
(principal_id, status, billing_identity_issuer, billing_subject)
|
|
46
|
+
SELECT target, 'active', 'https://accounts.google.com', target
|
|
47
|
+
FROM unnest($1::text[]) AS target
|
|
48
|
+
RETURNING principal_id`, [input.targets]);
|
|
49
|
+
if (principals.rows.length !== 3)
|
|
50
|
+
throw new PlatformAccountResetPreviewError('operation_conflict');
|
|
51
|
+
await input.fault?.('legacy_principals_materialized');
|
|
52
|
+
const links = await connection.query(`INSERT INTO platform_identity_links
|
|
53
|
+
(provider, realm, external_id, principal_id)
|
|
54
|
+
SELECT 'google', $2, target, target
|
|
55
|
+
FROM unnest($1::text[]) AS target
|
|
56
|
+
RETURNING external_id`, [input.targets, input.googleRealm]);
|
|
57
|
+
if (links.rows.length !== 3)
|
|
58
|
+
throw new PlatformAccountResetPreviewError('operation_conflict');
|
|
59
|
+
await input.fault?.('legacy_links_materialized');
|
|
60
|
+
const bindings = await connection.query(`INSERT INTO personal_workspace_bindings
|
|
61
|
+
(principal_subject, org_slug, billing_identity_issuer, billing_subject,
|
|
62
|
+
billing_account_id)
|
|
63
|
+
SELECT legacy_google_subject, personal_org_slug, billing_identity_issuer,
|
|
64
|
+
billing_subject, billing_account_id
|
|
65
|
+
FROM platform_account_reset_legacy_targets
|
|
66
|
+
WHERE operation_id = $1 AND lifecycle = 'previewed'
|
|
67
|
+
ORDER BY legacy_google_subject
|
|
68
|
+
RETURNING principal_subject`, [input.operationId]);
|
|
69
|
+
if (bindings.rows.length !== 3 ||
|
|
70
|
+
bindings.rows.some((row) => typeof row.principal_subject !== 'string' || !workspacePlans.has(row.principal_subject)))
|
|
71
|
+
throw new PlatformAccountResetPreviewError('operation_conflict');
|
|
72
|
+
await input.fault?.('legacy_workspace_bindings_materialized');
|
|
73
|
+
const staged = await connection.query(`UPDATE platform_account_reset_legacy_targets
|
|
74
|
+
SET lifecycle = 'materialized', updated_at = clock_timestamp()
|
|
75
|
+
WHERE operation_id = $1 AND lifecycle = 'previewed'
|
|
76
|
+
RETURNING legacy_google_subject`, [input.operationId]);
|
|
77
|
+
if (staged.rows.length !== 3)
|
|
78
|
+
throw new PlatformAccountResetPreviewError('operation_conflict');
|
|
79
|
+
const migrated = await connection.query(`INSERT INTO platform_account_reset_targets
|
|
80
|
+
(operation_id, principal_id, target_fingerprint,
|
|
81
|
+
source_snapshot_fingerprint, lifecycle)
|
|
82
|
+
SELECT operation_id, legacy_google_subject, target_fingerprint,
|
|
83
|
+
source_snapshot_fingerprint, 'previewed'
|
|
84
|
+
FROM platform_account_reset_legacy_targets
|
|
85
|
+
WHERE operation_id = $1 AND lifecycle = 'materialized'
|
|
86
|
+
RETURNING principal_id`, [input.operationId]);
|
|
87
|
+
if (migrated.rows.length !== 3)
|
|
88
|
+
throw new PlatformAccountResetPreviewError('operation_conflict');
|
|
89
|
+
await input.fault?.('legacy_targets_migrated');
|
|
90
|
+
}
|
|
91
|
+
async function loadLegacyWorkspacePlans(connection, operationId, targets) {
|
|
92
|
+
const result = await connection.query(`SELECT legacy_google_subject, personal_org_slug, billing_identity_issuer,
|
|
93
|
+
billing_subject, billing_account_id, workspace_plan_fingerprint
|
|
94
|
+
FROM platform_account_reset_legacy_targets
|
|
95
|
+
WHERE operation_id = $1 AND lifecycle = 'previewed'
|
|
96
|
+
ORDER BY legacy_google_subject
|
|
97
|
+
FOR UPDATE`, [operationId]);
|
|
98
|
+
if (result.rows.length !== 3)
|
|
99
|
+
throw new PlatformAccountResetPreviewError('operation_conflict');
|
|
100
|
+
const plans = new Map();
|
|
101
|
+
for (const row of result.rows) {
|
|
102
|
+
if (row.billing_identity_issuer !== 'https://accounts.google.com' ||
|
|
103
|
+
row.billing_subject !== row.legacy_google_subject ||
|
|
104
|
+
!targets.includes(row.legacy_google_subject))
|
|
105
|
+
throw new PlatformAccountResetPreviewError('operation_conflict');
|
|
106
|
+
const plan = createPlatformAccountResetLegacyWorkspacePlan({
|
|
107
|
+
principalSubject: row.legacy_google_subject,
|
|
108
|
+
orgSlug: row.personal_org_slug,
|
|
109
|
+
billingIdentityIssuer: row.billing_identity_issuer,
|
|
110
|
+
billingSubject: row.billing_subject,
|
|
111
|
+
billingAccountId: row.billing_account_id,
|
|
112
|
+
});
|
|
113
|
+
if (plan.planFingerprint !== row.workspace_plan_fingerprint)
|
|
114
|
+
throw new PlatformAccountResetPreviewError('operation_conflict');
|
|
115
|
+
plans.set(row.legacy_google_subject, plan);
|
|
116
|
+
}
|
|
117
|
+
if (plans.size !== 3)
|
|
118
|
+
throw new PlatformAccountResetPreviewError('operation_conflict');
|
|
119
|
+
return plans;
|
|
120
|
+
}
|
|
121
|
+
//# sourceMappingURL=platform-account-reset-legacy-materialization-postgres.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"platform-account-reset-legacy-materialization-postgres.js","sourceRoot":"","sources":["../src/platform-account-reset-legacy-materialization-postgres.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,yCAAyC,CAAC;AAC1E,OAAO,EACL,6CAA6C,GAE9C,MAAM,uDAAuD,CAAC;AAC/D,OAAO,EAAE,gCAAgC,EAAE,MAAM,4CAA4C,CAAC;AAS9F,MAAM,CAAC,KAAK,UAAU,4CAA4C,CAChE,UAAqC,EACrC,KAQC;IAED,MAAM,kBAAkB,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC;IAClF,MAAM,aAAa,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,KAAK,CAAC,kBAAkB,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC;IAChG,MAAM,QAAQ,GAAG,MAAM,UAAU,CAAC,KAAK,CAUrC;;;;;;;;;;;;;;;;;;;;;;;;yEAwBqE,EACrE,CAAC,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,WAAW,EAAE,kBAAkB,EAAE,aAAa,CAAC,CACtE,CAAC;IACF,MAAM,MAAM,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAChC,IACE,MAAM,KAAK,SAAS;QACpB,MAAM,CAAC,eAAe,KAAK,CAAC;QAC5B,MAAM,CAAC,UAAU,KAAK,CAAC;QACvB,MAAM,CAAC,cAAc,KAAK,CAAC;QAC3B,MAAM,CAAC,cAAc,KAAK,CAAC;QAC3B,MAAM,CAAC,YAAY,KAAK,CA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;QACnE,MAAM,IAAI,GAAG,6CAA6C,CAAC;YACzD,gBAAgB,EAAE,GAAG,CAAC,qBAAqB;YAC3C,OAAO,EAAE,GAAG,CAAC,iBAAiB;YAC9B,qBAAqB,EAAE,GAAG,CAAC,uBAAuB;YAClD,cAAc,EAAE,GAAG,CAAC,eAAe;YACnC,gBAAgB,EAAE,GAAG,CAAC,kBAAkB;SACzC,CAAC,CAAC;QACH,IAAI,IAAI,CAAC,eAAe,KAAK,GAAG,CAAC,0BAA0B;YACzD,MAAM,IAAI,gCAAgC,CAAC,oBAAoB,CAAC,CAAC;QACnE,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,qBAAqB,EAAE,IAAI,CAAC,CAAC;IAC7C,CAAC;IACD,IAAI,KAAK,CAAC,IAAI,KAAK,CAAC;QAAE,MAAM,IAAI,gCAAgC,CAAC,oBAAoB,CAAC,CAAC;IACvF,OAAO,KAAK,CAAC;AACf,CAAC"}
|
package/node_modules/@noodle-borg/service/dist/platform-account-reset-legacy-workspace-postgres.d.ts
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { PlatformIdentityQueryable } from './platform-identity-postgres.js';
|
|
2
|
+
declare const GOOGLE_BILLING_ISSUER = "https://accounts.google.com";
|
|
3
|
+
export interface PlatformAccountResetLegacyWorkspacePlan {
|
|
4
|
+
readonly principalSubject: string;
|
|
5
|
+
readonly orgSlug: string;
|
|
6
|
+
readonly billingIdentityIssuer: typeof GOOGLE_BILLING_ISSUER;
|
|
7
|
+
readonly billingSubject: string;
|
|
8
|
+
readonly billingAccountId: string;
|
|
9
|
+
readonly planFingerprint: string;
|
|
10
|
+
}
|
|
11
|
+
export interface PlatformAccountResetLegacyWorkspaceEvidence {
|
|
12
|
+
readonly plans: ReadonlyMap<string, PlatformAccountResetLegacyWorkspacePlan>;
|
|
13
|
+
readonly evidenceByTarget: ReadonlyMap<string, Readonly<Record<string, unknown>>>;
|
|
14
|
+
readonly mismatchCount: number;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Derives the one personal-workspace tuple already implied by immutable owner/default/home/member rows.
|
|
18
|
+
* It never mutates those rows and deliberately excludes an existing personal binding from its authority.
|
|
19
|
+
*/
|
|
20
|
+
export declare function loadPlatformAccountResetLegacyWorkspaceEvidence(connection: PlatformIdentityQueryable, targets: readonly string[], normalizedContacts: ReadonlyMap<string, string>): Promise<PlatformAccountResetLegacyWorkspaceEvidence>;
|
|
21
|
+
export declare function createPlatformAccountResetLegacyWorkspacePlan(input: Omit<PlatformAccountResetLegacyWorkspacePlan, 'planFingerprint'>): PlatformAccountResetLegacyWorkspacePlan;
|
|
22
|
+
export {};
|
|
23
|
+
//# sourceMappingURL=platform-account-reset-legacy-workspace-postgres.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"platform-account-reset-legacy-workspace-postgres.d.ts","sourceRoot":"","sources":["../src/platform-account-reset-legacy-workspace-postgres.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,iCAAiC,CAAC;AAEjF,QAAA,MAAM,qBAAqB,gCAAgC,CAAC;AAY5D,MAAM,WAAW,uCAAuC;IACtD,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;IAClC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,qBAAqB,EAAE,OAAO,qBAAqB,CAAC;IAC7D,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;IAClC,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;CAClC;AAED,MAAM,WAAW,2CAA2C;IAC1D,QAAQ,CAAC,KAAK,EAAE,WAAW,CAAC,MAAM,EAAE,uCAAuC,CAAC,CAAC;IAC7E,QAAQ,CAAC,gBAAgB,EAAE,WAAW,CAAC,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC;IAClF,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;CAChC;AAED;;;GAGG;AACH,wBAAsB,+CAA+C,CACnE,UAAU,EAAE,yBAAyB,EACrC,OAAO,EAAE,SAAS,MAAM,EAAE,EAC1B,kBAAkB,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,GAC9C,OAAO,CAAC,2CAA2C,CAAC,CA+DtD;AAED,wBAAgB,6CAA6C,CAC3D,KAAK,EAAE,IAAI,CAAC,uCAAuC,EAAE,iBAAiB,CAAC,GACtE,uCAAuC,CAazC"}
|
package/node_modules/@noodle-borg/service/dist/platform-account-reset-legacy-workspace-postgres.js
ADDED
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { sha256Canonical } from './platform-account-reset-fingerprint.js';
|
|
2
|
+
import { normalizePlatformIdentityEmail } from './platform-identity.js';
|
|
3
|
+
const GOOGLE_BILLING_ISSUER = 'https://accounts.google.com';
|
|
4
|
+
/**
|
|
5
|
+
* Derives the one personal-workspace tuple already implied by immutable owner/default/home/member rows.
|
|
6
|
+
* It never mutates those rows and deliberately excludes an existing personal binding from its authority.
|
|
7
|
+
*/
|
|
8
|
+
export async function loadPlatformAccountResetLegacyWorkspaceEvidence(connection, targets, normalizedContacts) {
|
|
9
|
+
const result = await connection.query(`SELECT member.subject AS principal_subject, member.org_slug,
|
|
10
|
+
member.email AS org_owner_email,
|
|
11
|
+
defaults.identity_issuer AS billing_identity_issuer,
|
|
12
|
+
defaults.subject AS billing_subject,
|
|
13
|
+
defaults.billing_account_id,
|
|
14
|
+
billing_member.email AS billing_owner_email
|
|
15
|
+
FROM org_members member
|
|
16
|
+
JOIN org_billing_home_accounts home
|
|
17
|
+
ON home.org_slug = member.org_slug
|
|
18
|
+
AND home.home_owner_identity_issuer = $2
|
|
19
|
+
AND home.home_owner_subject = member.subject
|
|
20
|
+
JOIN billing_account_defaults defaults
|
|
21
|
+
ON defaults.identity_issuer = home.home_owner_identity_issuer
|
|
22
|
+
AND defaults.subject = home.home_owner_subject
|
|
23
|
+
AND defaults.billing_account_id = home.billing_account_id
|
|
24
|
+
JOIN billing_account_members billing_member
|
|
25
|
+
ON billing_member.billing_account_id = defaults.billing_account_id
|
|
26
|
+
AND billing_member.identity_issuer = defaults.identity_issuer
|
|
27
|
+
AND billing_member.subject = defaults.subject
|
|
28
|
+
AND billing_member.role = 'owner'
|
|
29
|
+
WHERE member.subject = ANY($1::text[])
|
|
30
|
+
AND member.role = 'owner'
|
|
31
|
+
ORDER BY member.subject, member.org_slug, defaults.billing_account_id`, [targets, GOOGLE_BILLING_ISSUER]);
|
|
32
|
+
const rowsByTarget = groupBy(result.rows, (row) => row.principal_subject);
|
|
33
|
+
const plans = new Map();
|
|
34
|
+
const evidenceByTarget = new Map();
|
|
35
|
+
let mismatchCount = 0;
|
|
36
|
+
for (const target of targets) {
|
|
37
|
+
const contact = normalizedContacts.get(target);
|
|
38
|
+
const candidates = (rowsByTarget.get(target) ?? []).filter((row) => row.billing_identity_issuer === GOOGLE_BILLING_ISSUER &&
|
|
39
|
+
row.billing_subject === target &&
|
|
40
|
+
contact !== undefined &&
|
|
41
|
+
safelyNormalizeEmail(row.org_owner_email) === contact &&
|
|
42
|
+
safelyNormalizeEmail(row.billing_owner_email) === contact);
|
|
43
|
+
const normalizedCandidates = candidates.map((row) => createPlatformAccountResetLegacyWorkspacePlan({
|
|
44
|
+
principalSubject: target,
|
|
45
|
+
orgSlug: row.org_slug,
|
|
46
|
+
billingIdentityIssuer: GOOGLE_BILLING_ISSUER,
|
|
47
|
+
billingSubject: target,
|
|
48
|
+
billingAccountId: row.billing_account_id,
|
|
49
|
+
}));
|
|
50
|
+
evidenceByTarget.set(target, {
|
|
51
|
+
schemaVersion: 1,
|
|
52
|
+
label: 'platform_account_reset_legacy_workspace_candidates',
|
|
53
|
+
candidateCount: normalizedCandidates.length,
|
|
54
|
+
candidateFingerprints: normalizedCandidates.map((candidate) => candidate.planFingerprint),
|
|
55
|
+
});
|
|
56
|
+
if (normalizedCandidates.length !== 1) {
|
|
57
|
+
mismatchCount += 1;
|
|
58
|
+
continue;
|
|
59
|
+
}
|
|
60
|
+
plans.set(target, normalizedCandidates[0]);
|
|
61
|
+
}
|
|
62
|
+
return { plans, evidenceByTarget, mismatchCount };
|
|
63
|
+
}
|
|
64
|
+
export function createPlatformAccountResetLegacyWorkspacePlan(input) {
|
|
65
|
+
return {
|
|
66
|
+
...input,
|
|
67
|
+
planFingerprint: sha256Canonical({
|
|
68
|
+
schemaVersion: 1,
|
|
69
|
+
label: 'platform_account_reset_legacy_workspace_plan',
|
|
70
|
+
principalSubject: input.principalSubject,
|
|
71
|
+
orgSlug: input.orgSlug,
|
|
72
|
+
billingIdentityIssuer: input.billingIdentityIssuer,
|
|
73
|
+
billingSubject: input.billingSubject,
|
|
74
|
+
billingAccountId: input.billingAccountId,
|
|
75
|
+
}),
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
function safelyNormalizeEmail(value) {
|
|
79
|
+
try {
|
|
80
|
+
return normalizePlatformIdentityEmail(value);
|
|
81
|
+
}
|
|
82
|
+
catch {
|
|
83
|
+
return undefined;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
function groupBy(values, key) {
|
|
87
|
+
const grouped = new Map();
|
|
88
|
+
for (const value of values) {
|
|
89
|
+
const itemKey = key(value);
|
|
90
|
+
grouped.set(itemKey, [...(grouped.get(itemKey) ?? []), value]);
|
|
91
|
+
}
|
|
92
|
+
return grouped;
|
|
93
|
+
}
|
|
94
|
+
//# sourceMappingURL=platform-account-reset-legacy-workspace-postgres.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"platform-account-reset-legacy-workspace-postgres.js","sourceRoot":"","sources":["../src/platform-account-reset-legacy-workspace-postgres.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,yCAAyC,CAAC;AAC1E,OAAO,EAAE,8BAA8B,EAAE,MAAM,wBAAwB,CA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AC;IACvC,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;QAC3B,MAAM,OAAO,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC;QAC3B,OAAO,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC;IACjE,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
package/node_modules/@noodle-borg/service/dist/platform-account-reset-operation-postgres.d.ts
CHANGED
|
@@ -66,6 +66,10 @@ export declare function platformAccountResetActionEvidence(request: PlatformAcco
|
|
|
66
66
|
export declare function lockPlatformAccountResetOperation(connection: PlatformIdentityQueryable, operationId: string): Promise<PlatformAccountResetOperationRow>;
|
|
67
67
|
export declare function assertPlatformAccountResetApprovedTargetSet(operation: PlatformAccountResetOperationRow, approvedTargetSetFingerprint: string): void;
|
|
68
68
|
export declare function loadPlatformAccountResetTargets(connection: PlatformIdentityQueryable, operationId: string, lifecycle: 'previewed' | 'quarantined'): Promise<readonly string[]>;
|
|
69
|
+
export declare function loadPlatformAccountResetPreviewTargetSet(connection: PlatformIdentityQueryable, operationId: string): Promise<{
|
|
70
|
+
readonly shape: 'canonical' | 'legacy_absent';
|
|
71
|
+
readonly targets: readonly string[];
|
|
72
|
+
}>;
|
|
69
73
|
export declare function loadPlatformAccountResetFrozenResources(connection: PlatformIdentityQueryable, operationId: string): Promise<PlatformAccountResetFrozenResources>;
|
|
70
74
|
export declare function parsePlatformAccountResetSafeResult(value: unknown): PlatformAccountResetResult;
|
|
71
75
|
export declare function assertPlatformAccountResetRequestMatches(operation: PlatformAccountResetOperationRow, request: PlatformAccountResetExecuteRequest, options: {
|
package/node_modules/@noodle-borg/service/dist/platform-account-reset-operation-postgres.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"platform-account-reset-operation-postgres.d.ts","sourceRoot":"","s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,GAAG,eAAe,CAAC;IAC9C,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;CACrC,CAAC,CAsBD;AAED,wBAAsB,uCAAuC,CAC3D,UAAU,EAAE,yBAAyB,EACrC,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,mCAAmC,CAAC,CAgF9C;AAED,wBAAgB,mCAAmC,CAAC,KAAK,EAAE,OAAO,GAAG,0BAA0B,CAI9F;AAED,wBAAgB,wCAAwC,CACtD,SAAS,EAAE,gCAAgC,EAC3C,OAAO,EAAE,kCAAkC,EAC3C,OAAO,EAAE;IAAE,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;CAAE,GACrE,IAAI,CASN;AAED,wBAAgB,sCAAsC,CACpD,QAAQ,EAAE,kCAAkC,EAC5C,MAAM,EAAE;IACN,QAAQ,CAAC,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3C,QAAQ,CAAC,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3C,QAAQ,CAAC,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1C,QAAQ,CAAC,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IACzC,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAC;CAC9B,GACA,0BAA0B,CAS5B"}
|
|
@@ -66,6 +66,23 @@ export async function loadPlatformAccountResetTargets(connection, operationId, l
|
|
|
66
66
|
throw new PlatformAccountResetPreviewError('target_count_invalid');
|
|
67
67
|
return result.rows.map((row) => row.principal_id);
|
|
68
68
|
}
|
|
69
|
+
export async function loadPlatformAccountResetPreviewTargetSet(connection, operationId) {
|
|
70
|
+
const canonical = await connection.query(`SELECT principal_id
|
|
71
|
+
FROM platform_account_reset_targets
|
|
72
|
+
WHERE operation_id = $1 AND lifecycle = 'previewed'
|
|
73
|
+
ORDER BY principal_id
|
|
74
|
+
FOR UPDATE`, [operationId]);
|
|
75
|
+
const legacy = await connection.query(`SELECT legacy_google_subject AS principal_id
|
|
76
|
+
FROM platform_account_reset_legacy_targets
|
|
77
|
+
WHERE operation_id = $1 AND lifecycle = 'previewed'
|
|
78
|
+
ORDER BY legacy_google_subject
|
|
79
|
+
FOR UPDATE`, [operationId]);
|
|
80
|
+
if (canonical.rows.length === 3 && legacy.rows.length === 0)
|
|
81
|
+
return { shape: 'canonical', targets: canonical.rows.map((row) => row.principal_id) };
|
|
82
|
+
if (canonical.rows.length === 0 && legacy.rows.length === 3)
|
|
83
|
+
return { shape: 'legacy_absent', targets: legacy.rows.map((row) => row.principal_id) };
|
|
84
|
+
throw new PlatformAccountResetPreviewError('target_count_invalid');
|
|
85
|
+
}
|
|
69
86
|
export async function loadPlatformAccountResetFrozenResources(connection, operationId) {
|
|
70
87
|
const result = await connection.query(`SELECT provider, resource_kind, provider_locator, locator_fingerprint
|
|
71
88
|
FROM platform_account_reset_cleanup_ledger
|
package/node_modules/@noodle-borg/service/dist/platform-account-reset-operation-postgres.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"platform-account-reset-operation-postgres.js","sourceRoot":"","sources":["../src/platform-account-reset-operation-postgres.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,gCAAgC,GACjC,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,eAAe,EAAE,MAAM,yCAAyC,CAAC;AAC1E,OAAO,EAAE,gCAAgC,EAAE,MAAM,4CAA4C,CAAC;AAiE9F,MAAM,UAAU,kCAAkC,CAChD,OAA2C,EAC3C,gBAAwB;IAExB,MAAM,kBAAkB,GAAG,eAAe,CAAC;QACzC,aAAa,EAAE,CAAC;QAChB,KAAK,EAAE,sCAAsC,OAAO,CAAC,MAAM,EAAE;QAC7D,gBAAgB;QAChB,cAAc,EAAE,OAAO,CAAC,cAAc;KACvC,CAAC,CAAC;IACH,OAAO;QACL,gBAAgB;QAChB,kBAAkB;QAClB,iBAAiB,EAAE,eAAe,C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UAAU,KAAK,OAAO,CAAC,UAAU,IAAI,SAAS,CAAC,WAAW,KAAK,OAAO,CAAC,UAAU;QAC3F,MAAM,IAAI,gCAAgC,CAAC,kBAAkB,CAAC,CAAC;IACjE,IAAI,MAAM,CAAC,SAAS,CAAC,kBAAkB,CAAC,KAAK,OAAO,CAAC,kBAAkB;QACrE,MAAM,IAAI,gCAAgC,CAAC,qBAAqB,CAAC,CAAC;IACpE,IAAI,SAAS,CAAC,gBAAgB,KAAK,OAAO,CAAC,eAAe;QACxD,MAAM,IAAI,gCAAgC,CAAC,oBAAoB,CAAC,CAAC;IACnE,IAAI,SAAS,CAAC,YAAY,KAAK,OAAO,CAAC,WAAW;QAChD,MAAM,IAAI,gCAAgC,CAAC,oBAAoB,CAAC,CAAC;AACrE,CAAC;AAED,MAAM,UAAU,sCAAsC,CACpD,QAA4C,EAC5C,MAMC;IAED,IACE,MAAM,CAAC,gBAAgB,KAAK,QAAQ,CAAC,gBAAgB;QACrD,MAAM,CAAC,kBAAkB,KAAK,QAAQ,CAAC,kBAAkB;QACzD,MAAM,CAAC,kBAAkB,KAAK,QAAQ,CAAC,kBAAkB;QACzD,MAAM,CAAC,iBAAiB,KAAK,QAAQ,CAAC,iBAAiB;QAEvD,MAAM,IAAI,gCAAgC,CAAC,oBAAoB,CAAC,CAAC;IACnE,OAAO,mCAAmC,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;AAChE,CAAC;AAED,SAAS,QAAQ,CAAC,KAAc;IAC9B,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAC9E,CAAC"}
|
|
1
|
+
{"version":3,"file":"platform-account-reset-operation-postgres.js","sourceRoot":"","sources":["../src/platform-account-reset-operation-postgres.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,gCAAgC,GACjC,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,eAAe,EAAE,M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Input);
|
|
28
28
|
const status = await this.#options.statusStore.query(`SELECT operation.lifecycle, operation.safe_result,
|
|
29
29
|
operation.quarantine_safe_result, operation.rollback_safe_result,
|
|
30
|
+
(SELECT count(*)::int FROM platform_account_reset_targets target
|
|
31
|
+
WHERE target.operation_id = operation.operation_id) AS canonical_target_count,
|
|
32
|
+
(SELECT count(*)::int FROM platform_account_reset_legacy_targets legacy
|
|
33
|
+
WHERE legacy.operation_id = operation.operation_id) AS legacy_target_count,
|
|
30
34
|
count(*) FILTER (
|
|
31
35
|
WHERE cleanup.state IN ('pending', 'leased', 'failed')
|
|
32
36
|
)::int AS cleanup_pending_count
|
|
@@ -38,6 +42,8 @@ export class PlatformAccountResetOperator {
|
|
|
38
42
|
const row = status.rows[0];
|
|
39
43
|
if (row === undefined)
|
|
40
44
|
return undefined;
|
|
45
|
+
if (!validStoredTargetShape(row))
|
|
46
|
+
throw new PlatformAccountResetPreviewError('operation_conflict');
|
|
41
47
|
const value = row.rollback_safe_result ?? row.quarantine_safe_result ?? row.safe_result;
|
|
42
48
|
const result = PlatformAccountResetResultSchema.safeParse(value);
|
|
43
49
|
if (!result.success)
|
|
@@ -53,6 +59,13 @@ export class PlatformAccountResetOperator {
|
|
|
53
59
|
};
|
|
54
60
|
}
|
|
55
61
|
}
|
|
62
|
+
function validStoredTargetShape(row) {
|
|
63
|
+
if (row.lifecycle === 'previewed')
|
|
64
|
+
return ((row.canonical_target_count === 3 && row.legacy_target_count === 0) ||
|
|
65
|
+
(row.canonical_target_count === 0 && row.legacy_target_count === 3));
|
|
66
|
+
return (row.canonical_target_count === 3 &&
|
|
67
|
+
(row.legacy_target_count === 0 || row.legacy_target_count === 3));
|
|
68
|
+
}
|
|
56
69
|
function isSuspendedLifecycle(lifecycle) {
|
|
57
70
|
return ['quarantined', 'finalizing', 'finalization_blocked'].includes(lifecycle);
|
|
58
71
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"platform-account-reset-operator.js","sourceRoot":"","sources":["../src/platform-account-reset-operator.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,wCAAwC,EAExC,gDAAgD,EAGhD,gCAAgC,EAGhC,uCAAuC,GACxC,MAAM,6BAA6B,CAAC;AAMrC,OAAO,EAAE,gCAAgC,EAAE,MAAM,4CAA4C,CAAC;
|
|
1
|
+
{"version":3,"file":"platform-account-reset-operator.js","sourceRoot":"","sources":["../src/platform-account-reset-operator.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,wCAAwC,EAExC,gDAAgD,EAGhD,gCAAgC,EAGhC,uCAAuC,GACxC,MAAM,6BAA6B,CAAC;AAMrC,OAAO,EAAE,gCAAgC,EAAE,MAAM,4CAA4C,CAAC;AA8B9F,MAAM,OAAO,4BAA4B;IAC9B,QAAQ,CAAsC;IAEvD,YAAY,OAA4C;QACtD,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;IAC1B,CAAC;IAED,OAAO,CACL,QAAoD;QAEpD,MAAM,KAAK,GAAG,gDAAgD,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;QAC/E,IAAI,WAAW,IAAI,KAAK;YAAE,OAAO,IAAI,CAAC,QAAQ,CAAC,eAAe,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QAC9E,OAAO,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IAC9C,CAAC;IAED,KAAK,CAAC,OAAO,CAAC,QAA4C;QACxD,MAAM,KAAK,GAAG,wCAAwC,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;QACvE,IAAI,OAA4C,CAAC;QACjD,IAAI,KAAK,CAAC,MAAM,KAAK,YAAY;YAAE,OAAO,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;aACpF,IAAI,KAAK,CAAC,MAAM,KAAK,UAAU;YAAE,OAAO,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAA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AC,qBAAqB;aAC/C;SACF,CAAC;IACJ,CAAC;CACF;AAED,SAAS,sBAAsB,CAAC,GAAc;IAC5C,IAAI,GAAG,CAAC,SAAS,KAAK,WAAW;QAC/B,OAAO,CACL,CAAC,GAAG,CAAC,sBAAsB,KAAK,CAAC,IAAI,GAAG,CAAC,mBAAmB,KAAK,CAAC,CAAC;YACnE,CAAC,GAAG,CAAC,sBAAsB,KAAK,CAAC,IAAI,GAAG,CAAC,mBAAmB,KAAK,CAAC,CAAC,CACpE,CAAC;IACJ,OAAO,CACL,GAAG,CAAC,sBAAsB,KAAK,CAAC;QAChC,CAAC,GAAG,CAAC,mBAAmB,KAAK,CAAC,IAAI,GAAG,CAAC,mBAAmB,KAAK,CAAC,CAAC,CACjE,CAAC;AACJ,CAAC;AAED,SAAS,oBAAoB,CAAC,SAAkD;IAC9E,OAAO,CAAC,aAAa,EAAE,YAAY,EAAE,sBAAsB,CAAC,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;AACnF,CAAC"}
|
package/node_modules/@noodle-borg/service/dist/platform-account-reset-ownership-postgres.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { PlatformAccountResetBlockerCode } from './platform-account-reset.js';
|
|
2
|
+
import type { PlatformAccountResetLegacyWorkspacePlan } from './platform-account-reset-legacy-workspace-postgres.js';
|
|
2
3
|
import type { PlatformIdentityQueryable } from './platform-identity-postgres.js';
|
|
3
4
|
export type ResetDisposition = 'personal_org' | 'sole_owned_org' | 'target_owner_only_app' | 'preserved_shared_org' | 'preserved_org_members_app' | 'blocker';
|
|
4
5
|
export interface PlatformAccountResetCleanupResource {
|
|
@@ -33,6 +34,8 @@ export interface PlatformAccountResetOwnershipSnapshot {
|
|
|
33
34
|
*/
|
|
34
35
|
export declare function loadPlatformAccountResetOwnershipSnapshot(pool: PlatformIdentityQueryable, input: {
|
|
35
36
|
readonly targetPrincipalIds: readonly string[];
|
|
37
|
+
readonly allowMissingTargetPrincipals?: boolean;
|
|
38
|
+
readonly plannedPersonalWorkspaces?: readonly PlatformAccountResetLegacyWorkspacePlan[];
|
|
36
39
|
readonly quarantine?: {
|
|
37
40
|
readonly operationId: string;
|
|
38
41
|
readonly cleanupResources: readonly PlatformAccountResetCleanupResource[];
|
package/node_modules/@noodle-borg/service/dist/platform-account-reset-ownership-postgres.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"platform-account-reset-ownership-postgres.d.ts","sourceRoot":"","sources":["../src/platform-account-reset-ownership-postgres.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"platform-account-reset-ownership-postgres.d.ts","sourceRoot":"","sources":["../src/platform-account-reset-ownership-postgres.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,6BAA6B,CAAC;AAEnF,OAAO,KAAK,EAAE,uCAAuC,EAAE,MAAM,uDAAuD,CAAC;AAiBrH,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,iCAAiC,CAAC;AAEjF,MAAM,MAAM,gBAAgB,GACxB,cAAc,GACd,gBAAgB,GAChB,uBAAuB,GACvB,sBAAsB,GACtB,2BAA2B,GAC3B,SAAS,CAAC;AAEd,MAAM,WAAW,mCAAmC;IAClD,QAAQ,CAAC,QAAQ,EAAE,UAAU,GAAG,gBAAgB,GAAG,QAAQ,GAAG,QAAQ,GAAG,QAAQ,CAAC;IAClF,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IACpD,QAAQ,CAAC,kBAAkB,EAAE,MAAM,CAAC;CACrC;AAED,MAAM,WAAW,qCAAqC;IACpD,QAAQ,CAAC,MAAM,EAAE;QACf,QAAQ,CAAC,yBAAyB,EAAE,MAAM,CAAC;QA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Snapshot(pool, input) {
|
|
|
12
12
|
const blockers = new Map();
|
|
13
13
|
const relationships = [];
|
|
14
14
|
const resources = [];
|
|
15
|
-
const
|
|
15
|
+
const storedPersonal = await rows(pool, `SELECT principal_subject, org_slug, billing_account_id
|
|
16
16
|
FROM personal_workspace_bindings
|
|
17
17
|
WHERE principal_subject = ANY($1::text[])`, [targets]);
|
|
18
|
+
const personal = [
|
|
19
|
+
...storedPersonal,
|
|
20
|
+
...(input.plannedPersonalWorkspaces ?? []).map((plan) => ({
|
|
21
|
+
principal_subject: plan.principalSubject,
|
|
22
|
+
org_slug: plan.orgSlug,
|
|
23
|
+
billing_account_id: plan.billingAccountId,
|
|
24
|
+
})),
|
|
25
|
+
];
|
|
18
26
|
const personalOrgOwners = new Map(personal.map((row) => [row.org_slug, row.principal_subject]));
|
|
19
27
|
const targetOwnerOnlyDeployments = await rows(pool, `SELECT org_slug, app_slug
|
|
20
28
|
FROM deploy_records
|
|
@@ -48,7 +56,8 @@ export async function loadPlatformAccountResetOwnershipSnapshot(pool, input) {
|
|
|
48
56
|
let validPersonalOrganizations = 0;
|
|
49
57
|
for (const org of involvedOrgs) {
|
|
50
58
|
const orgOwners = ownersByOrg.get(org) ?? [];
|
|
51
|
-
if (orgOwners.some((owner) => owner.status === null
|
|
59
|
+
if (orgOwners.some((owner) => owner.status === null &&
|
|
60
|
+
!(input.allowMissingTargetPrincipals === true && targetSet.has(owner.subject)))) {
|
|
52
61
|
increment(blockers, 'ownership_ambiguous');
|
|
53
62
|
relationships.push({ disposition: 'blocker', kind: 'owner_status', org });
|
|
54
63
|
continue;
|