@reactionary/core 0.8.0 → 0.9.1

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 (51) hide show
  1. package/capabilities/feature-flag.capability.js +25 -0
  2. package/capabilities/index.js +13 -11
  3. package/capabilities/personalization-profile.capability.js +9 -0
  4. package/factories/feature-flag.factory.js +0 -0
  5. package/factories/index.js +2 -0
  6. package/factories/personalization-profile.factory.js +0 -0
  7. package/initialization.js +6 -2
  8. package/package.json +1 -1
  9. package/schemas/capabilities.schema.js +3 -1
  10. package/schemas/models/feature-flags.model.js +27 -0
  11. package/schemas/models/identifiers.model.js +9 -0
  12. package/schemas/models/index.js +2 -0
  13. package/schemas/models/personalization-profile.model.js +10 -0
  14. package/schemas/mutations/analytics/base-event.mutation.js +8 -0
  15. package/schemas/mutations/analytics/index.js +1 -0
  16. package/schemas/mutations/analytics/product-add-to-cart.mutation.js +4 -4
  17. package/schemas/mutations/analytics/product-details-view.mutation.js +2 -1
  18. package/schemas/mutations/analytics/product-summary-click.mutation.js +2 -1
  19. package/schemas/mutations/analytics/product-summary-view.mutation.js +2 -1
  20. package/schemas/mutations/analytics/purchase.mutation.js +2 -1
  21. package/schemas/queries/feature-flag.query.js +11 -0
  22. package/schemas/queries/index.js +2 -0
  23. package/schemas/queries/personalization-profile.query.js +10 -0
  24. package/schemas/queries/product-recommendations.query.js +3 -1
  25. package/schemas/queries/product-search.query.js +3 -1
  26. package/schemas/session.schema.js +4 -3
  27. package/src/capabilities/feature-flag.capability.d.ts +9 -0
  28. package/src/capabilities/index.d.ts +13 -11
  29. package/src/capabilities/personalization-profile.capability.d.ts +9 -0
  30. package/src/client/client.d.ts +4 -0
  31. package/src/factories/feature-flag.factory.d.ts +12 -0
  32. package/src/factories/index.d.ts +2 -0
  33. package/src/factories/personalization-profile.factory.d.ts +12 -0
  34. package/src/schemas/capabilities.schema.d.ts +2 -0
  35. package/src/schemas/models/feature-flags.model.d.ts +43 -0
  36. package/src/schemas/models/identifiers.model.d.ts +9 -1
  37. package/src/schemas/models/index.d.ts +2 -0
  38. package/src/schemas/models/personalization-profile.model.d.ts +10 -0
  39. package/src/schemas/mutations/analytics/base-event.mutation.d.ts +11 -0
  40. package/src/schemas/mutations/analytics/index.d.ts +36 -0
  41. package/src/schemas/mutations/analytics/product-add-to-cart.mutation.d.ts +7 -0
  42. package/src/schemas/mutations/analytics/product-details-view.mutation.d.ts +7 -0
  43. package/src/schemas/mutations/analytics/product-summary-click.mutation.d.ts +7 -0
  44. package/src/schemas/mutations/analytics/product-summary-view.mutation.d.ts +7 -0
  45. package/src/schemas/mutations/analytics/purchase.mutation.d.ts +7 -0
  46. package/src/schemas/queries/feature-flag.query.d.ts +15 -0
  47. package/src/schemas/queries/index.d.ts +2 -0
  48. package/src/schemas/queries/personalization-profile.query.d.ts +67 -0
  49. package/src/schemas/queries/product-recommendations.query.d.ts +120 -0
  50. package/src/schemas/queries/product-search.query.d.ts +7 -0
  51. package/src/schemas/session.schema.d.ts +14 -4
@@ -0,0 +1,25 @@
1
+ import { BaseCapability } from "./base.capability.js";
2
+ class FeatureFlagCapability extends BaseCapability {
3
+ getResourceName() {
4
+ return "feature-flags";
5
+ }
6
+ isEnabled(flags, key, variant) {
7
+ const flag = flags.find((f) => f.identifier.key === key);
8
+ if (!flag) {
9
+ return false;
10
+ }
11
+ if (flag.type === "boolean") {
12
+ return flag.enabled;
13
+ }
14
+ if (variant) {
15
+ if (flag.type === "multivariate") {
16
+ return flag.variants.some((v) => v.name === variant && v.enabled);
17
+ }
18
+ return false;
19
+ }
20
+ return false;
21
+ }
22
+ }
23
+ export {
24
+ FeatureFlagCapability
25
+ };
@@ -3,20 +3,22 @@ export * from "./base.capability.js";
3
3
  export * from "./cart.capability.js";
4
4
  export * from "./category.capability.js";
5
5
  export * from "./checkout.capability.js";
6
+ export * from "./company-registration.capability.js";
7
+ export * from "./company.capability.js";
8
+ export * from "./employee-invitation.capability.js";
9
+ export * from "./employee.capability.js";
10
+ export * from "./feature-flag.capability.js";
6
11
  export * from "./identity.capability.js";
7
12
  export * from "./inventory.capability.js";
13
+ export * from "./personalization-profile.capability.js";
14
+ export * from "./order-search.capability.js";
15
+ export * from "./order.capability.js";
8
16
  export * from "./price.capability.js";
9
- export * from "./product.capability.js";
10
- export * from "./profile.capability.js";
11
- export * from "./product-search.capability.js";
12
- export * from "./product-recommendations.capability.js";
13
17
  export * from "./product-associations.capability.js";
14
- export * from "./product-reviews.capability.js";
15
18
  export * from "./product-list.capability.js";
19
+ export * from "./product-recommendations.capability.js";
20
+ export * from "./product-reviews.capability.js";
21
+ export * from "./product-search.capability.js";
22
+ export * from "./product.capability.js";
23
+ export * from "./profile.capability.js";
16
24
  export * from "./store.capability.js";
17
- export * from "./order.capability.js";
18
- export * from "./order-search.capability.js";
19
- export * from "./company-registration.capability.js";
20
- export * from "./employee.capability.js";
21
- export * from "./employee-invitation.capability.js";
22
- export * from "./company.capability.js";
@@ -0,0 +1,9 @@
1
+ import { BaseCapability } from "./base.capability.js";
2
+ class PersonalizationProfileCapability extends BaseCapability {
3
+ getResourceName() {
4
+ return "personalization-profile";
5
+ }
6
+ }
7
+ export {
8
+ PersonalizationProfileCapability
9
+ };
File without changes
@@ -5,8 +5,10 @@ export * from "./company-registration.factory.js";
5
5
  export * from "./company.factory.js";
6
6
  export * from "./employee-invitation.factory.js";
7
7
  export * from "./employee.factory.js";
8
+ export * from "./feature-flag.factory.js";
8
9
  export * from "./identity.factory.js";
9
10
  export * from "./inventory.factory.js";
11
+ export * from "./personalization-profile.factory.js";
10
12
  export * from "./order.factory.js";
11
13
  export * from "./order-search.factory.js";
12
14
  export * from "./price.factory.js";
File without changes
package/initialization.js CHANGED
@@ -18,8 +18,12 @@ function createInitialRequestContext() {
18
18
  identity: {
19
19
  type: "Anonymous"
20
20
  },
21
- lastUpdated: /* @__PURE__ */ new Date(),
22
- personalizationKey: crypto.randomUUID()
21
+ lastUpdated: /* @__PURE__ */ new Date()
22
+ },
23
+ marketingContext: {
24
+ identifier: { key: "" },
25
+ segments: [],
26
+ blurb: ""
23
27
  }
24
28
  },
25
29
  correlationId: "",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reactionary/core",
3
- "version": "0.8.0",
3
+ "version": "0.9.1",
4
4
  "type": "module",
5
5
  "main": "./index.js",
6
6
  "types": "./src/index.d.ts",
@@ -16,7 +16,9 @@ const CapabilitiesSchema = z.looseObject({
16
16
  price: z.boolean(),
17
17
  category: z.boolean(),
18
18
  store: z.boolean(),
19
- profile: z.boolean()
19
+ profile: z.boolean(),
20
+ featureFlag: z.boolean(),
21
+ personalizationProfile: z.boolean()
20
22
  });
