@party-stack/foundry-ontology 0.20.2 → 0.21.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/README.md +19 -5
- package/lib/adapter/backend.d.ts +25 -2
- package/lib/adapter/backend.d.ts.map +1 -1
- package/lib/adapter/backend.js +97 -11
- package/lib/adapter/backend.js.map +1 -1
- package/lib/adapter/subsetFilter.d.ts +8 -3
- package/lib/adapter/subsetFilter.d.ts.map +1 -1
- package/lib/adapter/subsetFilter.js +185 -65
- package/lib/adapter/subsetFilter.js.map +1 -1
- package/lib/meta/backend.d.ts.map +1 -1
- package/lib/meta/backend.js +17 -18
- package/lib/meta/backend.js.map +1 -1
- package/lib/meta/loadEntities.d.ts +4 -4
- package/lib/meta/loadEntities.d.ts.map +1 -1
- package/lib/meta/loadEntities.js.map +1 -1
- package/lib/meta/planMetaLookup.d.ts +2 -2
- package/lib/meta/planMetaLookup.d.ts.map +1 -1
- package/lib/meta/planMetaLookup.js +16 -11
- package/lib/meta/planMetaLookup.js.map +1 -1
- package/lib/users/loadUserSubset.d.ts.map +1 -1
- package/lib/users/loadUserSubset.js +21 -19
- package/lib/users/loadUserSubset.js.map +1 -1
- package/package.json +8 -8
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { filterOperand, inValues } from "@party-stack/ontology-storage/tables";
|
|
2
2
|
//#region src/meta/planMetaLookup.ts
|
|
3
3
|
/** Select a bounded superset; the shared query engine applies residual predicates.
|
|
4
4
|
* AND can use one bounded branch. OR must cover every branch with the same lookup.
|
|
@@ -6,28 +6,33 @@ import { isField } from "@party-stack/ontology-storage/tables";
|
|
|
6
6
|
function planMetaLookup(predicate, fields) {
|
|
7
7
|
if (!predicate) return;
|
|
8
8
|
const lookup = (operand, values) => {
|
|
9
|
-
if (
|
|
10
|
-
const path = operand.path.join(".");
|
|
9
|
+
if (operand?.kind !== "field") return;
|
|
10
|
+
const path = operand.field.path.join(".");
|
|
11
11
|
if (!Object.hasOwn(fields, path)) return;
|
|
12
12
|
return {
|
|
13
13
|
field: fields[path],
|
|
14
14
|
values: [...new Set(values)]
|
|
15
15
|
};
|
|
16
16
|
};
|
|
17
|
-
switch (predicate.
|
|
18
|
-
case "eq":
|
|
19
|
-
|
|
20
|
-
|
|
17
|
+
switch (predicate.kind) {
|
|
18
|
+
case "eq": {
|
|
19
|
+
const left = filterOperand(predicate.value.left);
|
|
20
|
+
const right = filterOperand(predicate.value.right);
|
|
21
|
+
if (right?.kind === "literal" && typeof right.value === "string") return lookup(left, [right.value]);
|
|
22
|
+
if (left?.kind === "literal" && typeof left.value === "string") return lookup(right, [left.value]);
|
|
21
23
|
return;
|
|
22
|
-
|
|
23
|
-
|
|
24
|
+
}
|
|
25
|
+
case "in": {
|
|
26
|
+
const values = inValues(predicate);
|
|
27
|
+
if (values.every((value) => typeof value === "string")) return lookup(filterOperand(predicate.value.left), values);
|
|
24
28
|
return;
|
|
29
|
+
}
|
|
25
30
|
case "and": {
|
|
26
|
-
const bounded = predicate.
|
|
31
|
+
const bounded = predicate.value.expressions.map((child) => planMetaLookup(child, fields)).filter((child) => child !== void 0);
|
|
27
32
|
return bounded.find((child) => child.values.length === 0) ?? bounded[0];
|
|
28
33
|
}
|
|
29
34
|
case "or": {
|
|
30
|
-
const children = predicate.
|
|
35
|
+
const children = predicate.value.expressions.map((child) => planMetaLookup(child, fields));
|
|
31
36
|
const first = children[0];
|
|
32
37
|
if (!first || children.some((child) => child?.field !== first.field)) return;
|
|
33
38
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"planMetaLookup.js","names":[],"sources":["../../src/meta/planMetaLookup.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"planMetaLookup.js","names":[],"sources":["../../src/meta/planMetaLookup.ts"],"sourcesContent":["import { filterOperand, inValues } from \"@party-stack/ontology-storage/tables\";\nimport type { Filter, FilterOperand } from \"@party-stack/ontology-storage\";\n\nexport interface MetaLookup {\n readonly field: string;\n readonly values: string[];\n}\n\n/** Select a bounded superset; the shared query engine applies residual predicates.\n * AND can use one bounded branch. OR must cover every branch with the same lookup.\n */\nexport function planMetaLookup(\n predicate: Filter | undefined,\n fields: Readonly<Record<string, string>>\n): MetaLookup | undefined {\n if (!predicate) return;\n const lookup = (\n operand: FilterOperand | undefined,\n values: readonly string[]\n ): MetaLookup | undefined => {\n if (operand?.kind !== \"field\") return;\n const path = operand.field.path.join(\".\");\n if (!Object.hasOwn(fields, path)) return;\n return { field: fields[path]!, values: [...new Set(values)] };\n };\n switch (predicate.kind) {\n case \"eq\": {\n const left = filterOperand(predicate.value.left);\n const right = filterOperand(predicate.value.right);\n if (right?.kind === \"literal\" && typeof right.value === \"string\")\n return lookup(left, [right.value]);\n if (left?.kind === \"literal\" && typeof left.value === \"string\")\n return lookup(right, [left.value]);\n return;\n }\n case \"in\": {\n const values = inValues(predicate);\n if (values.every((value): value is string => typeof value === \"string\"))\n return lookup(filterOperand(predicate.value.left), values);\n return;\n }\n case \"and\": {\n const bounded = predicate.value.expressions\n .map((child) => planMetaLookup(child, fields))\n .filter((child) => child !== undefined);\n return bounded.find((child) => child.values.length === 0) ?? bounded[0];\n }\n case \"or\": {\n const children = predicate.value.expressions.map((child) => planMetaLookup(child, fields));\n const first = children[0];\n if (!first || children.some((child) => child?.field !== first.field)) return;\n return {\n field: first.field,\n values: [...new Set(children.flatMap((child) => child!.values))],\n };\n }\n default:\n return;\n }\n}\n"],"mappings":";;;;;AAWA,SAAgB,eACZ,WACA,QACsB;CACtB,IAAI,CAAC,WAAW;CAChB,MAAM,UACF,SACA,WACyB;EACzB,IAAI,SAAS,SAAS,SAAS;EAC/B,MAAM,OAAO,QAAQ,MAAM,KAAK,KAAK,GAAG;EACxC,IAAI,CAAC,OAAO,OAAO,QAAQ,IAAI,GAAG;EAClC,OAAO;GAAE,OAAO,OAAO;GAAQ,QAAQ,CAAC,GAAG,IAAI,IAAI,MAAM,CAAC;EAAE;CAChE;CACA,QAAQ,UAAU,MAAlB;EACI,KAAK,MAAM;GACP,MAAM,OAAO,cAAc,UAAU,MAAM,IAAI;GAC/C,MAAM,QAAQ,cAAc,UAAU,MAAM,KAAK;GACjD,IAAI,OAAO,SAAS,aAAa,OAAO,MAAM,UAAU,UACpD,OAAO,OAAO,MAAM,CAAC,MAAM,KAAK,CAAC;GACrC,IAAI,MAAM,SAAS,aAAa,OAAO,KAAK,UAAU,UAClD,OAAO,OAAO,OAAO,CAAC,KAAK,KAAK,CAAC;GACrC;EACJ;EACA,KAAK,MAAM;GACP,MAAM,SAAS,SAAS,SAAS;GACjC,IAAI,OAAO,OAAO,UAA2B,OAAO,UAAU,QAAQ,GAClE,OAAO,OAAO,cAAc,UAAU,MAAM,IAAI,GAAG,MAAM;GAC7D;EACJ;EACA,KAAK,OAAO;GACR,MAAM,UAAU,UAAU,MAAM,YAC3B,KAAK,UAAU,eAAe,OAAO,MAAM,CAAC,CAAC,CAC7C,QAAQ,UAAU,UAAU,KAAA,CAAS;GAC1C,OAAO,QAAQ,MAAM,UAAU,MAAM,OAAO,WAAW,CAAC,KAAK,QAAQ;EACzE;EACA,KAAK,MAAM;GACP,MAAM,WAAW,UAAU,MAAM,YAAY,KAAK,UAAU,eAAe,OAAO,MAAM,CAAC;GACzF,MAAM,QAAQ,SAAS;GACvB,IAAI,CAAC,SAAS,SAAS,MAAM,UAAU,OAAO,UAAU,MAAM,KAAK,GAAG;GACtE,OAAO;IACH,OAAO,MAAM;IACb,QAAQ,CAAC,GAAG,IAAI,IAAI,SAAS,SAAS,UAAU,MAAO,MAAM,CAAC,CAAC;GACnE;EACJ;EACA,SACI;CACR;AACJ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loadUserSubset.d.ts","names":[],"sources":["../../src/users/loadUserSubset.ts"],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"loadUserSubset.d.ts","names":[],"sources":["../../src/users/loadUserSubset.ts"],"mappings":";;;;;wBA4HsB,eAClB,QAAQ,QACR,oBACA,MAAM,MACN,OAAO,OACP,QAAQ,cACT,QAAQ"}
|
|
@@ -5,8 +5,7 @@ import { Redacted, Schema } from "effect";
|
|
|
5
5
|
import { BackendError } from "@party-stack/ontology-backend";
|
|
6
6
|
import { applyLensToObject, mapTargetPathToSourceWithLens } from "@party-stack/ontology-spec";
|
|
7
7
|
import { objectSubset } from "@party-stack/ontology-backend/subset";
|
|
8
|
-
import { evaluateQuery } from "@party-stack/ontology-storage";
|
|
9
|
-
import { isField } from "@party-stack/ontology-storage/tables";
|
|
8
|
+
import { evaluateQuery, filterOperand, inValues } from "@party-stack/ontology-storage";
|
|
10
9
|
import { Users } from "@osdk/foundry.admin";
|
|
11
10
|
//#region src/users/loadUserSubset.ts
|
|
12
11
|
const UserIdentity = Schema.Struct({ id: Schema.String });
|
|
@@ -31,9 +30,9 @@ function checked(schema, value) {
|
|
|
31
30
|
}
|
|
32
31
|
/** Choose only a safe candidate set. Every response is checked against the full query. */
|
|
33
32
|
function select(predicate, lens, path = []) {
|
|
34
|
-
if (predicate.
|
|
35
|
-
const children = predicate.
|
|
36
|
-
if (predicate.
|
|
33
|
+
if (predicate.kind === "and" || predicate.kind === "or") {
|
|
34
|
+
const children = predicate.value.expressions.map((child, index) => select(child, lens, [...path, index]));
|
|
35
|
+
if (predicate.kind === "and") return children.find((child) => child?.type === "getBatch") ?? children.find(Boolean);
|
|
37
36
|
if (children.some((child) => !child)) return;
|
|
38
37
|
if (children.every((child) => child?.type === "getBatch")) return {
|
|
39
38
|
type: "getBatch",
|
|
@@ -47,30 +46,33 @@ function select(predicate, lens, path = []) {
|
|
|
47
46
|
};
|
|
48
47
|
return;
|
|
49
48
|
}
|
|
50
|
-
if (predicate.
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
if (
|
|
54
|
-
|
|
49
|
+
if (predicate.kind !== "eq" && predicate.kind !== "in" && predicate.kind !== "like" && predicate.kind !== "ilike") return;
|
|
50
|
+
let left = filterOperand(predicate.value.left);
|
|
51
|
+
let right = filterOperand(predicate.value.right);
|
|
52
|
+
if (predicate.kind === "eq" && left?.kind !== "field" && right?.kind === "field") [left, right] = [right, left];
|
|
53
|
+
if (left?.kind !== "field") return;
|
|
54
|
+
const value = right?.kind === "literal" ? right.value : void 0;
|
|
55
|
+
const source = mapTargetPathToSourceWithLens(left.field.path, lens).join(".");
|
|
55
56
|
if (source === "id") {
|
|
56
|
-
if (predicate.
|
|
57
|
+
if (predicate.kind === "eq" && typeof value === "string") return {
|
|
57
58
|
type: "getBatch",
|
|
58
|
-
ids: [
|
|
59
|
+
ids: [value],
|
|
59
60
|
paths: [path]
|
|
60
61
|
};
|
|
61
|
-
|
|
62
|
+
const values = predicate.kind === "in" ? inValues(predicate) : void 0;
|
|
63
|
+
if (values?.every((value) => typeof value === "string")) return {
|
|
62
64
|
type: "getBatch",
|
|
63
|
-
ids: [...new Set(
|
|
65
|
+
ids: [...new Set(values)],
|
|
64
66
|
paths: [path]
|
|
65
67
|
};
|
|
66
68
|
}
|
|
67
|
-
if ((predicate.
|
|
69
|
+
if ((predicate.kind === "like" || predicate.kind === "ilike") && typeof value === "string" && [
|
|
68
70
|
"username",
|
|
69
71
|
"givenName",
|
|
70
72
|
"familyName"
|
|
71
73
|
].includes(source)) {
|
|
72
|
-
const term =
|
|
73
|
-
if (
|
|
74
|
+
const term = value.slice(0, -1);
|
|
75
|
+
if (value.endsWith("%") && term.length > 0 && !/[%_\\]/.test(term)) return {
|
|
74
76
|
type: "search",
|
|
75
77
|
term,
|
|
76
78
|
paths: [path]
|
|
@@ -81,8 +83,8 @@ function placements(predicate, selection) {
|
|
|
81
83
|
const selected = new Set(selection?.paths.map((path) => JSON.stringify(path)));
|
|
82
84
|
const result = [];
|
|
83
85
|
const visit = (predicate, path) => {
|
|
84
|
-
if (predicate.
|
|
85
|
-
else if (predicate.
|
|
86
|
+
if (predicate.kind === "and" || predicate.kind === "or") predicate.value.expressions.forEach((child, index) => visit(child, [...path, index]));
|
|
87
|
+
else if (predicate.kind === "not") visit(predicate.value.expression, [...path, 0]);
|
|
86
88
|
else result.push({
|
|
87
89
|
path,
|
|
88
90
|
execution: selected.has(JSON.stringify(path)) ? selection?.type === "getBatch" ? "source" : "candidate" : "engine"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loadUserSubset.js","names":["AsyncIterable.toArray","AsyncIterable.fromPagination"],"sources":["../../src/users/loadUserSubset.ts"],"sourcesContent":["import { Users, type User } from \"@osdk/foundry.admin\";\nimport { BackendError } from \"@party-stack/ontology-backend\";\nimport { objectSubset } from \"@party-stack/ontology-backend/subset\";\nimport { applyLensToObject, mapTargetPathToSourceWithLens, type Lens } from \"@party-stack/ontology-spec\";\nimport { evaluateQuery, type Predicate, type Query } from \"@party-stack/ontology-storage\";\nimport { isField } from \"@party-stack/ontology-storage/tables\";\nimport { Schema, Redacted } from \"effect\";\nimport * as AsyncIterable from \"../utils/AsyncIterable.js\";\nimport { chunk } from \"../utils/chunk.js\";\nimport { foundryUserProfilePictureAttachment } from \"./foundryUser.js\";\nimport type { Client } from \"@party-stack/foundry-client\";\nimport type { BackendSnapshot, SourceQueryPlan } from \"@party-stack/ontology-backend\";\n\nconst UserIdentity = Schema.Struct({ id: Schema.String });\nconst UserPage = Schema.Struct({\n data: Schema.Array(UserIdentity),\n nextPageToken: Schema.optional(Schema.String),\n});\nconst UserBatch = Schema.Struct({ data: Schema.Record(Schema.String, UserIdentity) });\nfunction checked<A>(schema: Schema.Decoder<unknown>, value: A): A {\n try {\n Schema.decodeUnknownSync(schema)(value);\n return value;\n } catch (cause) {\n throw new BackendError({\n operation: \"foundry.users.loadSubset\",\n kind: \"InvalidResponse\",\n message: \"Foundry returned an invalid user response.\",\n retryable: false,\n cause: Redacted.make(cause),\n });\n }\n}\n\ntype Selection =\n | { type: \"getBatch\"; ids: string[]; paths: number[][] }\n | { type: \"search\"; term: string; paths: number[][] };\n\n/** Choose only a safe candidate set. Every response is checked against the full query. */\nfunction select(predicate: Predicate, lens: Lens, path: number[] = []): Selection | undefined {\n if (predicate.op === \"and\" || predicate.op === \"or\") {\n const children = predicate.predicates.map((child, index) => select(child, lens, [...path, index]));\n if (predicate.op === \"and\")\n return children.find((child) => child?.type === \"getBatch\") ?? children.find(Boolean);\n if (children.some((child) => !child)) return;\n if (children.every((child) => child?.type === \"getBatch\"))\n return {\n type: \"getBatch\",\n ids: [...new Set(children.flatMap((child) => child.ids))],\n paths: children.flatMap((child) => child.paths),\n };\n const first = children[0];\n if (\n first?.type === \"search\" &&\n children.every((child) => child?.type === \"search\" && child.term === first.term)\n )\n return { ...first, paths: children.flatMap((child) => child!.paths) };\n return;\n }\n if (predicate.op === \"not\") return;\n const left =\n predicate.op === \"eq\" && !isField(predicate.left) && isField(predicate.right)\n ? predicate.right\n : predicate.left;\n const right =\n predicate.op === \"eq\" && left === predicate.right\n ? predicate.left\n : predicate.op !== \"in\"\n ? predicate.right\n : undefined;\n if (!isField(left)) return;\n const source = mapTargetPathToSourceWithLens(left.path, lens).join(\".\");\n if (source === \"id\") {\n if (predicate.op === \"eq\" && typeof right === \"string\")\n return { type: \"getBatch\", ids: [right], paths: [path] };\n if (predicate.op === \"in\" && predicate.values.every((value) => typeof value === \"string\"))\n return { type: \"getBatch\", ids: [...new Set(predicate.values)], paths: [path] };\n }\n if (\n (predicate.op === \"like\" || predicate.op === \"ilike\") &&\n typeof right === \"string\" &&\n [\"username\", \"givenName\", \"familyName\"].includes(source)\n ) {\n // Admin search is case-insensitive prefix matching across all name fields.\n // Complex patterns must not become a narrower, incorrect search term.\n const term = right.slice(0, -1);\n if (right.endsWith(\"%\") && term.length > 0 && !/[%_\\\\]/.test(term))\n return { type: \"search\", term, paths: [path] };\n }\n}\n\nfunction placements(\n predicate: Predicate | undefined,\n selection: Selection | undefined\n): SourceQueryPlan[\"predicates\"] {\n const selected = new Set(selection?.paths.map((path) => JSON.stringify(path)));\n const result: SourceQueryPlan[\"predicates\"][number][] = [];\n const visit = (predicate: Predicate, path: number[]) => {\n if (predicate.op === \"and\" || predicate.op === \"or\")\n predicate.predicates.forEach((child, index) => visit(child, [...path, index]));\n else if (predicate.op === \"not\") visit(predicate.predicate, [...path, 0]);\n else\n result.push({\n path,\n execution: selected.has(JSON.stringify(path))\n ? selection?.type === \"getBatch\"\n ? \"source\"\n : \"candidate\"\n : \"engine\",\n });\n };\n if (predicate) visit(predicate, []);\n return result;\n}\n\nexport async function loadUserSubset(\n client: Client,\n objectType: string,\n lens: Lens,\n query: Query,\n signal: AbortSignal\n): Promise<BackendSnapshot> {\n signal.throwIfAborted();\n evaluateQuery([], query);\n if (query.limit === 0) return { rows: [], complete: true, fetchedRows: 0 };\n const requestClient = {\n ...client,\n fetch: (input: RequestInfo | URL, init?: RequestInit) =>\n client.fetch(input, {\n ...init,\n signal: init?.signal ? AbortSignal.any([signal, init.signal]) : signal,\n }),\n };\n const selection = query.where ? select(query.where, lens) : undefined;\n const users: User[] = [];\n const batches = selection?.type === \"getBatch\" ? chunk(selection.ids, 500) : undefined;\n if (batches) {\n for (const ids of batches) {\n signal.throwIfAborted();\n const response = await Users.getBatch(\n requestClient,\n ids.map((userId) => ({ userId }))\n );\n checked(UserBatch, response);\n users.push(...Object.values(response.data));\n }\n } else {\n users.push(\n ...(await AsyncIterable.toArray(\n AsyncIterable.fromPagination(\n async (_pageSize, pageToken: string | undefined) => {\n signal.throwIfAborted();\n const page =\n selection?.type === \"search\"\n ? await Users.search(requestClient, {\n where: { type: \"queryString\", value: selection.term },\n pageToken,\n })\n : await Users.list(requestClient, { pageToken });\n return checked(UserPage, page);\n },\n (page) => page.nextPageToken,\n (page) => page.data,\n 500\n )\n ))\n );\n }\n signal.throwIfAborted();\n const rows = users.map((user) => ({\n key: user.id,\n value: applyLensToObject(\n { ...user, profilePicture: foundryUserProfilePictureAttachment(user.id) },\n lens\n ),\n }));\n return {\n rows,\n fulfilledSubset: objectSubset(objectType, selection ? { where: query.where } : {}),\n complete: true,\n fetchedRows: users.length,\n pushdown: {\n source: \"Foundry users\",\n predicates: placements(query.where, selection),\n sorting: query.orderBy?.length ? \"engine\" : \"none\",\n pagination:\n query.limit !== undefined || query.offset !== undefined || query.after ? \"engine\" : \"none\",\n rechecksFilter: Boolean(query.where),\n native: {\n language: \"json\",\n text: JSON.stringify(\n batches\n ? {\n operation: \"Users.getBatch\",\n batches: batches.map((ids) => ids.map((userId) => ({ userId }))),\n }\n : selection?.type === \"search\"\n ? {\n operation: \"Users.search\",\n where: { type: \"queryString\", value: selection.term },\n }\n : { operation: \"Users.list\" },\n null,\n 2\n ),\n },\n },\n };\n}\n"],"mappings":";;;;;;;;;;;AAaA,MAAM,eAAe,OAAO,OAAO,EAAE,IAAI,OAAO,OAAO,CAAC;AACxD,MAAM,WAAW,OAAO,OAAO;CAC3B,MAAM,OAAO,MAAM,YAAY;CAC/B,eAAe,OAAO,SAAS,OAAO,MAAM;AAChD,CAAC;AACD,MAAM,YAAY,OAAO,OAAO,EAAE,MAAM,OAAO,OAAO,OAAO,QAAQ,YAAY,EAAE,CAAC;AACpF,SAAS,QAAW,QAAiC,OAAa;CAC9D,IAAI;EACA,OAAO,kBAAkB,MAAM,CAAC,CAAC,KAAK;EACtC,OAAO;CACX,SAAS,OAAO;EACZ,MAAM,IAAI,aAAa;GACnB,WAAW;GACX,MAAM;GACN,SAAS;GACT,WAAW;GACX,OAAO,SAAS,KAAK,KAAK;EAC9B,CAAC;CACL;AACJ;;AAOA,SAAS,OAAO,WAAsB,MAAY,OAAiB,CAAC,GAA0B;CAC1F,IAAI,UAAU,OAAO,SAAS,UAAU,OAAO,MAAM;EACjD,MAAM,WAAW,UAAU,WAAW,KAAK,OAAO,UAAU,OAAO,OAAO,MAAM,CAAC,GAAG,MAAM,KAAK,CAAC,CAAC;EACjG,IAAI,UAAU,OAAO,OACjB,OAAO,SAAS,MAAM,UAAU,OAAO,SAAS,UAAU,KAAK,SAAS,KAAK,OAAO;EACxF,IAAI,SAAS,MAAM,UAAU,CAAC,KAAK,GA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AClB;KACI,WAAW;KACX,OAAO;MAAE,MAAM;MAAe,OAAO,UAAU;KAAK;IACxD,IACA,EAAE,WAAW,aAAa,GAClC,MACA,CACJ;GACJ;EACJ;CACJ;AACJ"}
|
|
1
|
+
{"version":3,"file":"loadUserSubset.js","names":["AsyncIterable.toArray","AsyncIterable.fromPagination"],"sources":["../../src/users/loadUserSubset.ts"],"sourcesContent":["import { Users, type User } from \"@osdk/foundry.admin\";\nimport { BackendError } from \"@party-stack/ontology-backend\";\nimport { objectSubset } from \"@party-stack/ontology-backend/subset\";\nimport { applyLensToObject, mapTargetPathToSourceWithLens, type Lens } from \"@party-stack/ontology-spec\";\nimport {\n evaluateQuery,\n filterOperand,\n inValues,\n type Filter,\n type Query,\n} from \"@party-stack/ontology-storage\";\nimport { Schema, Redacted } from \"effect\";\nimport * as AsyncIterable from \"../utils/AsyncIterable.js\";\nimport { chunk } from \"../utils/chunk.js\";\nimport { foundryUserProfilePictureAttachment } from \"./foundryUser.js\";\nimport type { Client } from \"@party-stack/foundry-client\";\nimport type { BackendSnapshot, SourceQueryPlan } from \"@party-stack/ontology-backend\";\n\nconst UserIdentity = Schema.Struct({ id: Schema.String });\nconst UserPage = Schema.Struct({\n data: Schema.Array(UserIdentity),\n nextPageToken: Schema.optional(Schema.String),\n});\nconst UserBatch = Schema.Struct({ data: Schema.Record(Schema.String, UserIdentity) });\nfunction checked<A>(schema: Schema.Decoder<unknown>, value: A): A {\n try {\n Schema.decodeUnknownSync(schema)(value);\n return value;\n } catch (cause) {\n throw new BackendError({\n operation: \"foundry.users.loadSubset\",\n kind: \"InvalidResponse\",\n message: \"Foundry returned an invalid user response.\",\n retryable: false,\n cause: Redacted.make(cause),\n });\n }\n}\n\ntype Selection =\n | { type: \"getBatch\"; ids: string[]; paths: number[][] }\n | { type: \"search\"; term: string; paths: number[][] };\n\n/** Choose only a safe candidate set. Every response is checked against the full query. */\nfunction select(predicate: Filter, lens: Lens, path: number[] = []): Selection | undefined {\n if (predicate.kind === \"and\" || predicate.kind === \"or\") {\n const children = predicate.value.expressions.map((child, index) =>\n select(child, lens, [...path, index])\n );\n if (predicate.kind === \"and\")\n return children.find((child) => child?.type === \"getBatch\") ?? children.find(Boolean);\n if (children.some((child) => !child)) return;\n if (children.every((child) => child?.type === \"getBatch\"))\n return {\n type: \"getBatch\",\n ids: [...new Set(children.flatMap((child) => child.ids))],\n paths: children.flatMap((child) => child.paths),\n };\n const first = children[0];\n if (\n first?.type === \"search\" &&\n children.every((child) => child?.type === \"search\" && child.term === first.term)\n )\n return { ...first, paths: children.flatMap((child) => child!.paths) };\n return;\n }\n if (\n predicate.kind !== \"eq\" &&\n predicate.kind !== \"in\" &&\n predicate.kind !== \"like\" &&\n predicate.kind !== \"ilike\"\n )\n return;\n let left = filterOperand(predicate.value.left);\n let right = filterOperand(predicate.value.right);\n if (predicate.kind === \"eq\" && left?.kind !== \"field\" && right?.kind === \"field\")\n [left, right] = [right, left];\n if (left?.kind !== \"field\") return;\n const value = right?.kind === \"literal\" ? right.value : undefined;\n const source = mapTargetPathToSourceWithLens(left.field.path, lens).join(\".\");\n if (source === \"id\") {\n if (predicate.kind === \"eq\" && typeof value === \"string\")\n return { type: \"getBatch\", ids: [value], paths: [path] };\n const values = predicate.kind === \"in\" ? inValues(predicate) : undefined;\n if (values?.every((value) => typeof value === \"string\"))\n return { type: \"getBatch\", ids: [...new Set(values)], paths: [path] };\n }\n if (\n (predicate.kind === \"like\" || predicate.kind === \"ilike\") &&\n typeof value === \"string\" &&\n [\"username\", \"givenName\", \"familyName\"].includes(source)\n ) {\n // Admin search is case-insensitive prefix matching across all name fields.\n // Complex patterns must not become a narrower, incorrect search term.\n const term = value.slice(0, -1);\n if (value.endsWith(\"%\") && term.length > 0 && !/[%_\\\\]/.test(term))\n return { type: \"search\", term, paths: [path] };\n }\n}\n\nfunction placements(\n predicate: Filter | undefined,\n selection: Selection | undefined\n): SourceQueryPlan[\"predicates\"] {\n const selected = new Set(selection?.paths.map((path) => JSON.stringify(path)));\n const result: SourceQueryPlan[\"predicates\"][number][] = [];\n const visit = (predicate: Filter, path: number[]) => {\n if (predicate.kind === \"and\" || predicate.kind === \"or\")\n predicate.value.expressions.forEach((child, index) => visit(child, [...path, index]));\n else if (predicate.kind === \"not\") visit(predicate.value.expression, [...path, 0]);\n else\n result.push({\n path,\n execution: selected.has(JSON.stringify(path))\n ? selection?.type === \"getBatch\"\n ? \"source\"\n : \"candidate\"\n : \"engine\",\n });\n };\n if (predicate) visit(predicate, []);\n return result;\n}\n\nexport async function loadUserSubset(\n client: Client,\n objectType: string,\n lens: Lens,\n query: Query,\n signal: AbortSignal\n): Promise<BackendSnapshot> {\n signal.throwIfAborted();\n evaluateQuery([], query);\n if (query.limit === 0) return { rows: [], complete: true, fetchedRows: 0 };\n const requestClient = {\n ...client,\n fetch: (input: RequestInfo | URL, init?: RequestInit) =>\n client.fetch(input, {\n ...init,\n signal: init?.signal ? AbortSignal.any([signal, init.signal]) : signal,\n }),\n };\n const selection = query.where ? select(query.where, lens) : undefined;\n const users: User[] = [];\n const batches = selection?.type === \"getBatch\" ? chunk(selection.ids, 500) : undefined;\n if (batches) {\n for (const ids of batches) {\n signal.throwIfAborted();\n const response = await Users.getBatch(\n requestClient,\n ids.map((userId) => ({ userId }))\n );\n checked(UserBatch, response);\n users.push(...Object.values(response.data));\n }\n } else {\n users.push(\n ...(await AsyncIterable.toArray(\n AsyncIterable.fromPagination(\n async (_pageSize, pageToken: string | undefined) => {\n signal.throwIfAborted();\n const page =\n selection?.type === \"search\"\n ? await Users.search(requestClient, {\n where: { type: \"queryString\", value: selection.term },\n pageToken,\n })\n : await Users.list(requestClient, { pageToken });\n return checked(UserPage, page);\n },\n (page) => page.nextPageToken,\n (page) => page.data,\n 500\n )\n ))\n );\n }\n signal.throwIfAborted();\n const rows = users.map((user) => ({\n key: user.id,\n value: applyLensToObject(\n { ...user, profilePicture: foundryUserProfilePictureAttachment(user.id) },\n lens\n ),\n }));\n return {\n rows,\n fulfilledSubset: objectSubset(objectType, selection ? { where: query.where } : {}),\n complete: true,\n fetchedRows: users.length,\n pushdown: {\n source: \"Foundry users\",\n predicates: placements(query.where, selection),\n sorting: query.orderBy?.length ? \"engine\" : \"none\",\n pagination:\n query.limit !== undefined || query.offset !== undefined || query.after ? \"engine\" : \"none\",\n rechecksFilter: Boolean(query.where),\n native: {\n language: \"json\",\n text: JSON.stringify(\n batches\n ? {\n operation: \"Users.getBatch\",\n batches: batches.map((ids) => ids.map((userId) => ({ userId }))),\n }\n : selection?.type === \"search\"\n ? {\n operation: \"Users.search\",\n where: { type: \"queryString\", value: selection.term },\n }\n : { operation: \"Users.list\" },\n null,\n 2\n ),\n },\n },\n };\n}\n"],"mappings":";;;;;;;;;;AAkBA,MAAM,eAAe,OAAO,OAAO,EAAE,IAAI,OAAO,OAAO,CAAC;AACxD,MAAM,WAAW,OAAO,OAAO;CAC3B,MAAM,OAAO,MAAM,YAAY;CAC/B,eAAe,OAAO,SAAS,OAAO,MAAM;AAChD,CAAC;AACD,MAAM,YAAY,OAAO,OAAO,EAAE,MAAM,OAAO,OAAO,OAAO,QAAQ,YAAY,EAAE,CAAC;AACpF,SAAS,QAAW,QAAiC,OAAa;CAC9D,IAAI;EACA,OAAO,kBAAkB,MAAM,CAAC,CAAC,KAAK;EACtC,OAAO;CACX,SAAS,OAAO;EACZ,MAAM,IAAI,aAAa;GACnB,WAAW;GACX,MAAM;GACN,SAAS;GACT,WAAW;GACX,OAAO,SAAS,KAAK,KAAK;EAC9B,CAAC;CACL;AACJ;;AAOA,SAAS,OAAO,WAAmB,MAAY,OAAiB,CAAC,GAA0B;CACvF,IAAI,UAAU,SAAS,SAAS,UAAU,SAAS,MAAM;EACrD,MAAM,WAAW,UAAU,MAAM,YAAY,KAAK,OAAO,UACrD,OAAO,OAAO,MAAM,CAAC,GAAG,MAAM,KAAK,CAAC,CACxC;EACA,IAAI,UAAU,SAAS,OACnB,OAAO,SAAS,MAAM,UAAU,OAAO,SAAS,UAAU,KAA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,WAAW;GACxF,gBAAgB,QAAQ,MAAM,KAAK;GACnC,QAAQ;IACJ,UAAU;IACV,MAAM,KAAK,UACP,UACM;KACI,WAAW;KACX,SAAS,QAAQ,KAAK,QAAQ,IAAI,KAAK,YAAY,EAAE,OAAO,EAAE,CAAC;IACnE,IACA,WAAW,SAAS,WAClB;KACI,WAAW;KACX,OAAO;MAAE,MAAM;MAAe,OAAO,UAAU;KAAK;IACxD,IACA,EAAE,WAAW,aAAa,GAClC,MACA,CACJ;GACJ;EACJ;CACJ;AACJ"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@party-stack/foundry-ontology",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.21.0",
|
|
4
4
|
"files": [
|
|
5
5
|
"lib"
|
|
6
6
|
],
|
|
@@ -39,15 +39,15 @@
|
|
|
39
39
|
"effect": "^4.0.5",
|
|
40
40
|
"temporal-polyfill": "^0.3.0",
|
|
41
41
|
"zod": "^4.4.3",
|
|
42
|
-
"@party-stack/connect": "0.
|
|
42
|
+
"@party-stack/connect": "0.3.1",
|
|
43
43
|
"@party-stack/foundry-client": "0.3.1",
|
|
44
|
-
"@party-stack/foundry-object-set-watcher": "0.6.
|
|
44
|
+
"@party-stack/foundry-object-set-watcher": "0.6.1",
|
|
45
45
|
"@party-stack/icons-blueprint": "0.2.1",
|
|
46
|
-
"@party-stack/ontology": "0.
|
|
47
|
-
"@party-stack/ontology-backend": "0.
|
|
48
|
-
"@party-stack/ontology-spec": "0.3.
|
|
49
|
-
"@party-stack/ontology-storage": "0.
|
|
50
|
-
"@party-stack/runtime": "0.
|
|
46
|
+
"@party-stack/ontology": "0.23.0",
|
|
47
|
+
"@party-stack/ontology-backend": "0.3.0",
|
|
48
|
+
"@party-stack/ontology-spec": "0.3.1",
|
|
49
|
+
"@party-stack/ontology-storage": "0.3.0",
|
|
50
|
+
"@party-stack/runtime": "0.6.1"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
53
|
"@tanstack/db": "1.0.0-rc.1.4",
|