@reactionary/source 0.0.30 → 0.0.32

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 (119) hide show
  1. package/CLAUDE.md +11 -0
  2. package/core/package.json +1 -1
  3. package/core/src/cache/cache-evaluation.interface.ts +19 -0
  4. package/core/src/cache/cache.interface.ts +38 -0
  5. package/core/src/cache/noop-cache.ts +42 -0
  6. package/core/src/cache/redis-cache.ts +55 -22
  7. package/core/src/client/client-builder.ts +63 -0
  8. package/core/src/client/client.ts +27 -3
  9. package/core/src/decorators/trpc.decorators.ts +144 -0
  10. package/core/src/index.ts +6 -1
  11. package/core/src/providers/analytics.provider.ts +3 -6
  12. package/core/src/providers/base.provider.ts +13 -63
  13. package/core/src/providers/cart.provider.ts +10 -6
  14. package/core/src/providers/identity.provider.ts +8 -5
  15. package/core/src/providers/inventory.provider.ts +5 -6
  16. package/core/src/providers/price.provider.ts +6 -6
  17. package/core/src/providers/product.provider.ts +6 -6
  18. package/core/src/providers/search.provider.ts +6 -6
  19. package/core/src/schemas/mutations/base.mutation.ts +0 -1
  20. package/core/src/schemas/mutations/cart.mutation.ts +0 -6
  21. package/core/src/schemas/mutations/identity.mutation.ts +0 -5
  22. package/core/src/schemas/mutations/product.mutation.ts +0 -1
  23. package/core/src/schemas/queries/base.query.ts +0 -1
  24. package/core/src/schemas/queries/cart.query.ts +1 -3
  25. package/core/src/schemas/queries/identity.query.ts +1 -3
  26. package/core/src/schemas/queries/inventory.query.ts +0 -1
  27. package/core/src/schemas/queries/price.query.ts +0 -3
  28. package/core/src/schemas/queries/product.query.ts +2 -7
  29. package/core/src/schemas/queries/search.query.ts +0 -3
  30. package/examples/node/package.json +1 -5
  31. package/examples/node/src/basic/basic-node-provider-model-extension.spec.ts +97 -0
  32. package/examples/node/src/basic/basic-node-provider-query-extension.spec.ts +84 -0
  33. package/examples/node/src/basic/basic-node-setup.spec.ts +40 -0
  34. package/otel/src/index.ts +3 -0
  35. package/otel/src/trace-decorator.ts +246 -0
  36. package/package.json +2 -1
  37. package/providers/algolia/src/core/initialize.ts +11 -9
  38. package/providers/algolia/src/providers/product.provider.ts +44 -11
  39. package/providers/algolia/src/providers/search.provider.ts +47 -66
  40. package/providers/commercetools/src/core/client.ts +0 -1
  41. package/providers/commercetools/src/core/initialize.ts +28 -24
  42. package/providers/commercetools/src/providers/cart.provider.ts +58 -89
  43. package/providers/commercetools/src/providers/identity.provider.ts +34 -50
  44. package/providers/commercetools/src/providers/inventory.provider.ts +16 -38
  45. package/providers/commercetools/src/providers/price.provider.ts +30 -35
  46. package/providers/commercetools/src/providers/product.provider.ts +48 -38
  47. package/providers/commercetools/src/providers/search.provider.ts +32 -47
  48. package/providers/commercetools/src/schema/capabilities.schema.ts +1 -1
  49. package/providers/fake/package.json +1 -0
  50. package/providers/fake/src/core/initialize.ts +17 -14
  51. package/providers/fake/src/index.ts +4 -0
  52. package/providers/fake/src/providers/analytics.provider.ts +19 -0
  53. package/providers/fake/src/providers/cart.provider.ts +107 -0
  54. package/providers/fake/src/providers/identity.provider.ts +78 -67
  55. package/providers/fake/src/providers/inventory.provider.ts +54 -0
  56. package/providers/fake/src/providers/price.provider.ts +60 -0
  57. package/providers/fake/src/providers/product.provider.ts +53 -49
  58. package/providers/fake/src/providers/search.provider.ts +15 -33
  59. package/providers/posthog/src/core/initialize.ts +6 -4
  60. package/trpc/__mocks__/superjson.js +25 -0
  61. package/trpc/jest.config.ts +14 -0
  62. package/trpc/package.json +2 -1
  63. package/trpc/src/client.ts +176 -0
  64. package/trpc/src/index.ts +35 -62
  65. package/trpc/src/integration.spec.ts +216 -0
  66. package/trpc/src/server.ts +123 -0
  67. package/trpc/src/transparent-client.spec.ts +160 -0
  68. package/trpc/src/types.ts +142 -0
  69. package/trpc/tsconfig.json +3 -0
  70. package/trpc/tsconfig.lib.json +2 -1
  71. package/trpc/tsconfig.spec.json +15 -0
  72. package/tsconfig.base.json +0 -2
  73. package/core/src/cache/caching-strategy.ts +0 -25
  74. package/examples/angular/e2e/example.spec.ts +0 -9
  75. package/examples/angular/eslint.config.mjs +0 -41
  76. package/examples/angular/playwright.config.ts +0 -38
  77. package/examples/angular/project.json +0 -86
  78. package/examples/angular/public/favicon.ico +0 -0
  79. package/examples/angular/src/app/app.component.html +0 -6
  80. package/examples/angular/src/app/app.component.scss +0 -22
  81. package/examples/angular/src/app/app.component.ts +0 -14
  82. package/examples/angular/src/app/app.config.ts +0 -16
  83. package/examples/angular/src/app/app.routes.ts +0 -25
  84. package/examples/angular/src/app/cart/cart.component.html +0 -4
  85. package/examples/angular/src/app/cart/cart.component.scss +0 -14
  86. package/examples/angular/src/app/cart/cart.component.ts +0 -73
  87. package/examples/angular/src/app/identity/identity.component.html +0 -6
  88. package/examples/angular/src/app/identity/identity.component.scss +0 -18
  89. package/examples/angular/src/app/identity/identity.component.ts +0 -49
  90. package/examples/angular/src/app/product/product.component.html +0 -14
  91. package/examples/angular/src/app/product/product.component.scss +0 -11
  92. package/examples/angular/src/app/product/product.component.ts +0 -42
  93. package/examples/angular/src/app/search/search.component.html +0 -35
  94. package/examples/angular/src/app/search/search.component.scss +0 -129
  95. package/examples/angular/src/app/search/search.component.ts +0 -50
  96. package/examples/angular/src/app/services/product.service.ts +0 -35
  97. package/examples/angular/src/app/services/search.service.ts +0 -48
  98. package/examples/angular/src/app/services/trpc.client.ts +0 -27
  99. package/examples/angular/src/index.html +0 -13
  100. package/examples/angular/src/main.ts +0 -7
  101. package/examples/angular/src/styles.scss +0 -17
  102. package/examples/angular/src/test-setup.ts +0 -6
  103. package/examples/angular/tsconfig.app.json +0 -10
  104. package/examples/angular/tsconfig.editor.json +0 -6
  105. package/examples/angular/tsconfig.json +0 -32
  106. package/examples/node/src/initialize-algolia.spec.ts +0 -29
  107. package/examples/node/src/initialize-commercetools.spec.ts +0 -31
  108. package/examples/node/src/initialize-extended-providers.spec.ts +0 -38
  109. package/examples/node/src/initialize-mixed-providers.spec.ts +0 -36
  110. package/examples/node/src/providers/custom-algolia-product.provider.ts +0 -18
  111. package/examples/node/src/schemas/custom-product.schema.ts +0 -8
  112. package/examples/trpc-node/.env.example +0 -52
  113. package/examples/trpc-node/eslint.config.mjs +0 -3
  114. package/examples/trpc-node/project.json +0 -61
  115. package/examples/trpc-node/src/assets/.gitkeep +0 -0
  116. package/examples/trpc-node/src/main.ts +0 -59
  117. package/examples/trpc-node/src/router-instance.ts +0 -52
  118. package/examples/trpc-node/tsconfig.app.json +0 -9
  119. package/examples/trpc-node/tsconfig.json +0 -13
