@preprio/toolkit 0.6.0-alpha.9 → 1.0.0-rc.2

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 (116) hide show
  1. package/README.md +111 -1363
  2. package/dist/astro/index.cjs +1555 -182
  3. package/dist/astro/index.d.cts +201 -1
  4. package/dist/astro/index.d.ts +201 -1
  5. package/dist/astro/index.js +1557 -29
  6. package/dist/chunk-A2J7R4LR.js +256 -0
  7. package/dist/{chunk-5QIWVDP2.js → chunk-DBKZWOXA.js} +1 -1
  8. package/dist/{chunk-WQBKQG4R.js → chunk-EWXBE3JD.js} +6 -1
  9. package/dist/chunk-KM2GME62.js +1255 -0
  10. package/dist/{chunk-J66UOCK6.js → chunk-LJA5K4KM.js} +1680 -579
  11. package/dist/chunk-UTKH7DOI.js +58 -0
  12. package/dist/chunk-V7MCHPE7.js +85 -0
  13. package/dist/chunk-Y7JWV7WV.js +374 -0
  14. package/dist/codegen/index.cjs +82 -0
  15. package/dist/codegen/index.d.cts +70 -0
  16. package/dist/codegen/index.d.ts +70 -0
  17. package/dist/codegen/index.js +64 -0
  18. package/dist/index.cjs +3729 -553
  19. package/dist/index.d.cts +403 -19
  20. package/dist/index.d.ts +403 -19
  21. package/dist/index.js +345 -24
  22. package/dist/live-preview-HCBNBC6C.js +19 -0
  23. package/dist/nextjs/components.cjs +1872 -754
  24. package/dist/nextjs/components.d.cts +5 -51
  25. package/dist/nextjs/components.d.ts +5 -51
  26. package/dist/nextjs/components.js +8 -299
  27. package/dist/nextjs/index.cjs +1228 -181
  28. package/dist/nextjs/index.d.cts +247 -92
  29. package/dist/nextjs/index.d.ts +247 -92
  30. package/dist/nextjs/index.js +1629 -111
  31. package/dist/nextjs/live-action.cjs +298 -0
  32. package/dist/nextjs/live-action.d.cts +12 -0
  33. package/dist/nextjs/live-action.d.ts +12 -0
  34. package/dist/nextjs/live-action.js +68 -0
  35. package/dist/nextjs/live.cjs +2010 -0
  36. package/dist/nextjs/live.d.cts +54 -0
  37. package/dist/nextjs/live.d.ts +54 -0
  38. package/dist/nextjs/live.js +287 -0
  39. package/dist/nuxt/chunk-5RBZPRQN.js +350 -0
  40. package/dist/nuxt/chunk-LUKVPOJ2.js +32 -0
  41. package/dist/nuxt/index.cjs +15 -16
  42. package/dist/nuxt/index.d.cts +167 -6
  43. package/dist/nuxt/index.d.ts +167 -6
  44. package/dist/nuxt/index.js +402 -15
  45. package/dist/nuxt/live-preview-KO4IKWTX.js +1234 -0
  46. package/dist/nuxt/live.cjs +1928 -0
  47. package/dist/nuxt/live.d.cts +45 -0
  48. package/dist/nuxt/live.d.ts +45 -0
  49. package/dist/nuxt/live.js +216 -0
  50. package/dist/{types-BYH9XqmN.d.cts → pixel-DqU7NvgW.d.cts} +102 -5
  51. package/dist/{types-BYH9XqmN.d.ts → pixel-DqU7NvgW.d.ts} +102 -5
  52. package/dist/react/components.cjs +1865 -480
  53. package/dist/react/components.d.cts +43 -8
  54. package/dist/react/components.d.ts +43 -8
  55. package/dist/react/components.js +1865 -480
  56. package/dist/sveltekit/chunk-5RBZPRQN.js +350 -0
  57. package/dist/sveltekit/chunk-LUKVPOJ2.js +32 -0
  58. package/dist/sveltekit/index.cjs +15 -16
  59. package/dist/sveltekit/index.d.cts +111 -10
  60. package/dist/sveltekit/index.d.ts +111 -10
  61. package/dist/sveltekit/index.js +398 -15
  62. package/dist/sveltekit/live-preview-KO4IKWTX.js +1234 -0
  63. package/dist/sveltekit/live.cjs +1940 -0
  64. package/dist/sveltekit/live.d.cts +61 -0
  65. package/dist/sveltekit/live.d.ts +61 -0
  66. package/dist/sveltekit/live.js +220 -0
  67. package/package.json +132 -71
  68. package/src/astro/PreprToolbar.astro +7 -1
  69. package/src/astro/PreprTrackingPixel.astro +2 -4
  70. package/src/nuxt/PreprToolbar.vue +12 -1
  71. package/src/nuxt/PreprTrackingPixel.vue +2 -4
  72. package/src/sveltekit/PreprToolbar.svelte +17 -2
  73. package/src/sveltekit/PreprTrackingPixel.svelte +2 -4
  74. package/dist/astro/chunk-UN4JADNU.js +0 -173
  75. package/dist/astro/graphql.cjs +0 -1078
  76. package/dist/astro/graphql.d.cts +0 -300
  77. package/dist/astro/graphql.d.ts +0 -300
  78. package/dist/astro/graphql.js +0 -984
  79. package/dist/astro/index-XT_z-RYT.d.cts +0 -130
  80. package/dist/astro/index-XT_z-RYT.d.ts +0 -130
  81. package/dist/chunk-3NCEVJJ3.js +0 -10
  82. package/dist/chunk-S5RWVMDJ.js +0 -148
  83. package/dist/chunk-XL4Y7FGW.js +0 -499
  84. package/dist/graphql/codegen.cjs +0 -557
  85. package/dist/graphql/codegen.d.cts +0 -23
  86. package/dist/graphql/codegen.d.ts +0 -23
  87. package/dist/graphql/codegen.js +0 -99
  88. package/dist/graphql.cjs +0 -1020
  89. package/dist/graphql.d.cts +0 -335
  90. package/dist/graphql.d.ts +0 -335
  91. package/dist/graphql.js +0 -448
  92. package/dist/nextjs/chunk-CMV6ZP6E.js +0 -549
  93. package/dist/nextjs/graphql.cjs +0 -1836
  94. package/dist/nextjs/graphql.d.cts +0 -498
  95. package/dist/nextjs/graphql.d.ts +0 -498
  96. package/dist/nextjs/graphql.js +0 -1422
  97. package/dist/nextjs/server-BL-sqZvu.d.cts +0 -156
  98. package/dist/nextjs/server-BL-sqZvu.d.ts +0 -156
  99. package/dist/nuxt/chunk-XWOABVMW.js +0 -417
  100. package/dist/nuxt/graphql.cjs +0 -1085
  101. package/dist/nuxt/graphql.d.cts +0 -297
  102. package/dist/nuxt/graphql.d.ts +0 -297
  103. package/dist/nuxt/graphql.js +0 -985
  104. package/dist/nuxt/server-8v6OHbsw.d.cts +0 -158
  105. package/dist/nuxt/server-8v6OHbsw.d.ts +0 -158
  106. package/dist/pixel-DwW7cXJm.d.cts +0 -49
  107. package/dist/pixel-DwW7cXJm.d.ts +0 -49
  108. package/dist/server-Brr1UgtW.d.ts +0 -59
  109. package/dist/server-DJuS3YU0.d.cts +0 -59
  110. package/dist/sveltekit/chunk-3S5RA6G5.js +0 -413
  111. package/dist/sveltekit/graphql.cjs +0 -1091
  112. package/dist/sveltekit/graphql.d.cts +0 -302
  113. package/dist/sveltekit/graphql.d.ts +0 -302
  114. package/dist/sveltekit/graphql.js +0 -991
  115. package/dist/sveltekit/server-CO847mEV.d.cts +0 -98
  116. package/dist/sveltekit/server-CO847mEV.d.ts +0 -98