21
23
  export {
22
24
  CapabilitiesSchema
@@ -0,0 +1,27 @@
1
+ import { BaseModelSchema } from "./base.model.js";
2
+ import * as z from "zod";
3
+ import { FeatureFlagIdentifierSchema } from "./identifiers.model.js";
4
+ const BaseFeatureFlagSchema = BaseModelSchema.extend({
5
+ identifier: FeatureFlagIdentifierSchema
6
+ });
7
+ const BooleanFeatureFlagSchema = BaseFeatureFlagSchema.extend({
8
+ type: z.literal("boolean").meta({ description: "The type of feature flag, which is boolean in this case." }),
9
+ enabled: z.boolean().meta({ description: "Indicates whether the feature flag is enabled or not." })
10
+ });
11
+ const MultivariateFeatureFlagSchema = BaseFeatureFlagSchema.extend({
12
+ type: z.literal("multivariate").meta({ description: "The type of feature flag, which is multivariate in this case." }),
13
+ variants: z.array(z.object({
14
+ name: z.string().meta({ description: "The name of the variant." }),
15
+ enabled: z.boolean().meta({ description: "Indicates whether the variant is enabled or not." })
16
+ })).meta({ description: "The variants for the multivariate feature flag." })
17
+ });
18
+ const FeatureFlagSchema = z.discriminatedUnion("type", [
19
+ BooleanFeatureFlagSchema,
20
+ MultivariateFeatureFlagSchema
21
+ ]);
22
+ export {
23
+ BaseFeatureFlagSchema,
24
+ BooleanFeatureFlagSchema,
25
+ FeatureFlagSchema,
26
+ MultivariateFeatureFlagSchema
27
+ };
@@ -115,6 +115,7 @@ const ProductSearchIdentifierSchema = z.looseObject({
115
115
  paginationOptions: PaginationOptionsSchema.meta({ description: "Pagination options for the search results." }),
116
116
  categoryFilter: FacetValueIdentifierSchema.optional().meta({ description: "An optional category filter applied to the search results." }),
117
117
  company: CompanyIdentifierSchema.optional().meta({ description: "The identifier for the company to search products within. This can be used to filter products by specific companies, which can be useful for B2B use cases." })
118
+ // personalizationProfile: PersonalizationProfileSchema.optional().meta({ description: 'The marketing profile of the user performing the search. This can be used to provide personalized search results based on the user\'s segments and other attributes defined in their marketing profile.' }),
118
119
  });
119
120
  const OrderSearchIdentifierSchema = z.looseObject({
120
121
  term: z.string().meta({ description: "The search term used to find orders. Not all providers may support term-based search for orders." }),
@@ -178,6 +179,12 @@ const CartSearchIdentifierSchema = z.looseObject({
178
179
  company: CompanyIdentifierSchema.optional().meta({ description: "The identifier for the company to search carts within. This can be used to filter carts by specific companies, which can be useful for B2B use cases." }),
179
180
  paginationOptions: PaginationOptionsSchema.meta({ description: "Pagination options for the search results." })
180
181
  });
182
+ const PersonalizationProfileIdentifierSchema = z.looseObject({
183
+ key: z.string().meta({ description: "The unique identifier for the personalization profile." })
184
+ });
185
+ const FeatureFlagIdentifierSchema = z.looseObject({
186
+ key: z.string().meta({ description: "The unique identifier for the feature flag." })
187
+ });
181
188
  export {
182
189
  AddressIdentifierSchema,
183
190
  CartIdentifierSchema,
@@ -198,6 +205,7 @@ export {
198
205
  EmployeeSearchIdentifierSchema,
199
206
  FacetIdentifierSchema,
200
207
  FacetValueIdentifierSchema,
208
+ FeatureFlagIdentifierSchema,
201
209
  FulfillmentCenterIdentifierSchema,
202
210
  IdentityIdentifierSchema,
203
211
  InventoryIdentifierSchema,
@@ -208,6 +216,7 @@ export {
208
216
  OrderStatusSchema,
209
217
  PaymentInstructionIdentifierSchema,
210
218
  PaymentMethodIdentifierSchema,
219
+ PersonalizationProfileIdentifierSchema,
211
220
  PickupPointIdentifierSchema,
212
221
  PriceIdentifierSchema,
213
222
  ProductAssociationsIdentifierSchema,
@@ -26,3 +26,5 @@ export * from "./company.model.js";
26
26
  export * from "./company-registration.model.js";
27
27
  export * from "./employee.model.js";
28
28
  export * from "./employee-invitation.model.js";
29
+ export * from "./feature-flags.model.js";
30
+ export * from "./personalization-profile.model.js";
@@ -0,0 +1,10 @@
1
+ import * as z from "zod";
2
+ import { PersonalizationProfileIdentifierSchema } from "./identifiers.model.js";
3
+ const PersonalizationProfileSchema = z.looseObject({
4
+ identifier: PersonalizationProfileIdentifierSchema.meta({ description: "The identifier object for the marketing profile. This should contain a unique key that identifies the marketing profile." }),
5
+ segments: z.array(z.string()).default(() => []).meta({ description: "The segments that the marketing profile belongs to. This can be used for targeting specific segments with feature flags or other marketing activities." }),
6
+ blurb: z.string().default("").meta({ description: "A short description or blurb about the marketing profile. This can be used for informational purposes or to provide context about the marketing profile." })
7
+ });
8
+ export {
9
+ PersonalizationProfileSchema
10
+ };
@@ -0,0 +1,8 @@
1
+ import { PersonalizationProfileSchema } from "../../models/personalization-profile.model.js";
2
+ import { BaseMutationSchema } from "../base.mutation.js";
3
+ const AnalyticsBaseMutationSchema = BaseMutationSchema.extend({
4
+ personalizationProfile: PersonalizationProfileSchema.optional().meta({ description: "The personalization profile of the user associated with the event. This can be used to provide personalized experiences based on the user's segments and other attributes defined in their personalization profile, if any" })
5
+ });
6
+ export {
7
+ AnalyticsBaseMutationSchema
8
+ };
@@ -16,6 +16,7 @@ export * from "./product-details-view.mutation.js";
16
16
  export * from "./product-summary-click.mutation.js";
17
17
  export * from "./product-summary-view.mutation.js";
18
18
  export * from "./purchase.mutation.js";
19
+ export * from "./base-event.mutation.js";
19
20
  export {
20
21
  AnalyticsMutationSchema
21
22
  };
@@ -1,10 +1,10 @@
1
1
  import * as z from "zod";
2
2
  import {
3
- ProductSearchIdentifierSchema,
4
- ProductIdentifierSchema
3
+ ProductIdentifierSchema,
4
+ ProductSearchIdentifierSchema
5
5
  } from "../../models/identifiers.model.js";
6
- import { BaseMutationSchema } from "../base.mutation.js";
7
- const AnalyticsMutationProductAddToCartEventSchema = BaseMutationSchema.extend({
6
+ import { AnalyticsBaseMutationSchema } from "./base-event.mutation.js";
7
+ const AnalyticsMutationProductAddToCartEventSchema = AnalyticsBaseMutationSchema.extend({
8
8
  event: z.literal("product-cart-add"),
9
9
  source: z.discriminatedUnion("type", [
10
10
  z.object({
@@ -1,7 +1,8 @@
1
1
  import * as z from "zod";
2
2
  import { ProductIdentifierSchema } from "../../models/identifiers.model.js";
3
3
  import { BaseMutationSchema } from "../base.mutation.js";
4
- const AnalyticsMutationProductDetailsViewEventSchema = BaseMutationSchema.extend({
4
+ import { AnalyticsBaseMutationSchema } from "./base-event.mutation.js";
5
+ const AnalyticsMutationProductDetailsViewEventSchema = AnalyticsBaseMutationSchema.extend({
5
6
  event: z.literal("product-details-view"),
6
7
  product: ProductIdentifierSchema
7
8
  });
@@ -4,7 +4,8 @@ import {
4
4
  } from "../../models/identifiers.model.js";
5
5
  import { BaseMutationSchema } from "../base.mutation.js";
6
6
  import * as z from "zod";
7
- const AnalyticsMutationProductSummaryClickEventSchema = BaseMutationSchema.extend({
7
+ import { AnalyticsBaseMutationSchema } from "./base-event.mutation.js";
8
+ const AnalyticsMutationProductSummaryClickEventSchema = AnalyticsBaseMutationSchema.extend({
8
9
  event: z.literal("product-summary-click"),
9
10
  product: ProductIdentifierSchema,
10
11
  source: z.discriminatedUnion("type", [
@@ -4,7 +4,8 @@ import {
4
4
  } from "../../models/identifiers.model.js";
5
5
  import { BaseMutationSchema } from "../base.mutation.js";
6
6
  import * as z from "zod";
7
- const AnalyticsMutationProductSummaryViewEventSchema = BaseMutationSchema.extend({
7
+ import { AnalyticsBaseMutationSchema } from "./base-event.mutation.js";
8
+ const AnalyticsMutationProductSummaryViewEventSchema = AnalyticsBaseMutationSchema.extend({
8
9
  event: z.literal("product-summary-view"),
9
10
  source: z.discriminatedUnion("type", [
10
11
  z.object({
@@ -1,7 +1,8 @@
1
1
  import * as z from "zod";
2
2
  import { BaseMutationSchema } from "../base.mutation.js";
3
3
  import { OrderSchema } from "../../models/order.model.js";
4
- const AnalyticsMutationPurchaseEventSchema = BaseMutationSchema.extend({
4
+ import { AnalyticsBaseMutationSchema } from "./base-event.mutation.js";
5
+ const AnalyticsMutationPurchaseEventSchema = AnalyticsBaseMutationSchema.extend({
5
6
  event: z.literal("purchase"),
6
7
  order: OrderSchema
7
8
  });
@@ -0,0 +1,11 @@
1
+ import * as z from "zod";
2
+ import { FeatureFlagIdentifierSchema } from "../models/identifiers.model.js";
3
+ import { PersonalizationProfileSchema } from "../models/personalization-profile.model.js";
4
+ import { BaseQuerySchema } from "./base.query.js";
5
+ const FeatureFlagQueryGetFlagsSchema = BaseQuerySchema.extend({
6
+ featureFlagIdentifiers: z.array(FeatureFlagIdentifierSchema).meta({ description: "The identifiers of the feature flags to retrieve." }),
7
+ personalizationProfile: PersonalizationProfileSchema.optional().meta({ description: "The marketing profile to use for evaluating the feature flags." })
8
+ });
9
+ export {
10
+ FeatureFlagQueryGetFlagsSchema
11
+ };
@@ -20,3 +20,5 @@ export * from "./company-registration.query.js";
20
20
  export * from "./employee.query.js";
21
21
  export * from "./employee-invitation.query.js";
22
22
  export * from "./company.query.js";
23
+ export * from "./feature-flag.query.js";
24
+ export * from "./personalization-profile.query.js";
@@ -0,0 +1,10 @@
1
+ import { IdentitySchema } from "../models/identity.model.js";
2
+ import { ProfileSchema } from "../models/profile.model.js";
3
+ import { BaseQuerySchema } from "./base.query.js";
4
+ const PersonalizationProfileQueryGetProfileSchema = BaseQuerySchema.extend({
5
+ identity: IdentitySchema,
6
+ profile: ProfileSchema.optional()
7
+ });
8
+ export {
9
+ PersonalizationProfileQueryGetProfileSchema
10
+ };
@@ -1,9 +1,11 @@
1
1
  import * as z from "zod";
2
2
  import { CategoryIdentifierSchema, ProductIdentifierSchema } from "../models/identifiers.model.js";
3
3
  import { BaseQuerySchema } from "./base.query.js";
4
+ import { PersonalizationProfileSchema } from "../models/personalization-profile.model.js";
4
5
  const ProductRecommendationBaseQuerySchema = BaseQuerySchema.extend({
5
6
  numberOfRecommendations: z.number().min(1).max(12).meta({ description: "The number of recommendations requested. The provider may return fewer than this number, but should not return more." }),
6
- labels: z.array(z.string()).optional().meta({ description: "The customer segments, quirks, chirps or other labels to which the recommendations can optimize themselves to be relevant. This can be used by the provider to personalize the recommendations based on the preferences and behaviors of users in these segments." })
7
+ personalizationProfile: PersonalizationProfileSchema.optional().meta({ description: "The marketing profile to use for personalizing the recommendations. This can be used by the provider to tailor the recommendations based on the preferences and behaviors of users in this marketing profile." }),
8
+ labels: z.array(z.string()).optional().meta({ description: "extra, quirks, chirps or other labels to which the recommendations can optimize themselves to be relevant. This can be used by the provider to personalize the recommendations based on the preferences and behaviors of users in these segments." })
7
9
  });
8
10
  const ProductRecommendationsByCollectionQuerySchema = ProductRecommendationBaseQuerySchema.extend({
9
11
  collectionName: z.string().meta({ description: "The name of the collection for which to get product recommendations. This is to access either manually curated lists, or interface marketing rules engines that define zones by name" }),
@@ -2,8 +2,10 @@ import * as z from "zod";
2
2
  import { CategorySchema } from "../models/category.model.js";
3
3
  import { ProductSearchIdentifierSchema } from "../models/identifiers.model.js";
4
4
  import { BaseQuerySchema } from "./base.query.js";
5
+ import { PersonalizationProfileSchema } from "../models/personalization-profile.model.js";
5
6
  const ProductSearchQueryByTermSchema = BaseQuerySchema.extend({
6
- search: ProductSearchIdentifierSchema
7
+ search: ProductSearchIdentifierSchema,
8
+ personalizationProfile: PersonalizationProfileSchema.optional().meta({ description: "The marketing profile of the user performing the search. This can be used to provide personalized search results based on the user's segments and other attributes defined in their marketing profile." })
7
9
  });
8
10
  const ProductSearchQueryCreateNavigationFilterSchema = z.looseObject({
9
11
  categoryPath: z.array(CategorySchema).meta({ description: "An array representing the breadcrumb path to a category, from root to the specific category." })
@@ -2,17 +2,18 @@ import * as z from "zod";
2
2
  import { WebStoreIdentifierSchema } from "./models/identifiers.model.js";
3
3
  import { CurrencySchema } from "./models/currency.model.js";
4
4
  import { IdentitySchema } from "./models/identity.model.js";
5
+ import { PersonalizationProfileSchema } from "./models/personalization-profile.model.js";
5
6
  const LanguageContextSchema = z.looseObject({
6
7
  locale: z.string().default("en-US").meta({ description: "The locale for the current request, in IETF BCP 47 format (e.g. en-US, fr-FR). This can be used for localization and internationalization purposes." }),
7
8
  currencyCode: CurrencySchema.default(() => CurrencySchema.parse({}))
8
9
  });
9
10
  const IdentityContextSchema = z.looseObject({
10
11
  identity: IdentitySchema,
11
- personalizationKey: z.string(),
12
12
  lastUpdated: z.coerce.date()
13
13
  });
14
14
  const SessionSchema = z.looseObject({
15
- identityContext: IdentityContextSchema
15
+ identityContext: IdentityContextSchema,
16
+ marketingContext: PersonalizationProfileSchema.default(() => PersonalizationProfileSchema.parse({}))
16
17
  });
17
18
  const TaxJurisdictionSchema = z.object({
18
19
  countryCode: z.string().default("US"),
@@ -25,7 +26,7 @@ const RequestContextSchema = z.looseObject({
25
26
  languageContext: LanguageContextSchema.default(() => LanguageContextSchema.parse({})).describe("ReadOnly. The language and locale context for the current request."),
26
27
  storeIdentifier: WebStoreIdentifierSchema.default(() => WebStoreIdentifierSchema.parse({})).describe("ReadOnly. The identifier of the current web store making the request."),
27
28
  taxJurisdiction: TaxJurisdictionSchema.default(() => TaxJurisdictionSchema.parse({})).describe("ReadOnly. The tax jurisdiction for the current request, typically derived from the store location or carts billing address"),
28
- companyIdentifier: z.string().optional().meta({ description: "The company associated with the request, if applicable. This can be used to segment requests and apply different logic or rules based on the business unit." }),
29
+ // companyIdentifier: z.string().optional().meta({ description: 'The company associated with the request, if applicable. This can be used to segment requests and apply different logic or rules based on the business unit.' }),
29
30
  correlationId: z.string().default("").meta({ description: "A unique identifier for the request, can be used for tracing and logging purposes." }),
30
31
  isBot: z.boolean().default(false).meta({ description: "Indicates if the request is made by a bot or crawler." }),
31
32
  clientIp: z.string().default("").meta({ description: "The IP address of the client making the request, if available. Mostly for logging purposes" }),
@@ -0,0 +1,9 @@
1
+ import type { FeatureFlag } from "../schemas/models/feature-flags.model.js";
2
+ import type { FeatureFlagQueryGetFlags } from "../schemas/queries/feature-flag.query.js";
3
+ import type { Result } from "../schemas/result.js";
4
+ import { BaseCapability } from "./base.capability.js";
5
+ export declare abstract class FeatureFlagCapability<TFeatureFlag extends FeatureFlag = FeatureFlag> extends BaseCapability {
6
+ protected getResourceName(): string;
7
+ abstract getFlags(payload: FeatureFlagQueryGetFlags): Promise<Result<TFeatureFlag[]>>;
8
+ isEnabled(flags: TFeatureFlag[], key: string, variant?: string): boolean;
9
+ }
@@ -3,20 +3,22 @@ export * from './base.capability.js';
3
3
  export * from './cart.capability.js';
4
4
  export * from './category.capability.js';
5
5
  export * from './checkout.capability.js';
6
+ export * from './company-registration.capability.js';
7
+ export * from './company.capability.js';
8
+ export * from './employee-invitation.capability.js';
9
+ export * from './employee.capability.js';
10
+ export * from './feature-flag.capability.js';
6
11
  export * from './identity.capability.js';
7
12
  export * from './inventory.capability.js';
13
+ export * from './personalization-profile.capability.js';
14
+ export * from './order-search.capability.js';
15
+ export * from './order.capability.js';
8
16
  export * from './price.capability.js';
9
- export * from './product.capability.js';
10
- export * from './profile.capability.js';
11
- export * from './product-search.capability.js';
12
- export * from './product-recommendations.capability.js';
13
17
  export * from './product-associations.capability.js';
14
- export * from './product-reviews.capability.js';
15
18
  export * from './product-list.capability.js';
19
+ export * from './product-recommendations.capability.js';
20
+ export * from './product-reviews.capability.js';
21
+ export * from './product-search.capability.js';
22
+ export * from './product.capability.js';
23
+ export * from './profile.capability.js';
16
24
  export * from './store.capability.js';
17
- export * from './order.capability.js';
18
- export * from './order-search.capability.js';
19
- export * from './company-registration.capability.js';
20
- export * from './employee.capability.js';
21
- export * from './employee-invitation.capability.js';
22
- export * from './company.capability.js';
@@ -0,0 +1,9 @@
1
+ import type { PersonalizationProfile } from "../schemas/models/personalization-profile.model.js";
2
+ import type { PersonalizationProfileQueryGetProfile } from "../schemas/queries/personalization-profile.query.js";
3
+ import type { NotFoundError } from "../schemas/errors/not-found.error.js";
4
+ import type { Result } from "../schemas/result.js";
5
+ import { BaseCapability } from "./base.capability.js";
6
+ export declare abstract class PersonalizationProfileCapability<TPersonalizationProfile extends PersonalizationProfile = PersonalizationProfile> extends BaseCapability {
7
+ protected getResourceName(): string;
8
+ abstract getPersonalizationProfile(payload: PersonalizationProfileQueryGetProfile): Promise<Result<TPersonalizationProfile, NotFoundError>>;
9
+ }
@@ -12,6 +12,8 @@ import type { ProductRecommendationsCapability } from "../capabilities/product-r
12
12
  import type { ProductAssociationsCapability } from "../capabilities/product-associations.capability.js";
13
13
  import type { ProductReviewsCapability } from "../capabilities/product-reviews.capability.js";
14
14
  import type { EmployeeInvitationCapability } from "../capabilities/employee-invitation.capability.js";
15
+ import type { FeatureFlagCapability } from "../capabilities/feature-flag.capability.js";
16
+ import type { PersonalizationProfileCapability } from "../capabilities/personalization-profile.capability.js";
15
17
  export interface Client {
16
18
  product: ProductCapability;
17
19
  productSearch: ProductSearchCapability;
@@ -35,4 +37,6 @@ export interface Client {
35
37
  employee: EmployeeCapability;
36
38
  company: CompanyCapability;
37
39
  employeeInvitation: EmployeeInvitationCapability;
40
+ featureFlag: FeatureFlagCapability;
41
+ personalizationProfile: PersonalizationProfileCapability;
38
42
  }
@@ -0,0 +1,12 @@
1
+ import type * as z from 'zod';
2
+ import type { FeatureFlagSchema } from '../schemas/models/feature-flags.model.js';
3
+ import type { RequestContext } from '../schemas/session.schema.js';
4
+ export type AnyFeatureFlagSchema = z.ZodType<z.output<typeof FeatureFlagSchema>>;
5
+ export interface FeatureFlagFactory<TFeatureFlagSchema extends AnyFeatureFlagSchema = AnyFeatureFlagSchema> {
6
+ featureFlagSchema: TFeatureFlagSchema;
7
+ parseFeatureFlag(context: RequestContext, data: unknown): z.output<TFeatureFlagSchema>;
8
+ }
9
+ export type FeatureFlagFactoryOutput<TFactory extends FeatureFlagFactory> = ReturnType<TFactory['parseFeatureFlag']>;
10
+ export type FeatureFlagFactoryWithOutput<TFactory extends FeatureFlagFactory> = Omit<TFactory, 'parseFeatureFlag'> & {
11
+ parseFeatureFlag(context: RequestContext, data: unknown): FeatureFlagFactoryOutput<TFactory>;
12
+ };
@@ -5,8 +5,10 @@ export * from './company-registration.factory.js';
5
5
  export * from './company.factory.js';
6
6
  export * from './employee-invitation.factory.js';
7
7
  export * from './employee.factory.js';
8
+ export * from './feature-flag.factory.js';
8
9
  export * from './identity.factory.js';
9
10
  export * from './inventory.factory.js';
11
+ export * from './personalization-profile.factory.js';
10
12
  export * from './order.factory.js';
11
13
  export * from './order-search.factory.js';
12
14
  export * from './price.factory.js';
@@ -0,0 +1,12 @@
1
+ import type * as z from 'zod';
2
+ import type { PersonalizationProfileSchema } from '../schemas/models/personalization-profile.model.js';
3
+ import type { RequestContext } from '../schemas/session.schema.js';
4
+ export type AnyPersonalizationProfileSchema = z.ZodType<z.output<typeof PersonalizationProfileSchema>>;
5
+ export interface PersonalizationProfileFactory<TPersonalizationProfileSchema extends AnyPersonalizationProfileSchema = AnyPersonalizationProfileSchema> {
6
+ personalizationProfileSchema: TPersonalizationProfileSchema;
7
+ parsePersonalizationProfile(context: RequestContext, data: unknown): z.output<TPersonalizationProfileSchema>;
8
+ }
9
+ export type PersonalizationProfileFactoryOutput<TFactory extends PersonalizationProfileFactory> = ReturnType<TFactory['parsePersonalizationProfile']>;
10
+ export type PersonalizationProfileFactoryWithOutput<TFactory extends PersonalizationProfileFactory> = Omit<TFactory, 'parsePersonalizationProfile'> & {
11
+ parsePersonalizationProfile(context: RequestContext, data: unknown): PersonalizationProfileFactoryOutput<TFactory>;
12
+ };
@@ -19,6 +19,8 @@ export declare const CapabilitiesSchema: z.ZodObject<{
19
19
  category: z.ZodBoolean;
20
20
  store: z.ZodBoolean;
21
21
  profile: z.ZodBoolean;
22
+ featureFlag: z.ZodBoolean;
23
+ personalizationProfile: z.ZodBoolean;
22
24
  }, z.core.$loose>;
23
25
  export type Capabilities = InferType<typeof CapabilitiesSchema>;
24
26
  export type ClientFromCapabilities<C extends Partial<Capabilities>> = {
@@ -0,0 +1,43 @@
1
+ import type { InferType } from "../../zod-utils.js";
2
+ import * as z from "zod";
3
+ export declare const BaseFeatureFlagSchema: z.ZodObject<{
4
+ identifier: z.ZodObject<{
5
+ key: z.ZodString;
6
+ }, z.core.$loose>;
7
+ }, z.core.$loose>;
8
+ export declare const BooleanFeatureFlagSchema: z.ZodObject<{
9
+ identifier: z.ZodObject<{
10
+ key: z.ZodString;
11
+ }, z.core.$loose>;
12
+ type: z.ZodLiteral<"boolean">;
13
+ enabled: z.ZodBoolean;
14
+ }, z.core.$loose>;
15
+ export declare const MultivariateFeatureFlagSchema: z.ZodObject<{
16
+ identifier: z.ZodObject<{
17
+ key: z.ZodString;
18
+ }, z.core.$loose>;
19
+ type: z.ZodLiteral<"multivariate">;
20
+ variants: z.ZodArray<z.ZodObject<{
21
+ name: z.ZodString;
22
+ enabled: z.ZodBoolean;
23
+ }, z.core.$strip>>;
24
+ }, z.core.$loose>;
25
+ export declare const FeatureFlagSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
26
+ identifier: z.ZodObject<{
27
+ key: z.ZodString;
28
+ }, z.core.$loose>;
29
+ type: z.ZodLiteral<"boolean">;
30
+ enabled: z.ZodBoolean;
31
+ }, z.core.$loose>, z.ZodObject<{
32
+ identifier: z.ZodObject<{
33
+ key: z.ZodString;
34
+ }, z.core.$loose>;
35
+ type: z.ZodLiteral<"multivariate">;
36
+ variants: z.ZodArray<z.ZodObject<{
37
+ name: z.ZodString;
38
+ enabled: z.ZodBoolean;
39
+ }, z.core.$strip>>;
40
+ }, z.core.$loose>], "type">;
41
+ export type BooleanFeatureFlag = InferType<typeof BooleanFeatureFlagSchema>;
42
+ export type MultivariateFeatureFlag = InferType<typeof MultivariateFeatureFlagSchema>;
43
+ export type FeatureFlag = InferType<typeof FeatureFlagSchema>;
@@ -349,6 +349,12 @@ export declare const CartSearchIdentifierSchema: z.ZodObject<{
349
349
  pageSize: z.ZodDefault<z.ZodNumber>;
350
350
  }, z.core.$loose>;
351
351
  }, z.core.$loose>;
352
+ export declare const PersonalizationProfileIdentifierSchema: z.ZodObject<{
353
+ key: z.ZodString;
354
+ }, z.core.$loose>;
355
+ export declare const FeatureFlagIdentifierSchema: z.ZodObject<{
356
+ key: z.ZodString;
357
+ }, z.core.$loose>;
352
358
  export type CartSearchIdentifier = InferType<typeof CartSearchIdentifierSchema>;
353
359
  export type OrderSearchIdentifier = InferType<typeof OrderSearchIdentifierSchema>;
354
360
  export type ProductIdentifier = InferType<typeof ProductIdentifierSchema>;
@@ -398,4 +404,6 @@ export type EmployeeSearchIdentifier = InferType<typeof EmployeeSearchIdentifier
398
404
  export type EmployeeInvitationIdentifier = InferType<typeof EmployeeInvitationIdentifierSchema>;
399
405
  export type EmployeeInvitationSearchIdentifier = InferType<typeof EmployeeInvitationSearchIdentifierSchema>;
400
406
  export type CompanySearchIdentifier = InferType<typeof CompanySearchIdentifierSchema>;
401
- export type IdentifierType = ProductIdentifier | ProductVariantIdentifier | SearchIdentifier | FacetIdentifier | FacetValueIdentifier | CartIdentifier | CartItemIdentifier | PriceIdentifier | CategoryIdentifier | WebStoreIdentifier | InventoryIdentifier | ProductRecommendationIdentifier | FulfillmentCenterIdentifier | IdentityIdentifier | ShippingMethodIdentifier | PaymentMethodIdentifier | AddressIdentifier | PaymentInstructionIdentifier | OrderIdentifier | OrderItemIdentifier | CompanyIdentifier | CompanyRegistrationRequestIdentifier | CheckoutIdentifier | CheckoutItemIdentifier | StoreIdentifier | ProductOptionIdentifier | ProductOptionValueIdentifier | PickupPointIdentifier | ProductAttributeIdentifier | ProductAttributeValueIdentifier | ProductRatingIdentifier | ProductReviewIdentifier | ProductAssociationsIdentifier | ProductListIdentifier | ProductListItemIdentifier | ProductListSearchIdentifier | PromotionIdentifier;
407
+ export type PersonalizationProfileIdentifier = InferType<typeof PersonalizationProfileIdentifierSchema>;
408
+ export type FeatureFlagIdentifier = InferType<typeof FeatureFlagIdentifierSchema>;
409
+ export type IdentifierType = ProductIdentifier | ProductVariantIdentifier | SearchIdentifier | FacetIdentifier | FacetValueIdentifier | CartIdentifier | CartItemIdentifier | PriceIdentifier | CategoryIdentifier | WebStoreIdentifier | InventoryIdentifier | ProductRecommendationIdentifier | FulfillmentCenterIdentifier | IdentityIdentifier | ShippingMethodIdentifier | PaymentMethodIdentifier | AddressIdentifier | PaymentInstructionIdentifier | OrderIdentifier | OrderItemIdentifier | PersonalizationProfileIdentifier | CompanyIdentifier | CompanyRegistrationRequestIdentifier | CheckoutIdentifier | CheckoutItemIdentifier | StoreIdentifier | ProductOptionIdentifier | ProductOptionValueIdentifier | PickupPointIdentifier | ProductAttributeIdentifier | ProductAttributeValueIdentifier | ProductRatingIdentifier | ProductReviewIdentifier | ProductAssociationsIdentifier | ProductListIdentifier | ProductListItemIdentifier | ProductListSearchIdentifier | PromotionIdentifier | EmployeeIdentifier | EmployeeInvitationIdentifier | EmployeeSearchIdentifier | EmployeeInvitationSearchIdentifier | FeatureFlagIdentifier | CompanySearchIdentifier | OrderSearchIdentifier | CartSearchIdentifier | CompanyRegistrationRequestIdentifier | PersonalizationProfileIdentifier;
@@ -26,3 +26,5 @@ export * from './company.model.js';
26
26
  export * from './company-registration.model.js';
27
27
  export * from './employee.model.js';
28
28
  export * from './employee-invitation.model.js';
29
+ export * from './feature-flags.model.js';
30
+ export * from './personalization-profile.model.js';
@@ -0,0 +1,10 @@
1
+ import * as z from 'zod';
2
+ import type { InferType } from '../../zod-utils.js';
3
+ export declare const PersonalizationProfileSchema: z.ZodObject<{
4
+ identifier: z.ZodObject<{
5
+ key: z.ZodString;
6
+ }, z.core.$loose>;
7
+ segments: z.ZodDefault<z.ZodArray<z.ZodString>>;
8
+ blurb: z.ZodDefault<z.ZodString>;
9
+ }, z.core.$loose>;
10
+ export type PersonalizationProfile = InferType<typeof PersonalizationProfileSchema>;
@@ -0,0 +1,11 @@
1
+ import type { InferType } from "../../../zod-utils.js";
2
+ export declare const AnalyticsBaseMutationSchema: import("zod").ZodObject<{
3
+ personalizationProfile: import("zod").ZodOptional<import("zod").ZodObject<{
4
+ identifier: import("zod").ZodObject<{
5
+ key: import("zod").ZodString;
6
+ }, import("zod/v4/core").$loose>;
7
+ segments: import("zod").ZodDefault<import("zod").ZodArray<import("zod").ZodString>>;
8
+ blurb: import("zod").ZodDefault<import("zod").ZodString>;
9
+ }, import("zod/v4/core").$loose>>;
10
+ }, import("zod/v4/core").$loose>;
11
+ export type AnalyticsBaseMutation = InferType<typeof AnalyticsBaseMutationSchema>;
@@ -1,6 +1,13 @@
1
1
  import * as z from 'zod';
2
2
  import type { InferType } from '../../../zod-utils.js';
3
3
  export declare const AnalyticsMutationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
4
+ personalizationProfile: z.ZodOptional<z.ZodObject<{
5
+ identifier: z.ZodObject<{
6
+ key: z.ZodString;
7
+ }, z.core.$loose>;
8
+ segments: z.ZodDefault<z.ZodArray<z.ZodString>>;
9
+ blurb: z.ZodDefault<z.ZodString>;
10
+ }, z.core.$loose>>;
4
11
  event: z.ZodLiteral<"product-summary-view">;
5
12
  source: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
6
13
  type: z.ZodLiteral<"search">;
@@ -32,6 +39,13 @@ export declare const AnalyticsMutationSchema: z.ZodDiscriminatedUnion<[z.ZodObje
32
39
  key: z.ZodString;
33
40
  }, z.core.$loose>>;
34
41
  }, z.core.$loose>, z.ZodObject<{
42
+ personalizationProfile: z.ZodOptional<z.ZodObject<{
43
+ identifier: z.ZodObject<{
44
+ key: z.ZodString;
45
+ }, z.core.$loose>;
46
+ segments: z.ZodDefault<z.ZodArray<z.ZodString>>;
47
+ blurb: z.ZodDefault<z.ZodString>;
48
+ }, z.core.$loose>>;
35
49
  event: z.ZodLiteral<"product-summary-click">;
36
50
  product: z.ZodObject<{
37
51
  key: z.ZodString;
@@ -64,11 +78,25 @@ export declare const AnalyticsMutationSchema: z.ZodDiscriminatedUnion<[z.ZodObje
64
78
  }, z.core.$strip>], "type">>;
65
79
  position: z.ZodNumber;
66
80
  }, z.core.$loose>, z.ZodObject<{
81
+ personalizationProfile: z.ZodOptional<z.ZodObject<{
82
+ identifier: z.ZodObject<{
83
+ key: z.ZodString;
84
+ }, z.core.$loose>;
85
+ segments: z.ZodDefault<z.ZodArray<z.ZodString>>;
86
+ blurb: z.ZodDefault<z.ZodString>;
87
+ }, z.core.$loose>>;
67
88
  event: z.ZodLiteral<"product-details-view">;
68
89
  product: z.ZodObject<{
69
90
  key: z.ZodString;
70
91
  }, z.core.$loose>;
71
92
  }, z.core.$loose>, z.ZodObject<{
93
+ personalizationProfile: z.ZodOptional<z.ZodObject<{
94
+ identifier: z.ZodObject<{
95
+ key: z.ZodString;
96
+ }, z.core.$loose>;
97
+ segments: z.ZodDefault<z.ZodArray<z.ZodString>>;
98
+ blurb: z.ZodDefault<z.ZodString>;
99
+ }, z.core.$loose>>;
72
100
  event: z.ZodLiteral<"product-cart-add">;
73
101
  source: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
74
102
  type: z.ZodLiteral<"search">;
@@ -100,6 +128,13 @@ export declare const AnalyticsMutationSchema: z.ZodDiscriminatedUnion<[z.ZodObje
100
128
  key: z.ZodString;
101
129
  }, z.core.$loose>;
102
130
  }, z.core.$loose>, z.ZodObject<{
131
+ personalizationProfile: z.ZodOptional<z.ZodObject<{
132
+ identifier: z.ZodObject<{
133
+ key: z.ZodString;
134
+ }, z.core.$loose>;
135
+ segments: z.ZodDefault<z.ZodArray<z.ZodString>>;
136
+ blurb: z.ZodDefault<z.ZodString>;
137
+ }, z.core.$loose>>;
103
138
  event: z.ZodLiteral<"purchase">;
104
139
  order: z.ZodObject<{
105
140
  identifier: z.ZodObject<{
@@ -2451,3 +2486,4 @@ export * from './product-details-view.mutation.js';
2451
2486
  export * from './product-summary-click.mutation.js';
2452
2487
  export * from './product-summary-view.mutation.js';
2453
2488
  export * from './purchase.mutation.js';
2489
+ export * from './base-event.mutation.js';
@@ -1,6 +1,13 @@
1
1
  import * as z from 'zod';
2
2
  import type { InferType } from '../../../zod-utils.js';
3
3
  export declare const AnalyticsMutationProductAddToCartEventSchema: z.ZodObject<{
4
+ personalizationProfile: z.ZodOptional<z.ZodObject<{
5
+ identifier: z.ZodObject<{
6
+ key: z.ZodString;
7
+ }, z.core.$loose>;
8
+ segments: z.ZodDefault<z.ZodArray<z.ZodString>>;
9
+ blurb: z.ZodDefault<z.ZodString>;
10
+ }, z.core.$loose>>;
4
11
  event: z.ZodLiteral<"product-cart-add">;
5
12
  source: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
6
13
  type: z.ZodLiteral<"search">;
@@ -1,6 +1,13 @@
1
1
  import * as z from 'zod';
2
2
  import type { InferType } from '../../../zod-utils.js';
3
3
  export declare const AnalyticsMutationProductDetailsViewEventSchema: z.ZodObject<{
4
+ personalizationProfile: z.ZodOptional<z.ZodObject<{
5
+ identifier: z.ZodObject<{
6
+ key: z.ZodString;
7
+ }, z.core.$loose>;
8
+ segments: z.ZodDefault<z.ZodArray<z.ZodString>>;
9
+ blurb: z.ZodDefault<z.ZodString>;
10
+ }, z.core.$loose>>;
4
11
  event: z.ZodLiteral<"product-details-view">;
5
12
  product: z.ZodObject<{
6
13
  key: z.ZodString;
@@ -1,6 +1,13 @@
1
1
  import type { InferType } from '../../../zod-utils.js';
2
2
  import * as z from 'zod';
3
3
  export declare const AnalyticsMutationProductSummaryClickEventSchema: z.ZodObject<{
4
+ personalizationProfile: z.ZodOptional<z.ZodObject<{
5
+ identifier: z.ZodObject<{
6
+ key: z.ZodString;
7
+ }, z.core.$loose>;
8
+ segments: z.ZodDefault<z.ZodArray<z.ZodString>>;
9
+ blurb: z.ZodDefault<z.ZodString>;
10
+ }, z.core.$loose>>;
4
11
  event: z.ZodLiteral<"product-summary-click">;
5
12
  product: z.ZodObject<{
6
13
  key: z.ZodString;
@@ -1,6 +1,13 @@
1
1
  import type { InferType } from '../../../zod-utils.js';
2
2
  import * as z from 'zod';
3
3
  export declare const AnalyticsMutationProductSummaryViewEventSchema: z.ZodObject<{
4
+ personalizationProfile: z.ZodOptional<z.ZodObject<{
5
+ identifier: z.ZodObject<{
6
+ key: z.ZodString;
7
+ }, z.core.$loose>;
8
+ segments: z.ZodDefault<z.ZodArray<z.ZodString>>;
9
+ blurb: z.ZodDefault<z.ZodString>;
10
+ }, z.core.$loose>>;
4
11
  event: z.ZodLiteral<"product-summary-view">;
5
12
  source: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
6
13
  type: z.ZodLiteral<"search">;
@@ -1,6 +1,13 @@
1
1
  import * as z from 'zod';
2
2
  import type { InferType } from '../../../zod-utils.js';
3
3
  export declare const AnalyticsMutationPurchaseEventSchema: z.ZodObject<{
4
+ personalizationProfile: z.ZodOptional<z.ZodObject<{
5
+ identifier: z.ZodObject<{
6
+ key: z.ZodString;
7
+ }, z.core.$loose>;
8
+ segments: z.ZodDefault<z.ZodArray<z.ZodString>>;
9
+ blurb: z.ZodDefault<z.ZodString>;
10
+ }, z.core.$loose>>;
4
11
  event: z.ZodLiteral<"purchase">;
5
12
  order: z.ZodObject<{
6
13
  identifier: z.ZodObject<{
@@ -0,0 +1,15 @@
1
+ import * as z from 'zod';
2
+ import type { InferType } from "../../zod-utils.js";
3
+ export declare const FeatureFlagQueryGetFlagsSchema: z.ZodObject<{
4
+ featureFlagIdentifiers: z.ZodArray<z.ZodObject<{
5
+ key: z.ZodString;
6
+ }, z.core.$loose>>;
7
+ personalizationProfile: z.ZodOptional<z.ZodObject<{
8
+ identifier: z.ZodObject<{
9
+ key: z.ZodString;
10
+ }, z.core.$loose>;
11
+ segments: z.ZodDefault<z.ZodArray<z.ZodString>>;
12
+ blurb: z.ZodDefault<z.ZodString>;
13
+ }, z.core.$loose>>;
14
+ }, z.core.$loose>;
15
+ export type FeatureFlagQueryGetFlags = InferType<typeof FeatureFlagQueryGetFlagsSchema>;
@@ -20,3 +20,5 @@ export * from './company-registration.query.js';
20
20
  export * from './employee.query.js';
21
21
  export * from './employee-invitation.query.js';
22
22
  export * from './company.query.js';
23
+ export * from './feature-flag.query.js';
24
+ export * from './personalization-profile.query.js';
@@ -0,0 +1,67 @@
1
+ import type { InferType } from "../../zod-utils.js";
2
+ export declare const PersonalizationProfileQueryGetProfileSchema: import("zod").ZodObject<{
3
+ identity: import("zod").ZodDiscriminatedUnion<[import("zod").ZodObject<{
4
+ type: import("zod").ZodLiteral<"Anonymous">;
5
+ }, import("zod/v4/core").$loose>, import("zod").ZodObject<{
6
+ id: import("zod").ZodObject<{
7
+ userId: import("zod").ZodString;
8
+ }, import("zod/v4/core").$loose>;
9
+ type: import("zod").ZodLiteral<"Guest">;
10
+ }, import("zod/v4/core").$loose>, import("zod").ZodObject<{
11
+ id: import("zod").ZodObject<{
12
+ userId: import("zod").ZodString;
13
+ }, import("zod/v4/core").$loose>;
14
+ type: import("zod").ZodLiteral<"Registered">;
15
+ }, import("zod/v4/core").$loose>], "type">;
16
+ profile: import("zod").ZodOptional<import("zod").ZodObject<{
17
+ identifier: import("zod").ZodObject<{
18
+ userId: import("zod").ZodString;
19
+ }, import("zod/v4/core").$loose>;
20
+ email: import("zod").ZodEmail;
21
+ phone: import("zod").ZodString;
22
+ emailVerified: import("zod").ZodBoolean;
23
+ phoneVerified: import("zod").ZodBoolean;
24
+ createdAt: import("zod").ZodString;
25
+ updatedAt: import("zod").ZodString;
26
+ shippingAddress: import("zod").ZodOptional<import("zod").ZodObject<{
27
+ identifier: import("zod").ZodDefault<import("zod").ZodObject<{
28
+ nickName: import("zod").ZodString;
29
+ }, import("zod/v4/core").$loose>>;
30
+ firstName: import("zod").ZodString;
31
+ lastName: import("zod").ZodString;
32
+ streetAddress: import("zod").ZodString;
33
+ streetNumber: import("zod").ZodString;
34
+ city: import("zod").ZodString;
35
+ region: import("zod").ZodString;
36
+ postalCode: import("zod").ZodString;
37
+ countryCode: import("zod").ZodString;
38
+ }, import("zod/v4/core").$loose>>;
39
+ billingAddress: import("zod").ZodOptional<import("zod").ZodObject<{
40
+ identifier: import("zod").ZodDefault<import("zod").ZodObject<{
41
+ nickName: import("zod").ZodString;
42
+ }, import("zod/v4/core").$loose>>;
43
+ firstName: import("zod").ZodString;
44
+ lastName: import("zod").ZodString;
45
+ streetAddress: import("zod").ZodString;
46
+ streetNumber: import("zod").ZodString;
47
+ city: import("zod").ZodString;
48
+ region: import("zod").ZodString;
49
+ postalCode: import("zod").ZodString;
50
+ countryCode: import("zod").ZodString;
51
+ }, import("zod/v4/core").$loose>>;
52
+ alternateShippingAddresses: import("zod").ZodDefault<import("zod").ZodArray<import("zod").ZodObject<{
53
+ identifier: import("zod").ZodDefault<import("zod").ZodObject<{
54
+ nickName: import("zod").ZodString;
55
+ }, import("zod/v4/core").$loose>>;
56
+ firstName: import("zod").ZodString;
57
+ lastName: import("zod").ZodString;
58
+ streetAddress: import("zod").ZodString;
59
+ streetNumber: import("zod").ZodString;
60
+ city: import("zod").ZodString;
61
+ region: import("zod").ZodString;
62
+ postalCode: import("zod").ZodString;
63
+ countryCode: import("zod").ZodString;
64
+ }, import("zod/v4/core").$loose>>>;
65
+ }, import("zod/v4/core").$loose>>;
66
+ }, import("zod/v4/core").$loose>;
67
+ export type PersonalizationProfileQueryGetProfile = InferType<typeof PersonalizationProfileQueryGetProfileSchema>;
@@ -2,10 +2,24 @@ import * as z from "zod";
2
2
  import type { InferType } from "../../zod-utils.js";
3
3
  export declare const ProductRecommendationBaseQuerySchema: z.ZodObject<{
4
4
  numberOfRecommendations: z.ZodNumber;
5
+ personalizationProfile: z.ZodOptional<z.ZodObject<{
6
+ identifier: z.ZodObject<{
7
+ key: z.ZodString;
8
+ }, z.core.$loose>;
9
+ segments: z.ZodDefault<z.ZodArray<z.ZodString>>;
10
+ blurb: z.ZodDefault<z.ZodString>;
11
+ }, z.core.$loose>>;
5
12
  labels: z.ZodOptional<z.ZodArray<z.ZodString>>;
6
13
  }, z.core.$loose>;
7
14
  export declare const ProductRecommendationsByCollectionQuerySchema: z.ZodObject<{
8
15
  numberOfRecommendations: z.ZodNumber;
16
+ personalizationProfile: z.ZodOptional<z.ZodObject<{
17
+ identifier: z.ZodObject<{
18
+ key: z.ZodString;
19
+ }, z.core.$loose>;
20
+ segments: z.ZodDefault<z.ZodArray<z.ZodString>>;
21
+ blurb: z.ZodDefault<z.ZodString>;
22
+ }, z.core.$loose>>;
9
23
  labels: z.ZodOptional<z.ZodArray<z.ZodString>>;
10
24
  collectionName: z.ZodString;
11
25
  sourceProduct: z.ZodOptional<z.ZodArray<z.ZodObject<{
@@ -17,6 +31,13 @@ export declare const ProductRecommendationsByCollectionQuerySchema: z.ZodObject<
17
31
  }, z.core.$loose>;
18
32
  export declare const ProductRecommendationProductBasedBaseQuerySchema: z.ZodObject<{
19
33
  numberOfRecommendations: z.ZodNumber;
34
+ personalizationProfile: z.ZodOptional<z.ZodObject<{
35
+ identifier: z.ZodObject<{
36
+ key: z.ZodString;
37
+ }, z.core.$loose>;
38
+ segments: z.ZodDefault<z.ZodArray<z.ZodString>>;
39
+ blurb: z.ZodDefault<z.ZodString>;
40
+ }, z.core.$loose>>;
20
41
  labels: z.ZodOptional<z.ZodArray<z.ZodString>>;
21
42
  sourceProduct: z.ZodObject<{
22
43
  key: z.ZodString;
@@ -24,6 +45,13 @@ export declare const ProductRecommendationProductBasedBaseQuerySchema: z.ZodObje
24
45
  }, z.core.$loose>;
25
46
  export declare const ProductRecommendationAlgorithmFrequentlyBoughtTogetherQuerySchema: z.ZodObject<{
26
47
  numberOfRecommendations: z.ZodNumber;
48
+ personalizationProfile: z.ZodOptional<z.ZodObject<{
49
+ identifier: z.ZodObject<{
50
+ key: z.ZodString;
51
+ }, z.core.$loose>;
52
+ segments: z.ZodDefault<z.ZodArray<z.ZodString>>;
53
+ blurb: z.ZodDefault<z.ZodString>;
54
+ }, z.core.$loose>>;
27
55
  labels: z.ZodOptional<z.ZodArray<z.ZodString>>;
28
56
  sourceProduct: z.ZodObject<{
29
57
  key: z.ZodString;
@@ -32,6 +60,13 @@ export declare const ProductRecommendationAlgorithmFrequentlyBoughtTogetherQuery
32
60
  }, z.core.$loose>;
33
61
  export declare const ProductRecommendationAlgorithmSimilarProductsQuerySchema: z.ZodObject<{
34
62
  numberOfRecommendations: z.ZodNumber;
63
+ personalizationProfile: z.ZodOptional<z.ZodObject<{
64
+ identifier: z.ZodObject<{
65
+ key: z.ZodString;
66
+ }, z.core.$loose>;
67
+ segments: z.ZodDefault<z.ZodArray<z.ZodString>>;
68
+ blurb: z.ZodDefault<z.ZodString>;
69
+ }, z.core.$loose>>;
35
70
  labels: z.ZodOptional<z.ZodArray<z.ZodString>>;
36
71
  sourceProduct: z.ZodObject<{
37
72
  key: z.ZodString;
@@ -40,6 +75,13 @@ export declare const ProductRecommendationAlgorithmSimilarProductsQuerySchema: z
40
75
  }, z.core.$loose>;
41
76
  export declare const ProductRecommendationAlgorithmRelatedProductsQuerySchema: z.ZodObject<{
42
77
  numberOfRecommendations: z.ZodNumber;
78
+ personalizationProfile: z.ZodOptional<z.ZodObject<{
79
+ identifier: z.ZodObject<{
80
+ key: z.ZodString;
81
+ }, z.core.$loose>;
82
+ segments: z.ZodDefault<z.ZodArray<z.ZodString>>;
83
+ blurb: z.ZodDefault<z.ZodString>;
84
+ }, z.core.$loose>>;
43
85
  labels: z.ZodOptional<z.ZodArray<z.ZodString>>;
44
86
  sourceProduct: z.ZodObject<{
45
87
  key: z.ZodString;
@@ -48,6 +90,13 @@ export declare const ProductRecommendationAlgorithmRelatedProductsQuerySchema: z
48
90
  }, z.core.$loose>;
49
91
  export declare const ProductRecommendationAlgorithmTrendingInCategoryQuerySchema: z.ZodObject<{
50
92
  numberOfRecommendations: z.ZodNumber;
93
+ personalizationProfile: z.ZodOptional<z.ZodObject<{
94
+ identifier: z.ZodObject<{
95
+ key: z.ZodString;
96
+ }, z.core.$loose>;
97
+ segments: z.ZodDefault<z.ZodArray<z.ZodString>>;
98
+ blurb: z.ZodDefault<z.ZodString>;
99
+ }, z.core.$loose>>;
51
100
  labels: z.ZodOptional<z.ZodArray<z.ZodString>>;
52
101
  algorithm: z.ZodLiteral<"trendingInCategory">;
53
102
  sourceCategory: z.ZodObject<{
@@ -56,16 +105,37 @@ export declare const ProductRecommendationAlgorithmTrendingInCategoryQuerySchema
56
105
  }, z.core.$loose>;
57
106
  export declare const ProductRecommendationAlgorithmPopuplarProductsQuerySchema: z.ZodObject<{
58
107
  numberOfRecommendations: z.ZodNumber;
108
+ personalizationProfile: z.ZodOptional<z.ZodObject<{
109
+ identifier: z.ZodObject<{
110
+ key: z.ZodString;
111
+ }, z.core.$loose>;
112
+ segments: z.ZodDefault<z.ZodArray<z.ZodString>>;
113
+ blurb: z.ZodDefault<z.ZodString>;
114
+ }, z.core.$loose>>;
59
115
  labels: z.ZodOptional<z.ZodArray<z.ZodString>>;
60
116
  algorithm: z.ZodLiteral<"popular">;
61
117
  }, z.core.$loose>;
62
118
  export declare const ProductRecommendationAlgorithmTopPicksProductsQuerySchema: z.ZodObject<{
63
119
  numberOfRecommendations: z.ZodNumber;
120
+ personalizationProfile: z.ZodOptional<z.ZodObject<{
121
+ identifier: z.ZodObject<{
122
+ key: z.ZodString;
123
+ }, z.core.$loose>;
124
+ segments: z.ZodDefault<z.ZodArray<z.ZodString>>;
125
+ blurb: z.ZodDefault<z.ZodString>;
126
+ }, z.core.$loose>>;
64
127
  labels: z.ZodOptional<z.ZodArray<z.ZodString>>;
65
128
  algorithm: z.ZodLiteral<"topPicks">;
66
129
  }, z.core.$loose>;
67
130
  export declare const ProductRecommendationAlgorithmAlsoViewedProductsQuerySchema: z.ZodObject<{
68
131
  numberOfRecommendations: z.ZodNumber;
132
+ personalizationProfile: z.ZodOptional<z.ZodObject<{
133
+ identifier: z.ZodObject<{
134
+ key: z.ZodString;
135
+ }, z.core.$loose>;
136
+ segments: z.ZodDefault<z.ZodArray<z.ZodString>>;
137
+ blurb: z.ZodDefault<z.ZodString>;
138
+ }, z.core.$loose>>;
69
139
  labels: z.ZodOptional<z.ZodArray<z.ZodString>>;
70
140
  sourceProduct: z.ZodObject<{
71
141
  key: z.ZodString;
@@ -74,6 +144,13 @@ export declare const ProductRecommendationAlgorithmAlsoViewedProductsQuerySchema
74
144
  }, z.core.$loose>;
75
145
  export declare const ProductRecommendationsQuerySchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
76
146
  numberOfRecommendations: z.ZodNumber;
147
+ personalizationProfile: z.ZodOptional<z.ZodObject<{
148
+ identifier: z.ZodObject<{
149
+ key: z.ZodString;
150
+ }, z.core.$loose>;
151
+ segments: z.ZodDefault<z.ZodArray<z.ZodString>>;
152
+ blurb: z.ZodDefault<z.ZodString>;
153
+ }, z.core.$loose>>;
77
154
  labels: z.ZodOptional<z.ZodArray<z.ZodString>>;
78
155
  sourceProduct: z.ZodObject<{
79
156
  key: z.ZodString;
@@ -81,6 +158,13 @@ export declare const ProductRecommendationsQuerySchema: z.ZodDiscriminatedUnion<
81
158
  algorithm: z.ZodLiteral<"frequentlyBoughtTogether">;
82
159
  }, z.core.$loose>, z.ZodObject<{
83
160
  numberOfRecommendations: z.ZodNumber;
161
+ personalizationProfile: z.ZodOptional<z.ZodObject<{
162
+ identifier: z.ZodObject<{
163
+ key: z.ZodString;
164
+ }, z.core.$loose>;
165
+ segments: z.ZodDefault<z.ZodArray<z.ZodString>>;
166
+ blurb: z.ZodDefault<z.ZodString>;
167
+ }, z.core.$loose>>;
84
168
  labels: z.ZodOptional<z.ZodArray<z.ZodString>>;
85
169
  algorithm: z.ZodLiteral<"trendingInCategory">;
86
170
  sourceCategory: z.ZodObject<{
@@ -88,6 +172,13 @@ export declare const ProductRecommendationsQuerySchema: z.ZodDiscriminatedUnion<
88
172
  }, z.core.$loose>;
89
173
  }, z.core.$loose>, z.ZodObject<{
90
174
  numberOfRecommendations: z.ZodNumber;
175
+ personalizationProfile: z.ZodOptional<z.ZodObject<{
176
+ identifier: z.ZodObject<{
177
+ key: z.ZodString;
178
+ }, z.core.$loose>;
179
+ segments: z.ZodDefault<z.ZodArray<z.ZodString>>;
180
+ blurb: z.ZodDefault<z.ZodString>;
181
+ }, z.core.$loose>>;
91
182
  labels: z.ZodOptional<z.ZodArray<z.ZodString>>;
92
183
  sourceProduct: z.ZodObject<{
93
184
  key: z.ZodString;
@@ -95,6 +186,13 @@ export declare const ProductRecommendationsQuerySchema: z.ZodDiscriminatedUnion<
95
186
  algorithm: z.ZodLiteral<"similar">;
96
187
  }, z.core.$loose>, z.ZodObject<{
97
188
  numberOfRecommendations: z.ZodNumber;
189
+ personalizationProfile: z.ZodOptional<z.ZodObject<{
190
+ identifier: z.ZodObject<{
191
+ key: z.ZodString;
192
+ }, z.core.$loose>;
193
+ segments: z.ZodDefault<z.ZodArray<z.ZodString>>;
194
+ blurb: z.ZodDefault<z.ZodString>;
195
+ }, z.core.$loose>>;
98
196
  labels: z.ZodOptional<z.ZodArray<z.ZodString>>;
99
197
  sourceProduct: z.ZodObject<{
100
198
  key: z.ZodString;
@@ -102,14 +200,35 @@ export declare const ProductRecommendationsQuerySchema: z.ZodDiscriminatedUnion<
102
200
  algorithm: z.ZodLiteral<"related">;
103
201
  }, z.core.$loose>, z.ZodObject<{
104
202
  numberOfRecommendations: z.ZodNumber;
203
+ personalizationProfile: z.ZodOptional<z.ZodObject<{
204
+ identifier: z.ZodObject<{
205
+ key: z.ZodString;
206
+ }, z.core.$loose>;
207
+ segments: z.ZodDefault<z.ZodArray<z.ZodString>>;
208
+ blurb: z.ZodDefault<z.ZodString>;
209
+ }, z.core.$loose>>;
105
210
  labels: z.ZodOptional<z.ZodArray<z.ZodString>>;
106
211
  algorithm: z.ZodLiteral<"popular">;
107
212
  }, z.core.$loose>, z.ZodObject<{
108
213
  numberOfRecommendations: z.ZodNumber;
214
+ personalizationProfile: z.ZodOptional<z.ZodObject<{
215
+ identifier: z.ZodObject<{
216
+ key: z.ZodString;
217
+ }, z.core.$loose>;
218
+ segments: z.ZodDefault<z.ZodArray<z.ZodString>>;
219
+ blurb: z.ZodDefault<z.ZodString>;
220
+ }, z.core.$loose>>;
109
221
  labels: z.ZodOptional<z.ZodArray<z.ZodString>>;
110
222
  algorithm: z.ZodLiteral<"topPicks">;
111
223
  }, z.core.$loose>, z.ZodObject<{
112
224
  numberOfRecommendations: z.ZodNumber;
225
+ personalizationProfile: z.ZodOptional<z.ZodObject<{
226
+ identifier: z.ZodObject<{
227
+ key: z.ZodString;
228
+ }, z.core.$loose>;
229
+ segments: z.ZodDefault<z.ZodArray<z.ZodString>>;
230
+ blurb: z.ZodDefault<z.ZodString>;
231
+ }, z.core.$loose>>;
113
232
  labels: z.ZodOptional<z.ZodArray<z.ZodString>>;
114
233
  sourceProduct: z.ZodObject<{
115
234
  key: z.ZodString;
@@ -125,3 +244,4 @@ export type ProductRecommendationAlgorithmRelatedProductsQuery = InferType<typeo
125
244
  export type ProductRecommendationAlgorithmSimilarProductsQuery = InferType<typeof ProductRecommendationAlgorithmSimilarProductsQuerySchema>;
126
245
  export type ProductRecommendationAlgorithmFrequentlyBoughtTogetherQuery = InferType<typeof ProductRecommendationAlgorithmFrequentlyBoughtTogetherQuerySchema>;
127
246
  export type ProductRecommendationAlgorithmAlsoViewedProductsQuery = InferType<typeof ProductRecommendationAlgorithmAlsoViewedProductsQuerySchema>;
247
+ export type ProductRecommendationBaseQuery = InferType<typeof ProductRecommendationBaseQuerySchema>;
@@ -24,6 +24,13 @@ export declare const ProductSearchQueryByTermSchema: z.ZodObject<{
24
24
  taxIdentifier: z.ZodString;
25
25
  }, z.core.$loose>>;
26
26
  }, z.core.$loose>;
27
+ personalizationProfile: z.ZodOptional<z.ZodObject<{
28
+ identifier: z.ZodObject<{
29
+ key: z.ZodString;
30
+ }, z.core.$loose>;
31
+ segments: z.ZodDefault<z.ZodArray<z.ZodString>>;
32
+ blurb: z.ZodDefault<z.ZodString>;
33
+ }, z.core.$loose>>;
27
34
  }, z.core.$loose>;
28
35
  export declare const ProductSearchQueryCreateNavigationFilterSchema: z.ZodObject<{
29
36
  categoryPath: z.ZodArray<z.ZodObject<{
@@ -202,7 +202,6 @@ export declare const IdentityContextSchema: z.ZodObject<{
202
202
  }, z.core.$loose>;
203
203
  type: z.ZodLiteral<"Registered">;
204
204
  }, z.core.$loose>], "type">;
205
- personalizationKey: z.ZodString;
206
205
  lastUpdated: z.ZodCoercedDate<unknown>;
207
206
  }, z.core.$loose>;
208
207
  export declare const SessionSchema: z.ZodObject<{
@@ -220,9 +219,15 @@ export declare const SessionSchema: z.ZodObject<{
220
219
  }, z.core.$loose>;
221
220
  type: z.ZodLiteral<"Registered">;
222
221
  }, z.core.$loose>], "type">;
223
- personalizationKey: z.ZodString;
224
222
  lastUpdated: z.ZodCoercedDate<unknown>;
225
223
  }, z.core.$loose>;
224
+ marketingContext: z.ZodDefault<z.ZodObject<{
225
+ identifier: z.ZodObject<{
226
+ key: z.ZodString;
227
+ }, z.core.$loose>;
228
+ segments: z.ZodDefault<z.ZodArray<z.ZodString>>;
229
+ blurb: z.ZodDefault<z.ZodString>;
230
+ }, z.core.$loose>>;
226
231
  }, z.core.$loose>;
227
232
  export declare const TaxJurisdictionSchema: z.ZodObject<{
228
233
  countryCode: z.ZodDefault<z.ZodString>;
@@ -246,9 +251,15 @@ export declare const RequestContextSchema: z.ZodObject<{
246
251
  }, z.core.$loose>;
247
252
  type: z.ZodLiteral<"Registered">;
248
253
  }, z.core.$loose>], "type">;
249
- personalizationKey: z.ZodString;
250
254
  lastUpdated: z.ZodCoercedDate<unknown>;
251
255
  }, z.core.$loose>;
256
+ marketingContext: z.ZodDefault<z.ZodObject<{
257
+ identifier: z.ZodObject<{
258
+ key: z.ZodString;
259
+ }, z.core.$loose>;
260
+ segments: z.ZodDefault<z.ZodArray<z.ZodString>>;
261
+ blurb: z.ZodDefault<z.ZodString>;
262
+ }, z.core.$loose>>;
252
263
  }, z.core.$loose>>;
253
264
  languageContext: z.ZodDefault<z.ZodObject<{
254
265
  locale: z.ZodDefault<z.ZodString>;
@@ -445,7 +456,6 @@ export declare const RequestContextSchema: z.ZodObject<{
445
456
  countyCode: z.ZodDefault<z.ZodString>;
446
457
  cityCode: z.ZodDefault<z.ZodString>;
447
458
  }, z.core.$strip>>;
448
- companyIdentifier: z.ZodOptional<z.ZodString>;
449
459
  correlationId: z.ZodDefault<z.ZodString>;
450
460
  isBot: z.ZodDefault<z.ZodBoolean>;
451
461
  clientIp: z.ZodDefault<z.ZodString>;