@@ -1,10 +1,10 @@
1
1
  import { Price } from '../schemas/models/price.model';
2
- import { PriceMutation } from '../schemas/mutations/price.mutation';
3
- import { PriceQuery } from '../schemas/queries/price.query';
2
+ import { PriceQueryBySku } from '../schemas/queries/price.query';
3
+ import { Session } from '../schemas/session.schema';
4
4
  import { BaseProvider } from './base.provider';
5
5
 
6
6
  export abstract class PriceProvider<
7
- T extends Price = Price,
8
- Q extends PriceQuery = PriceQuery,
9
- M extends PriceMutation = PriceMutation
10
- > extends BaseProvider<T, Q, M> {}
7
+ T extends Price = Price
8
+ > extends BaseProvider<T> {
9
+ public abstract getBySKU(payload: PriceQueryBySku, session: Session): Promise<T>;
10
+ }
@@ -1,11 +1,11 @@
1
1
  import { Product } from '../schemas/models/product.model';
2
- import { ProductMutation } from '../schemas/mutations/product.mutation';
3
- import { ProductQuery } from '../schemas/queries/product.query';
4
2
  import { BaseProvider } from './base.provider';
3
+ import { Session } from '../schemas/session.schema';
4
+ import { ProductQueryById, ProductQueryBySlug } from '../schemas/queries/product.query';
5
5
 