@@ -1,499 +0,0 @@
1
- import {
2
- PreprError
3
- } from "./chunk-WQBKQG4R.js";
4
-
5
- // src/core/variants/constants.ts
6
- var PREPR_CONTEXT_ALIAS = "_preprContext";
7
- var PREPR_TYPE_ALIAS = "_preprType";
8
- var PREPR_DEFAULT_VARIANT = "ALL_OTHER_USERS";
9
-
10
- // src/core/variants/resolve.ts
11
- function personalizationPaths(data) {
12
- const paths = /* @__PURE__ */ new Map();
13
- const walk = (value, path) => {
14
- if (Array.isArray(value)) {
15
- for (const item of value) {
16
- if (contextOf(item)?.kind === "PERSONALIZATION") {
17
- const record = item;
18
- const type = record[PREPR_TYPE_ALIAS] ?? record.__typename;
19
- const types = paths.get(path) ?? /* @__PURE__ */ new Set();
20
- types.add(typeof type === "string" ? type : "*");
21
- paths.set(path, types);
22
- }
23
- walk(item, path);
24
- }
25
- return;
26
- }
27
- if (!value || typeof value !== "object") return;
28
- for (const [key, child] of Object.entries(value)) {
29
- if (key !== PREPR_CONTEXT_ALIAS && key !== PREPR_TYPE_ALIAS)
30
- walk(child, path ? `${path}.${key}` : key);
31
- }
32
- };
33
- walk(data, "");
34
- return paths;
35
- }
36
- function contextOf(item) {
37
- if (!item || typeof item !== "object") return null;
38
- const context = item[PREPR_CONTEXT_ALIAS];
39
- const ctx = context;
40
- return ctx?.kind && ctx.group_id ? ctx : null;
41
- }
42
- function decisionsFrom(data) {
43
- const decisions = /* @__PURE__ */ new Map();
44
- const walk = (value) => {
45
- if (Array.isArray(value)) return value.forEach(walk);
46
- if (!value || typeof value !== "object") return;
47
- const ctx = contextOf(value);
48
- if (ctx?.group_id && ctx.variant_id) {
49
- const ids = decisions.get(ctx.group_id) ?? [];
50
- if (!ids.includes(ctx.variant_id)) ids.push(ctx.variant_id);
51
- decisions.set(ctx.group_id, ids);
52
- }
53
- Object.values(value).forEach(walk);
54
- };
55
- walk(data);
56
- return decisions;
57
- }
58
- function chosenVariants(ctx, options) {
59
- const decided = options.decisions?.get(ctx.group_id);
60
- if (ctx.kind === "AB_TEST") {
61
- return options.bucket ? [options.bucket] : decided ?? ["A"];
62
- }
63
- return decided ?? [PREPR_DEFAULT_VARIANT];
64
- }
65
- function resolveVariants(data, options = {}) {
66
- const resolve = (value) => {
67
- if (Array.isArray(value)) {
68
- return value.filter((item) => {
69
- const ctx = contextOf(item);
70
- return !ctx || chosenVariants(ctx, options).includes(ctx.variant_id ?? "");
71
- }).map(resolve);
72
- }
73
- if (!value || typeof value !== "object") return value;
74
- const out = {};
75
- for (const [key, child] of Object.entries(value)) out[key] = resolve(child);
76
- return out;
77
- };
78
- return resolve(data);
79
- }
80
-
81
- // src/core/variants/schema.ts
82
- var PREPR_SCHEMA_QUERY = `query PreprPersonalizationSchema {
83
- __schema {
84
- queryType { name }
85
- types {
86
- name
87
- possibleTypes { name }
88
- fields {
89
- name
90
- args { name }
91
- type { name ofType { name ofType { name ofType { name ofType { name } } } } }
92
- }
93
- }
94
- }
95
- }`;
96
- function namedType(ref) {
97
- let current = ref;
98
- while (current && !current.name) current = current.ofType;
99
- return current?.name ?? "";
100
- }
101
- function toSchemaInfo(introspection) {
102
- const types = {};
103
- for (const type of introspection.__schema.types) {
104
- if (type.name.startsWith("__")) continue;
105
- const fields = {};
106
- for (const field of type.fields ?? []) {
107
- fields[field.name] = {
108
- type: namedType(field.type),
109
- personalizable: field.args.some((arg) => arg.name === "personalize")
110
- };
111
- }
112
- types[type.name] = {
113
- fields,
114
- possibleTypes: (type.possibleTypes ?? []).map((t) => t.name),
115
- hasContext: "_context" in fields
116
- };
117
- }
118
- return { queryType: introspection.__schema.queryType.name, types };
119
- }
120
-
121
- // src/core/graphql/document.ts
122
- import { print } from "graphql/language/printer.js";
123
- import { stripIgnoredCharacters } from "graphql/utilities/stripIgnoredCharacters.js";
124
- var printed = /* @__PURE__ */ new WeakMap();
125
- function isDocumentNode(value) {
126
- return typeof value === "object" && value !== null && value.kind === "Document" && Array.isArray(value.definitions);
127
- }
128
- function invalidDocument(originalError) {
129
- return new PreprError(
130
- "Expected a GraphQL query string, TypedDocumentString or DocumentNode",
131
- "INVALID_DOCUMENT",
132
- "createPreprClient",
133
- originalError
134
- );
135
- }
136
- var minified = /* @__PURE__ */ new Map();
137
- var MINIFIED_CACHE_LIMIT = 500;
138
- function minify(query) {
139
- const cached = minified.get(query);
140
- if (cached !== void 0) return cached;
141
- let result = query;
142
- try {
143
- result = stripIgnoredCharacters(query);
144
- } catch {
145
- }
146
- if (minified.size < MINIFIED_CACHE_LIMIT) minified.set(query, result);
147
- return result;
148
- }
149
- function resolveQuery(document) {
150
- if (typeof document === "string") return minify(document);
151
- if (document instanceof String) return minify(document.toString());
152
- if (!isDocumentNode(document)) throw invalidDocument();
153
- let query = printed.get(document);
154
- if (query === void 0) {
155
- try {
156
- query = minify(print(document));
157
- } catch (error) {
158
- throw invalidDocument(error instanceof Error ? error : void 0);
159
- }
160
- printed.set(document, query);
161
- }
162
- return query;
163
- }
164
-
165
- // src/core/variants/ast.ts
166
- import { parse } from "graphql/language/parser.js";
167
- var name = (value) => ({ kind: "Name", value });
168
- function selectionSet(selections) {
169
- return { kind: "SelectionSet", selections };
170
- }
171
- function contextField(withKey) {
172
- const fields = ["kind", "group_id", "variant_id"];
173
- if (withKey) fields.push("variant_key");
174
- return {
175
- kind: "Field",
176
- alias: name(PREPR_CONTEXT_ALIAS),
177
- name: name("_context"),
178
- selectionSet: selectionSet(
179
- fields.map(
180
- (field) => ({ kind: "Field", name: name(field) })
181
- )
182
- )
183
- };
184
- }
185
- function typenameField() {
186
- return {
187
- kind: "Field",
188
- alias: name(PREPR_TYPE_ALIAS),
189
- name: name("__typename")
190
- };
191
- }
192
- function inlineFragment(typeName, selections) {
193
- return {
194
- kind: "InlineFragment",
195
- typeCondition: { kind: "NamedType", name: name(typeName) },
196
- selectionSet: selectionSet(selections)
197
- };
198
- }
199
- function contextSelections(typeName, schema, onlyTypes, withType = true) {
200
- const fields = () => withType ? [contextField(true), typenameField()] : [contextField(false)];
201
- const type = schema.types[typeName];
202
- if (!type) return [];
203
- if (type.possibleTypes.length > 0) {
204
- return type.possibleTypes.filter(
205
- (member) => schema.types[member]?.hasContext && (!onlyTypes || onlyTypes.has(member))
206
- ).map((member) => inlineFragment(member, fields()));
207
- }
208
- return type.hasContext ? fields() : [];
209
- }
210
- function withoutPersonalizeArg(args = []) {
211
- return args.filter((arg) => arg.name.value !== "personalize");
212
- }
213
- function documentOf(document) {
214
- if (typeof document === "string") return parse(document);
215
- if (document instanceof String) return parse(document.toString());
216
- return document;
217
- }
218
- function collectVariables(node, used) {
219
- if (!node || typeof node !== "object") return;
220
- if (Array.isArray(node)) {
221
- for (const item of node) collectVariables(item, used);
222
- return;
223
- }
224
- const value = node;
225
- if (value.kind === "Variable") {
226
- used.add(value.name.value);
227
- return;
228
- }
229
- for (const key of Object.keys(value)) {
230
- if (key !== "loc") collectVariables(value[key], used);
231
- }
232
- }
233
-
234
- // src/core/variants/decision-document.ts
235
- function decisionSelectionSet(set, typeName, path, ctx) {
236
- const selections = [];
237
- for (const selection of set.selections) {
238
- if (selection.kind === "FragmentSpread") {
239
- const fragment = ctx.fragments[selection.name.value];
240
- if (!fragment) continue;
241
- const pruned = decisionSelectionSet(
242
- fragment.selectionSet,
243
- fragment.typeCondition.name.value,
244
- path,
245
- ctx
246
- );
247
- if (!pruned) continue;
248
- if (fragment.typeCondition.name.value === typeName) {
249
- selections.push(...pruned.selections);
250
- } else {
251
- selections.push(
252
- inlineFragment(fragment.typeCondition.name.value, [
253
- ...pruned.selections
254
- ])
255
- );
256
- }
257
- continue;
258
- }
259
- if (selection.kind === "InlineFragment") {
260
- const condition = selection.typeCondition?.name.value ?? typeName;
261
- const pruned = decisionSelectionSet(
262
- selection.selectionSet,
263
- condition,
264
- path,
265
- ctx
266
- );
267
- if (!pruned) continue;
268
- if (condition === typeName && !selection.directives?.length) {
269
- selections.push(...pruned.selections);
270
- } else {
271
- selections.push({ ...selection, selectionSet: pruned });
272
- }
273
- continue;
274
- }
275
- if (!selection.selectionSet) continue;
276
- const field = ctx.schema.types[typeName]?.fields[selection.name.value];
277
- if (!field) continue;
278
- const key = selection.alias?.value ?? selection.name.value;
279
- const fieldPath = path ? `${path}.${key}` : key;
280
- if (ctx.paths && !ctx.paths.prefixes.has(fieldPath)) continue;
281
- const child = decisionSelectionSet(
282
- selection.selectionSet,
283
- field.type,
284
- fieldPath,
285
- ctx
286
- );
287
- const groupTypes = ctx.paths?.groups.get(fieldPath);
288
- const holdsGroups = field.personalizable && (!ctx.paths || groupTypes !== void 0);
289
- if (holdsGroups) {
290
- selections.push({
291
- ...selection,
292
- arguments: withoutPersonalizeArg(selection.arguments),
293
- selectionSet: selectionSet([
294
- ...ctx.topLevelOnly ? [] : child?.selections ?? [],
295
- ...contextSelections(
296
- field.type,
297
- ctx.schema,
298
- groupTypes && !groupTypes.has("*") ? groupTypes : void 0,
299
- false
300
- )
301
- ])
302
- });
303
- } else if (child) {
304
- selections.push({
305
- ...selection,
306
- arguments: field.personalizable ? withoutPersonalizeArg(selection.arguments) : selection.arguments,
307
- selectionSet: child
308
- });
309
- }
310
- }
311
- return selections.length > 0 ? selectionSet(selections) : null;
312
- }
313
- function toDecisionDocument(document, schema, groupPaths, options) {
314
- const doc = documentOf(document);
315
- const fragments = {};
316
- for (const definition of doc.definitions) {
317
- if (definition.kind === "FragmentDefinition") {
318
- fragments[definition.name.value] = definition;
319
- }
320
- }
321
- const operation = doc.definitions.find(
322
- (definition) => definition.kind === "OperationDefinition"
323
- );
324
- if (!operation) return null;
325
- let paths;
326
- if (groupPaths) {
327
- const prefixes = /* @__PURE__ */ new Set();
328
- for (const groupPath of groupPaths.keys()) {
329
- const parts = groupPath.split(".");
330
- for (let i = 1; i <= parts.length; i++) {
331
- prefixes.add(parts.slice(0, i).join("."));
332
- }
333
- }
334
- paths = { groups: groupPaths, prefixes };
335
- }
336
- const pruned = decisionSelectionSet(
337
- operation.selectionSet,
338
- schema.queryType,
339
- "",
340
- { schema, fragments, paths, topLevelOnly: options?.topLevelOnly }
341
- );
342
- if (!pruned) return null;
343
- const used = /* @__PURE__ */ new Set();
344
- collectVariables(pruned, used);
345
- collectVariables(operation.directives, used);
346
- const shared = sharedContextFragment(schema);
347
- return {
348
- kind: "Document",
349
- definitions: [
350
- ...shared ? [shared.definition] : [],
351
- {
352
- ...operation,
353
- name: operation.name && name(`${operation.name.value}Decision`),
354
- variableDefinitions: (operation.variableDefinitions ?? []).filter(
355
- (definition) => used.has(definition.variable.name.value)
356
- ),
357
- selectionSet: shared ? shared.apply(pruned) : pruned
358
- }
359
- ]
360
- };
361
- }
362
- function sharedContextFragment(schema) {
363
- const contextTypes = new Set(
364
- Object.values(schema.types).flatMap(
365
- (type) => type.hasContext ? [type.fields._context.type] : []
366
- )
367
- );
368
- if (contextTypes.size !== 1) return null;
369
- const [contextType] = contextTypes;
370
- const fragmentName = "c";
371
- const definition = {
372
- kind: "FragmentDefinition",
373
- name: name(fragmentName),
374
- typeCondition: { kind: "NamedType", name: name(contextType) },
375
- selectionSet: selectionSet(
376
- ["kind", "group_id", "variant_id"].map(
377
- (field) => ({ kind: "Field", name: name(field) })
378
- )
379
- )
380
- };
381
- const spread = {
382
- kind: "FragmentSpread",
383
- name: name(fragmentName)
384
- };
385
- const apply = (set) => selectionSet(
386
- set.selections.map((selection) => {
387
- if (selection.kind === "Field" && selection.alias?.value === PREPR_CONTEXT_ALIAS) {
388
- return { ...selection, selectionSet: selectionSet([spread]) };
389
- }
390
- return "selectionSet" in selection && selection.selectionSet ? {
391
- ...selection,
392
- selectionSet: apply(selection.selectionSet)
393
- } : selection;
394
- })
395
- );
396
- return { definition, apply };
397
- }
398
-
399
- // src/core/variants/variants-document.ts
400
- function variantsSelectionSet(set, typeName, schema) {
401
- const selections = set.selections.map((selection) => {
402
- if (selection.kind === "InlineFragment") {
403
- return {
404
- ...selection,
405
- selectionSet: variantsSelectionSet(
406
- selection.selectionSet,
407
- selection.typeCondition?.name.value ?? typeName,
408
- schema
409
- )
410
- };
411
- }
412
- if (selection.kind !== "Field" || !selection.selectionSet) return selection;
413
- const field = schema.types[typeName]?.fields[selection.name.value];
414
- if (!field) return selection;
415
- const child = variantsSelectionSet(
416
- selection.selectionSet,
417
- field.type,
418
- schema
419
- );
420
- if (!field.personalizable) return { ...selection, selectionSet: child };
421
- return {
422
- ...selection,
423
- arguments: [
424
- ...withoutPersonalizeArg(selection.arguments),
425
- {
426
- kind: "Argument",
427
- name: name("personalize"),
428
- value: { kind: "BooleanValue", value: false }
429
- }
430
- ],
431
- selectionSet: selectionSet([
432
- ...child.selections,
433
- ...contextSelections(field.type, schema)
434
- ])
435
- };
436
- });
437
- return { ...set, selections };
438
- }
439
- function toVariantsDocument(document, schema) {
440
- const doc = documentOf(document);
441
- return {
442
- ...doc,
443
- definitions: doc.definitions.map((definition) => {
444
- if (definition.kind === "OperationDefinition") {
445
- return {
446
- ...definition,
447
- selectionSet: variantsSelectionSet(
448
- definition.selectionSet,
449
- schema.queryType,
450
- schema
451
- )
452
- };
453
- }
454
- if (definition.kind === "FragmentDefinition") {
455
- return {
456
- ...definition,
457
- selectionSet: variantsSelectionSet(
458
- definition.selectionSet,
459
- definition.typeCondition.name.value,
460
- schema
461
- )
462
- };
463
- }
464
- return definition;
465
- })
466
- };
467
- }
468
-
469
- // src/core/variants/queries.ts
470
- function toVariantsQuery(document, schema) {
471
- return resolveQuery(toVariantsDocument(document, schema));
472
- }
473
- function toDecisionQuery(document, schema, options = {}) {
474
- const paths = options.from === void 0 ? void 0 : personalizationPaths(options.from);
475
- if (paths && paths.size === 0) return null;
476
- const decision = toDecisionDocument(document, schema, paths, {
477
- topLevelOnly: !paths && options.topLevelOnly
478
- });
479
- return decision ? resolveQuery(decision) : null;
480
- }
481
-
482
- export {
483
- PREPR_DEFAULT_VARIANT,
484
- name,
485
- selectionSet,
486
- documentOf,
487
- collectVariables,
488
- toDecisionDocument,
489
- personalizationPaths,
490
- contextOf,
491
- decisionsFrom,
492
- resolveVariants,
493
- PREPR_SCHEMA_QUERY,
494
- toSchemaInfo,
495
- toVariantsDocument,
496
- resolveQuery,
497
- toVariantsQuery,
498
- toDecisionQuery
499
- };