6
6
  export abstract class ProductProvider<
7
- T extends Product = Product,
8
- Q extends ProductQuery = ProductQuery,
9
- M extends ProductMutation = ProductMutation
10
- > extends BaseProvider<T, Q, M> {
7
+ T extends Product = Product
8
+ > extends BaseProvider<T> {
9
+ public abstract getById(payload: ProductQueryById, session: Session): Promise<T>;
10
+ public abstract getBySlug(payload: ProductQueryBySlug, session: Session): Promise<T>;
11
11
  }
@@ -1,12 +1,12 @@
1
1
  import { SearchResult } from '../schemas/models/search.model';
2
- import { SearchQuery } from '../schemas/queries/search.query';
3
- import { SearchMutation } from '../schemas/mutations/search.mutation';
2
+ import { SearchQueryByTerm } from '../schemas/queries/search.query';
3
+ import { Session } from '../schemas/session.schema';
4
4
  import { BaseProvider } from './base.provider';
5
5
 
6
6
  export abstract class SearchProvider<
7
- T extends SearchResult = SearchResult,
8
- Q extends SearchQuery = SearchQuery,
9
- M extends SearchMutation = SearchMutation
10
- > extends BaseProvider<T, Q, M> {}
7
+ T extends SearchResult = SearchResult
8
+ > extends BaseProvider<T> {
9
+ public abstract queryByTerm(payload: SearchQueryByTerm, session: Session): Promise<SearchResult>;
10
+ }
11
11
 
12
12
 
@@ -1,7 +1,6 @@
1
1
  import { z } from 'zod';
2
2
 
3
3
  export const BaseMutationSchema = z.looseInterface({
4
- mutation: z.ZodLiteral
5
4
  });
6
5
 
7
6
  export type BaseMutation = z.infer<typeof BaseMutationSchema>;
@@ -3,28 +3,22 @@ import { BaseMutationSchema } from './base.mutation';
3
3
  import { CartIdentifierSchema, CartItemIdentifierSchema, ProductIdentifierSchema } from '../models/identifiers.model';
4
4
 
5
5
  export const CartMutationItemAddSchema = BaseMutationSchema.extend({
6
- mutation: z.literal('add'),
7
6
  cart: CartIdentifierSchema.required(),
8
7
  product: ProductIdentifierSchema.required(),
9
8
  quantity: z.number()
10
9
  });
11
10
 
12
11
  export const CartMutationItemRemoveSchema = BaseMutationSchema.extend({
13
- mutation: z.literal('remove'),
14
12
  cart: CartIdentifierSchema.required(),
15
13
  item: CartItemIdentifierSchema.required()
16
14
  });
17
15
 
18
16
  export const CartMutationItemQuantityChangeSchema = BaseMutationSchema.extend({
19
- mutation: z.literal('adjustQuantity'),
20
17
  cart: CartIdentifierSchema.required(),
21
18
  item: CartItemIdentifierSchema.required(),
22
19
  quantity: z.number()
23
20
  });
24
21
 
25
- export const CartMutationSchema = z.union([CartMutationItemAddSchema, CartMutationItemRemoveSchema, CartMutationItemQuantityChangeSchema]);
26
-
27
- export type CartMutation = z.infer<typeof CartMutationSchema>;
28
22
  export type CartMutationItemAdd = z.infer<typeof CartMutationItemAddSchema>;
29
23
  export type CartMutationItemRemove = z.infer<typeof CartMutationItemRemoveSchema>;
30
24
  export type CartMutationItemQuantityChange = z.infer<typeof CartMutationItemQuantityChangeSchema>;
@@ -2,17 +2,12 @@ import { z } from 'zod';
2
2
  import { BaseMutationSchema } from './base.mutation';
3
3
 
4
4
  export const IdentityMutationLoginSchema = BaseMutationSchema.extend({
5
- mutation: z.literal('login'),
6
5
  username: z.string(),
7
6
  password: z.string()
8
7
  });
9
8
 
10
9
  export const IdentityMutationLogoutSchema = BaseMutationSchema.extend({
11
- mutation: z.literal('logout')
12
10
  });
13
11
 
14
- export const IdentityMutationSchema = z.union([IdentityMutationLoginSchema, IdentityMutationLogoutSchema]);
15
-
16
- export type IdentityMutation = z.infer<typeof IdentityMutationSchema>;
17
12
  export type IdentityMutationLogin = z.infer<typeof IdentityMutationLoginSchema>;
18
13
  export type IdentityMutationLogout = z.infer<typeof IdentityMutationLogoutSchema>;
@@ -1,5 +1,4 @@
1
1
  import { z } from 'zod';
2
- import { BaseMutationSchema } from './base.mutation';
3
2
 
4
3
  export const ProductMutationSchema = z.union([]);
5
4
 
@@ -1,7 +1,6 @@
1
1
  import { z } from 'zod';
2
2
 
3
3
  export const BaseQuerySchema = z.looseInterface({
4
- query: z.ZodLiteral
5
4
  });
6
5
 
7
6
  export type BaseQuery = z.infer<typeof BaseQuerySchema>;
@@ -3,10 +3,8 @@ import { BaseQuerySchema } from './base.query';
3
3
  import { CartIdentifierSchema } from '../models/identifiers.model';
4
4
 
5
5
  export const CartQueryByIdSchema = BaseQuerySchema.extend({
6
- query: z.literal('id'),
7
6
  cart: CartIdentifierSchema.required()
8
7
  });
9
8
  export const CartQuerySchema = z.union([CartQueryByIdSchema]);
10
9
 
11
- export type CartQueryById = z.infer<typeof CartQueryByIdSchema>;
12
- export type CartQuery = z.infer<typeof CartQuerySchema>;
10
+ export type CartQueryById = z.infer<typeof CartQueryByIdSchema>;
@@ -2,9 +2,7 @@ import { z } from 'zod';
2
2
  import { BaseQuerySchema } from './base.query';
3
3
 
4
4
  export const IdentityQuerySelfSchema = BaseQuerySchema.extend({
5
- query: z.literal('self')
5
+
6
6
  });
7
- export const IdentityQuerySchema = z.union([IdentityQuerySelfSchema]);
8
7
 
9
- export type IdentityQuery = z.infer<typeof IdentityQuerySchema>;
10
8
  export type IdentityQuerySelf = z.infer<typeof IdentityQuerySelfSchema>;
@@ -2,7 +2,6 @@ import { z } from 'zod';
2
2
  import { BaseQuerySchema } from './base.query';
3
3
 
4
4
  export const InventoryQuerySchema = BaseQuerySchema.extend({
5
- query: z.literal('sku'),
6
5
  sku: z.string()
7
6
  });
8
7
 
@@ -3,10 +3,7 @@ import { BaseQuerySchema } from './base.query';
3
3
  import { SKUIdentifierSchema } from '../models/identifiers.model';
4
4
 
5
5
  export const PriceQueryBySkuSchema = BaseQuerySchema.extend({
6
- query: z.literal('sku'),
7
6
  sku: SKUIdentifierSchema.required(),
8
7
  });
9
- export const PriceQuerySchema = z.union([PriceQueryBySkuSchema]);
10
8
 
11
9
  export type PriceQueryBySku = z.infer<typeof PriceQueryBySkuSchema>;
12
- export type PriceQuery = z.infer<typeof PriceQuerySchema>;
@@ -2,17 +2,12 @@ import { z } from 'zod';
2
2
  import { BaseQuerySchema } from './base.query';
3
3
 
4
4
  export const ProductQueryBySlugSchema = BaseQuerySchema.extend({
5
- query: z.literal('slug'),
6
5
  slug: z.string()
7
6
  });
8
7
 
9
8
  export const ProductQueryByIdSchema = BaseQuerySchema.extend({
10
- query: z.literal('id'),
11
- id: z.string()
9
+ id: z.string()
12
10
  });
13
11
 
14
- export const ProductQuerySchema = z.union([ProductQueryBySlugSchema, ProductQueryByIdSchema]);
15
-
16
12
  export type ProductQueryBySlug = z.infer<typeof ProductQueryBySlugSchema>;
17
- export type ProductQueryById = z.infer<typeof ProductQueryByIdSchema>;
18
- export type ProductQuery = z.infer<typeof ProductQuerySchema>;
13
+ export type ProductQueryById = z.infer<typeof ProductQueryByIdSchema>;
@@ -3,10 +3,7 @@ import { BaseQuerySchema } from './base.query';
3
3
  import { SearchIdentifierSchema } from '../models/identifiers.model';
4
4
 
5
5
  export const SearchQueryByTermSchema = BaseQuerySchema.extend({
6
- query: z.literal('term'),
7
6
  search: SearchIdentifierSchema.required()
8
7
  });
9
- export const SearchQuerySchema = z.union([SearchQueryByTermSchema]);
10
8
 
11
- export type SearchQuery = z.infer<typeof SearchQuerySchema>;
12
9
  export type SearchQueryByTerm = z.infer<typeof SearchQueryByTermSchema>;
@@ -2,9 +2,5 @@
2
2
  "name": "@reactionary/examples-node",
3
3
  "version": "0.0.1",
4
4
  "private": true,
5
- "dependencies": {
6
- "@reactionary/provider-algolia": "0.0.1",
7
- "@reactionary/core": "0.0.1",
8
- "zod": "4.0.0-beta.20250430T185432"
9
- }
5
+ "dependencies": {}
10
6
  }
@@ -0,0 +1,97 @@
1
+ import {
2
+ ClientBuilder,
3
+ Cache,
4
+ NoOpCache,
5
+ ProductSchema,
6
+ SessionSchema,
7
+ ProductQueryById,
8
+ ProductQueryBySlug,
9
+ } from '@reactionary/core';
10
+ import {
11
+ FakeProductProvider,
12
+ withFakeCapabilities,
13
+ } from '@reactionary/provider-fake';
14
+ import z from 'zod';
15
+
16
+ describe('basic node provider extension (models)', () => {
17
+ const session = SessionSchema.parse({
18
+ id: '1234567890',
19
+ });
20
+
21
+ const ExtendedProductModel = ProductSchema.extend({
22
+ gtin: z.string().default('gtin-default'),
23
+ });
24
+ type ExtendedProduct = z.infer<typeof ExtendedProductModel>;
25
+
26
+ class ExtendedProductProvider extends FakeProductProvider<ExtendedProduct> {
27
+ protected override parseSingle(body: ProductQueryById | ProductQueryBySlug): ExtendedProduct {
28
+ const model = super.parseSingle(body);
29
+
30
+ if (body.id) {
31
+ model.gtin = 'gtin-1234';
32
+ }
33
+
34
+ return this.assert(model);
35
+ }
36
+ }
37
+
38
+ function withExtendedCapabilities() {
39
+ return (cache: Cache) => {
40
+ const client = {
41
+ product: new ExtendedProductProvider(
42
+ { jitter: { mean: 0, deviation: 0 } },
43
+ ExtendedProductModel,
44
+ cache
45
+ ),
46
+ };
47
+
48
+ return client;
49
+ };
50
+ }
51
+
52
+ const client = new ClientBuilder()
53
+ .withCapability(
54
+ withFakeCapabilities(
55
+ {
56
+ jitter: {
57
+ mean: 0,
58
+ deviation: 0,
59
+ },
60
+ },
61
+ { search: true, product: false, identity: false }
62
+ )
63
+ )
64
+ .withCapability(withExtendedCapabilities())
65
+ .withCache(new NoOpCache())
66
+ .build();
67
+
68
+ it('should get the enabled set of capabilities across providers', async () => {
69
+ expect(client.product).toBeDefined();
70
+ expect(client.search).toBeDefined();
71
+ expect(client.identity).toBeUndefined();
72
+ });
73
+
74
+ it('should be able to call the regular methods and get the default value', async () => {
75
+ const product = await client.product.getBySlug(
76
+ {
77
+ slug: '1234',
78
+ },
79
+ session
80
+ );
81
+
82
+ expect(product).toBeDefined();
83
+ expect(product.gtin).toBe('gtin-default');
84
+ });
85
+
86
+ it('should be able to get serialized value from the extended provider', async () => {
87
+ const product = await client.product.getById(
88
+ {
89
+ id: '1234',
90
+ },
91
+ session
92
+ );
93
+
94
+ expect(product).toBeDefined();
95
+ expect(product.gtin).toBe('gtin-1234');
96
+ });
97
+ });
@@ -0,0 +1,84 @@
1
+ import {
2
+ ClientBuilder,
3
+ Cache,
4
+ NoOpCache,
5
+ ProductSchema,
6
+ Product,
7
+ } from '@reactionary/core';
8
+ import {
9
+ FakeProductProvider,
10
+ withFakeCapabilities,
11
+ } from '@reactionary/provider-fake';
12
+ import z from 'zod';
13
+
14
+ describe('basic node provider extension (models)', () => {
15
+ const ExtendedProductModel = ProductSchema.extend({
16
+ gtin: z.string().default('gtin-default'),
17
+ });
18
+
19
+ class ExtendedProductProvider extends FakeProductProvider {
20
+
21
+ public async getByCustom(_custom: string): Promise<Product> {
22
+ // Lets say we called somewhere...
23
+ const data = {
24
+ id: 'foo',
25
+ name: 'bar'
26
+ };
27
+
28
+ const model = this.parseItem(data);
29
+
30
+ return model;
31
+ }
32
+
33
+ protected parseItem(data: unknown): Product {
34
+ // In the real world, call super
35
+ // super.parseItem(data);
36
+ // Which would start by doing
37
+ const item = this.newModel();
38
+
39
+ if (data) {
40
+ item.name = (data as { name: string }).name;
41
+ }
42
+
43
+
44
+ return this.assert(item);
45
+ }
46
+ }
47
+
48
+ function withExtendedCapabilities() {
49
+ return (cache: Cache) => {
50
+ const client = {
51
+ product: new ExtendedProductProvider(
52
+ { jitter: { mean: 0, deviation: 0 } },
53
+ ExtendedProductModel,
54
+ cache
55
+ ),
56
+ };
57
+
58
+ return client;
59
+ };
60
+ }
61
+
62
+ const client = new ClientBuilder()
63
+ .withCapability(
64
+ withFakeCapabilities(
65
+ {
66
+ jitter: {
67
+ mean: 0,
68
+ deviation: 0,
69
+ },
70
+ },
71
+ { search: true, product: false, identity: false }
72
+ )
73
+ )
74
+ .withCapability(withExtendedCapabilities())
75
+ .withCache(new NoOpCache())
76
+ .build();
77
+
78
+ it('should be able to call a custom query method on the provider', async () => {
79
+ const product = await client.product.getByCustom('1234');
80
+
81
+ expect(product.name).toBe('bar');
82
+ });
83
+
84
+ });
@@ -0,0 +1,40 @@
1
+ import { buildClient, NoOpCache, SessionSchema } from '@reactionary/core';
2
+ import { withFakeCapabilities } from '@reactionary/provider-fake';
3
+
4
+ describe('basic node setup', () => {
5
+ const client = buildClient(
6
+ [
7
+ withFakeCapabilities(
8
+ {
9
+ jitter: {
10
+ mean: 0,
11
+ deviation: 0,
12
+ },
13
+ },
14
+ { search: true, product: true, identity: false }
15
+ ),
16
+ ],
17
+ {
18
+ cache: new NoOpCache(),
19
+ }
20
+ );
21
+
22
+ const session = SessionSchema.parse({
23
+ id: '1234567890'
24
+ });
25
+
26
+ it('should only get back the enabled capabilities', async () => {
27
+ expect(client.product).toBeDefined();
28
+ expect(client.search).toBeDefined();
29
+ expect(client.identity).toBeUndefined();
30
+ });
31
+
32
+ it('should be able to call the enabled capabilities', async () => {
33
+ const product = await client.product.getBySlug({
34
+ slug: '1234'
35
+ }, session);
36
+
37
+ expect(product).toBeDefined();
38
+ expect(product.slug).toBe('1234');
39
+ });
40
+ });
package/otel/src/index.ts CHANGED
@@ -5,5 +5,8 @@
5
5
  export { createTRPCTracing } from './trpc-middleware';
6
6
  export { createProviderInstrumentation } from './provider-instrumentation';
7
7
 
8
+ // Decorator for tracing functions
9
+ export { traced, TracedOptions } from './trace-decorator';
10
+
8
11
  // Graceful shutdown for process termination
9
12
  export { shutdownOtel } from './sdk';