@adobe-commerce/aio-toolkit 1.0.8 → 1.0.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -5,6 +5,177 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [1.0.10] - 2026-01-01
9
+
10
+ ### 🐛 Bug Fixes
11
+
12
+ - **Telemetry** - Fixed `ERR_PACKAGE_PATH_NOT_EXPORTED` error when requiring the package
13
+ - Root cause: `@adobe/aio-lib-telemetry@1.1.2` has broken CommonJS exports in its package.json
14
+ - Solution: Implemented lazy-loading proxy pattern for OpenTelemetry logger
15
+ - `getLogger` is now dynamically imported only when `ENABLE_TELEMETRY=true`
16
+ - Maintains synchronous API with immediate logger availability
17
+ - Graceful fallback to `Core.Logger` if telemetry loading fails
18
+ - **Impact:** Zero breaking changes - existing client code works without modification
19
+ - **Benefits:**
20
+ - Full OpenTelemetry integration preserved when telemetry is enabled
21
+ - Package size reduced by 92% (3.83 MB → 288 KB)
22
+ - No more import errors from broken dependency exports
23
+
24
+ ### 🔧 Technical Changes
25
+
26
+ - **src/framework/telemetry/index.ts** - Implemented lazy-loading proxy pattern for `getLogger`
27
+ - **src/framework/telemetry/types.ts** - Added local `EntrypointInstrumentationConfig` type definition
28
+ - **src/commerce/adobe-auth/index.ts** - Changed to namespace import for ESM/CommonJS compatibility
29
+ - **tsconfig.json** - Added `"module": "ES2020"` to support dynamic imports
30
+ - **tsup.config.ts** - Configured to keep all dependencies external (not bundled)
31
+
32
+ ### ✅ Quality Assurance
33
+
34
+ - Added 8 comprehensive test cases for lazy-loading telemetry behavior
35
+ - Maintained 100% test coverage (1902 tests passing)
36
+ - All validation checks passing (linting, formatting, type safety)
37
+
38
+ ## [1.0.9] - 2025-12-23
39
+
40
+ ### ⚠️ Deprecations
41
+
42
+ - **ImsToken** `[Deprecated]` - Class deprecated due to built-in caching mechanism issues
43
+ - Internal caching relies on Adobe I/O Runtime State API which has reliability issues
44
+ - State API may not be available in all runtime environments
45
+ - Hard-coded TTL buffers (10-minute) and minimum TTL (60-minute) are inflexible
46
+ - Limited control over caching strategy and error handling
47
+ - Complex testing requirements due to State API dependencies
48
+ - **Migration:** Use `AdobeAuth.getToken()` directly and implement application-level caching (Redis, Memcached, in-memory, etc.)
49
+ - **Token Validation:** Use `BearerToken.info()` for token validation and expiry checking
50
+ - All existing functionality remains working but shows deprecation warnings
51
+
52
+ ### 💥 Breaking Changes
53
+
54
+ - **RuntimeApiGatewayService** `[Breaking]` - Simplified to accept bearer tokens directly
55
+ - Constructor changed from 8 parameters (IMS credentials) to 4 parameters: `(namespace, imsOrgId, token, logger)`
56
+ - No longer generates tokens internally - accepts pre-generated token string
57
+ - `getAuthenticatedHeaders()` changed from async to synchronous method
58
+ - **Migration Example:**
59
+ ```typescript
60
+ // OLD - Built-in token generation (no longer supported)
61
+ const service = new RuntimeApiGatewayService(
62
+ clientId, clientSecret, techAccountId, techEmail,
63
+ imsOrgId, scopes, namespace, logger
64
+ );
65
+
66
+ // NEW - Accept token directly
67
+ const token = await AdobeAuth.getToken(
68
+ clientId, clientSecret, techAccountId,
69
+ techEmail, imsOrgId, scopes
70
+ );
71
+ const service = new RuntimeApiGatewayService(
72
+ namespace, imsOrgId, token, logger
73
+ );
74
+ ```
75
+
76
+ - **ImsConnection** `[Breaking]` - Simplified to accept bearer tokens directly
77
+ - Constructor changed from 7 parameters (IMS credentials) to 2 parameters: `(token, logger)`
78
+ - No longer generates tokens internally using deprecated `ImsToken` class
79
+ - Accepts pre-generated token string from `AdobeAuth`
80
+ - Token caching must be implemented at application level (Redis, Memcached, in-memory, etc.)
81
+ - **Migration Example:**
82
+ ```typescript
83
+ // OLD - Built-in token generation (no longer supported)
84
+ const connection = new ImsConnection(
85
+ clientId, clientSecret, techAccountId,
86
+ techEmail, imsOrgId, scopes, logger
87
+ );
88
+
89
+ // NEW - Accept token directly
90
+ const token = await AdobeAuth.getToken(
91
+ clientId, clientSecret, techAccountId,
92
+ techEmail, imsOrgId, scopes
93
+ );
94
+ const connection = new ImsConnection(token, logger);
95
+ ```
96
+
97
+ ### 🚀 Major New Features
98
+
99
+ #### 📊 OpenTelemetry Integration with New Relic Support
100
+
101
+ This release introduces comprehensive OpenTelemetry instrumentation for enterprise-grade observability, enabling distributed tracing, metrics collection, and structured logging with automatic request correlation.
102
+
103
+ - **Telemetry** `[New Feature]` - OpenTelemetry integration with multi-provider support
104
+ - Added `Telemetry` class for initializing OpenTelemetry instrumentation
105
+ - Integrated New Relic as the first telemetry provider with full OTLP support
106
+ - Multi-provider chain architecture with graceful fallback mechanism
107
+ - Automatic instrumentation for traces, metrics, and logs via OTLP exporters
108
+ - Configuration via environment variables for easy deployment
109
+ - Backwards compatible - telemetry is completely opt-in via feature flags
110
+ - Zero impact when disabled - no performance overhead for existing deployments
111
+
112
+ #### 🔍 Automatic Request ID Tracking
113
+
114
+ - **Logger Wrapper** `[New Feature]` - Automatic request correlation across all log messages
115
+ - Extracts `x-adobe-commerce-request-id` from webhook headers automatically
116
+ - Injects request ID into all log messages without manual intervention
117
+ - Enables distributed tracing and request correlation in New Relic
118
+ - Works seamlessly with `RuntimeAction`, `EventConsumerAction`, `WebhookAction`, and `OpenwhiskAction`
119
+ - Supports both object-based and string log messages
120
+ - Request ID automatically appears in New Relic log queries for filtering
121
+
122
+ #### 🏷️ Action Type Metadata
123
+
124
+ - **Action Classification** `[New Feature]` - Automatic action type identification in logs
125
+ - Adds `action.type` field to all log messages for better filtering
126
+ - Supported types: `runtime-action`, `webhook-action`, `event-consumer-action`, `openwhisk-action`
127
+ - Extracted from `params.action_type` with automatic fallbacks
128
+ - Enables filtering and grouping by action type in observability platforms
129
+ - Helps identify performance patterns and issues by action category
130
+
131
+ #### 🔄 Updated Action Classes with Telemetry Support
132
+
133
+ - **RuntimeAction** `[Enhanced]` - Full telemetry integration
134
+ - Structured logging for action lifecycle (start, parameters, completion, errors)
135
+ - Automatic request ID and action type injection
136
+ - OpenTelemetry span creation for distributed tracing
137
+ - Comprehensive error logging with stack traces
138
+ - JSDoc documentation for all telemetry features
139
+
140
+ - **EventConsumerAction** `[Enhanced]` - Telemetry support added
141
+ - Structured logging matching RuntimeAction patterns
142
+ - Automatic request ID tracking from event parameters
143
+ - OpenTelemetry instrumentation for event processing
144
+ - Action type always set to `event-consumer-action`
145
+
146
+ - **WebhookAction** `[Enhanced]` - Correct action type handling
147
+ - Sets action type to `webhook-action` via `RuntimeAction.setActionType()`
148
+ - Ensures proper action type appears in all log messages
149
+ - Maintains webhook-specific context in telemetry data
150
+
151
+ - **OpenwhiskAction** `[Enhanced]` - Complete telemetry integration
152
+ - Full structured logging implementation
153
+ - Automatic request ID and action type tracking
154
+ - OpenTelemetry instrumentation for OpenWhisk invocations
155
+ - Action type always set to `openwhisk-action`
156
+ - Comprehensive JSDoc documentation
157
+
158
+ ### 📦 Dependencies
159
+
160
+ - **Added** `@adobe/aio-lib-telemetry@^1.1.2` - Official Adobe OpenTelemetry library
161
+
162
+ ### 📊 Statistics
163
+
164
+ - **New Classes**: 5 (Telemetry, TelemetryInputError, SuccessChecker, ResourceFactory, JsonMessageProcessor)
165
+ - **New Files**: 14 source files, 9 test files
166
+ - **Test Coverage**: 100% maintained (1897 tests passing, +218 new tests)
167
+ - **Lines Added**: 7,172 insertions across 32 files
168
+ - **Dependencies**: +1 (`@adobe/aio-lib-telemetry`)
169
+
170
+ ### 🔮 Future Enhancements
171
+
172
+ - Additional telemetry provider support (Grafana, Datadog, etc.)
173
+ - Custom metric collection APIs
174
+ - Advanced trace sampling strategies
175
+ - Performance monitoring dashboards
176
+
177
+ ---
178
+
8
179
  ## [1.0.8] - 2025-11-18
9
180
 
10
181
  ### 🔒 Security Fixes
package/README.md CHANGED
@@ -282,22 +282,137 @@ const helloWorldAction = OpenwhiskAction.execute('hello-world', async (params, c
282
282
  exports.main = helloWorldAction;
283
283
  ```
284
284
 
285
+ #### `Telemetry`
286
+ OpenTelemetry integration for enterprise-grade observability with distributed tracing, metrics collection, and structured logging.
287
+
288
+ **Features:**
289
+ - Automatic telemetry instrumentation for all framework action classes
290
+ - Request ID correlation across all log messages (`x-adobe-commerce-request-id`)
291
+ - Action type identification for better filtering (`action.type`)
292
+ - Multi-provider support (New Relic implemented, Grafana ready)
293
+ - Graceful fallback when telemetry is not configured
294
+ - Zero performance impact when disabled (opt-in via feature flags)
295
+
296
+ **Configuration:**
297
+
298
+ Configure telemetry in your `app.config.yaml`:
299
+
300
+ ```yaml
301
+ runtime-action:
302
+ function: actions/runtime-action/index.js
303
+ web: 'yes'
304
+ runtime: nodejs:22
305
+ inputs:
306
+ LOG_LEVEL: debug
307
+ ENVIRONMENT: $ENVIRONMENT
308
+ ENABLE_TELEMETRY: true
309
+ NEW_RELIC_TELEMETRY: true
310
+ NEW_RELIC_SERVICE_NAME: $NEW_RELIC_SERVICE_NAME
311
+ NEW_RELIC_LICENSE_KEY: $NEW_RELIC_LICENSE_KEY
312
+ annotations:
313
+ require-adobe-auth: true
314
+ final: true
315
+ ```
316
+
317
+ Set environment variables in your `.env` file:
318
+
319
+ ```bash
320
+ # Telemetry configuration
321
+ ENVIRONMENT=production
322
+ NEW_RELIC_SERVICE_NAME=my-app-builder-app
323
+ NEW_RELIC_LICENSE_KEY=your-license-key-here
324
+ NEW_RELIC_URL=https://otlp.nr-data.net:4318 # Optional
325
+ ```
326
+
327
+ **Usage Example:**
328
+
329
+ Telemetry is automatically initialized when you use framework action classes:
330
+
331
+ ```javascript
332
+ /*
333
+ * <license header>
334
+ */
335
+
336
+ const { RuntimeAction, RuntimeActionResponse, HttpMethod } = require("@adobe-commerce/aio-toolkit");
337
+ const name = 'runtime-action';
338
+
339
+ exports.main = RuntimeAction.execute(
340
+ name,
341
+ [HttpMethod.POST],
342
+ [],
343
+ ['Authorization'],
344
+ async (params, ctx) => {
345
+ const { logger } = ctx;
346
+
347
+ // Logger automatically includes x-adobe-commerce-request-id and action.type
348
+ logger.info({
349
+ message: `${name}-log`,
350
+ params: JSON.stringify(params),
351
+ });
352
+
353
+ return RuntimeActionResponse.success("Hello World");
354
+ }
355
+ );
356
+ ```
357
+
358
+ **What Gets Logged Automatically:**
359
+
360
+ All log messages automatically include:
361
+ - `x-adobe-commerce-request-id` - Extracted from webhook headers for request correlation
362
+ - `action.type` - Identifies the action type (runtime-action, webhook-action, event-consumer-action, openwhisk-action)
363
+ - Action lifecycle events (start, parameters, completion, errors)
364
+ - Full stack traces for errors
365
+
366
+ **Viewing in New Relic:**
367
+
368
+ Once configured, you can query your logs in New Relic using these attributes:
369
+
370
+ ```sql
371
+ -- Filter by request ID
372
+ SELECT * FROM Log WHERE `x-adobe-commerce-request-id` = 'request-123'
373
+
374
+ -- Filter by action type
375
+ SELECT * FROM Log WHERE `action.type` = 'webhook-action'
376
+
377
+ -- Find errors for a specific request
378
+ SELECT * FROM Log WHERE `x-adobe-commerce-request-id` = 'request-123' AND level = 'error'
379
+
380
+ -- Group by action type
381
+ SELECT count(*) FROM Log FACET `action.type` SINCE 1 hour ago
382
+ ```
383
+
384
+ **Supported Action Classes:**
385
+
386
+ Telemetry is automatically integrated with all framework action classes:
387
+ - `RuntimeAction` - HTTP request handling with telemetry
388
+ - `WebhookAction` - Webhook processing with telemetry
389
+ - `EventConsumerAction` - Event-driven processing with telemetry
390
+ - `OpenwhiskAction` - OpenWhisk action handling with telemetry
391
+
392
+ All action classes provide structured logging with automatic request ID and action type tracking.
393
+
285
394
  #### `RuntimeApiGatewayService`
286
- Flexible Adobe I/O Runtime API Gateway client with automatic IMS token management and authentication.
395
+ Flexible Adobe I/O Runtime API Gateway client that accepts bearer tokens for authenticated requests.
287
396
 
288
397
  ```typescript
289
- const { RuntimeApiGatewayService } = require('@adobe-commerce/aio-toolkit');
398
+ const { RuntimeApiGatewayService, AdobeAuth } = require('@adobe-commerce/aio-toolkit');
290
399
 
291
- // Initialize the service
292
- const apiGatewayService = new RuntimeApiGatewayService(
400
+ // Step 1: Generate token using AdobeAuth (implement caching in your application)
401
+ const token = await AdobeAuth.getToken(
293
402
  'your-client-id',
294
403
  'your-client-secret',
295
404
  'your-technical-account-id',
296
405
  'your-technical-account-email@example.com',
297
406
  'your-ims-org-id@AdobeOrg',
298
- ['openid', 'AdobeID', 'adobeio_api'],
299
- 'your-namespace-12345',
300
- logger // Optional custom logger
407
+ ['openid', 'AdobeID', 'adobeio_api']
408
+ );
409
+
410
+ // Step 2: Initialize the service with the token
411
+ const apiGatewayService = new RuntimeApiGatewayService(
412
+ 'your-namespace-12345', // Runtime namespace
413
+ 'your-ims-org-id@AdobeOrg', // IMS Org ID
414
+ token, // Bearer token
415
+ logger // Optional custom logger
301
416
  );
302
417
 
303
418
  // GET request
@@ -321,14 +436,15 @@ const deleteResult = await apiGatewayService.delete('v1/web/my-package/remove/12
321
436
  ```
322
437
 
323
438
  **Key Features:**
324
- - Automatic IMS token generation and caching
325
439
  - Built-in authentication headers
326
440
  - Support for GET, POST, PUT, DELETE methods
327
441
  - Flexible endpoint configuration
328
442
  - Comprehensive error handling
329
- - Integration with ImsToken for token management
443
+ - Accepts pre-generated bearer tokens (implement your own caching strategy)
330
444
  - CustomLogger integration
331
445
 
446
+ **💡 Best Practice:** Implement token caching at the application level (Redis, Memcached, in-memory) and validate tokens with `BearerToken.info()` before use to avoid unnecessary token generation calls.
447
+
332
448
  #### `FileRepository`
333
449
  File-based storage with CRUD operations for Adobe I/O Runtime applications.
334
450
 
@@ -579,40 +695,109 @@ const newProduct = await client.post('V1/products', {}, productData);
579
695
 
580
696
  **IMS (Identity Management System) Authentication**
581
697
  ```typescript
582
- const { AdobeCommerceClient, ImsConnection } = require('@adobe-commerce/aio-toolkit');
698
+ const { AdobeCommerceClient, ImsConnection, AdobeAuth, BearerToken } = require('@adobe-commerce/aio-toolkit');
699
+
700
+ // Step 1: Generate token using AdobeAuth (implement caching in your application)
701
+ // Check your application cache first
702
+ let token = await yourAppCache.get('commerce_ims_token');
703
+
704
+ if (!token || !BearerToken.info(token).isValid) {
705
+ // Generate new token
706
+ token = await AdobeAuth.getToken(
707
+ 'client-id',
708
+ 'client-secret',
709
+ 'technical-account-id',
710
+ 'technical-account-email',
711
+ 'ims-org-id@AdobeOrg',
712
+ ['AdobeID', 'openid', 'adobeio_api']
713
+ );
714
+
715
+ // Store in your application cache with appropriate TTL
716
+ const tokenInfo = BearerToken.info(token);
717
+ if (tokenInfo.isValid && tokenInfo.timeUntilExpiry) {
718
+ const ttl = Math.floor(tokenInfo.timeUntilExpiry / 1000) - 600; // 10-min buffer
719
+ await yourAppCache.set('commerce_ims_token', token, ttl);
720
+ }
721
+ }
583
722
 
584
- const connection = new ImsConnection(
585
- 'client-id',
586
- 'client-secret',
587
- 'technical-account-id',
588
- 'technical-account-email',
589
- 'ims-org-id',
590
- ['AdobeID', 'openid', 'adobeio_api'], // Scopes array
591
- logger // Optional custom logger
592
- );
723
+ // Step 2: Create connection with token
724
+ const connection = new ImsConnection(token, logger); // Optional logger
593
725
 
594
- // Create client with IMS authentication
726
+ // Step 3: Create client with IMS authentication
595
727
  const client = new AdobeCommerceClient('https://your-commerce-store.com', connection);
596
728
 
597
- // Make API calls - tokens are automatically cached and refreshed
729
+ // Make API calls
598
730
  const products = await client.get('V1/products');
599
731
  const newProduct = await client.post('V1/products', {}, productData);
600
732
  ```
601
733
 
602
- **Enhanced IMS Token Caching**
734
+ > **💡 Best Practice:** Implement token caching at the application level (Redis, Memcached, in-memory) to avoid unnecessary token generation calls.
735
+
736
+ **⚠️ DEPRECATED: ImsToken Class**
737
+
738
+ > **This class is deprecated due to built-in caching mechanism issues:**
739
+ > - Relies on Adobe I/O Runtime State API which has reliability issues
740
+ > - State API may not be available in all runtime environments
741
+ > - Hard-coded TTL buffers and minimum TTL are inflexible
742
+ > - Limited control over caching strategy
743
+ >
744
+ > **Migration Required:** Use `AdobeAuth` directly and implement caching at the application level.
603
745
 
604
746
  ```typescript
605
- const { GenerateImsToken } = require('@adobe-commerce/aio-toolkit');
747
+ // OLD (Deprecated) - ImsToken with built-in caching
748
+ const { ImsToken } = require('@adobe-commerce/aio-toolkit');
606
749
 
607
- const tokenGenerator = new GenerateImsToken(
608
- 'client-id', 'client-secret', 'technical-account-id',
609
- 'technical-account-email', 'ims-org-id',
610
- ['AdobeID', 'openid', 'adobeio_api'], logger
750
+ const imsToken = new ImsToken(
751
+ 'client-id',
752
+ 'client-secret',
753
+ 'technical-account-id',
754
+ 'technical-account-email',
755
+ 'ims-org-id@AdobeOrg',
756
+ ['AdobeID', 'openid', 'adobeio_api'],
757
+ logger // optional
611
758
  );
612
759
 
613
- const token = await tokenGenerator.execute();
760
+ const token = await imsToken.execute();
614
761
  ```
615
762
 
763
+ ```typescript
764
+ // ✅ NEW (Recommended) - AdobeAuth with application-level caching
765
+ const { AdobeAuth, BearerToken } = require('@adobe-commerce/aio-toolkit');
766
+
767
+ // Check your application cache first (Redis, Memcached, in-memory, etc.)
768
+ let token = await yourAppCache.get('ims_token');
769
+
770
+ // Validate cached token
771
+ if (!token || !BearerToken.info(token).isValid) {
772
+ // Generate new token using AdobeAuth
773
+ token = await AdobeAuth.getToken(
774
+ 'client-id',
775
+ 'client-secret',
776
+ 'technical-account-id',
777
+ 'technical-account-email',
778
+ 'ims-org-id@AdobeOrg',
779
+ ['AdobeID', 'openid', 'adobeio_api']
780
+ );
781
+
782
+ // Store in your application cache with appropriate TTL
783
+ const tokenInfo = BearerToken.info(token);
784
+ if (tokenInfo.isValid && tokenInfo.timeUntilExpiry) {
785
+ const ttl = Math.floor(tokenInfo.timeUntilExpiry / 1000) - 600; // 10-min buffer
786
+ await yourAppCache.set('ims_token', token, ttl);
787
+ }
788
+ }
789
+
790
+ // Use the token
791
+ console.log('Token:', token);
792
+ ```
793
+
794
+ **Why Migrate?**
795
+ - ✅ Full control over caching strategy (Redis, Memcached, in-memory, etc.)
796
+ - ✅ Better error handling and retry logic
797
+ - ✅ Works in any environment (not just Adobe I/O Runtime)
798
+ - ✅ Easier to test and mock
799
+ - ✅ Flexible TTL management based on your needs
800
+
616
801
  **Basic Authentication**
617
802
  ```typescript
618
803
  const { AdobeCommerceClient, BasicAuthConnection } = require('@adobe-commerce/aio-toolkit');
@@ -727,16 +912,18 @@ const {
727
912
  } = require('@adobe-commerce/aio-toolkit');
728
913
  const Core = require('@adobe/aio-sdk').Core;
729
914
 
730
- // Initialize Adobe Commerce client
731
- const connection = new ImsConnection(
915
+ // Generate token using AdobeAuth (implement caching in your application)
916
+ const token = await AdobeAuth.getToken(
732
917
  'client-id',
733
918
  'client-secret',
734
919
  'technical-account-id',
735
920
  'technical-account-email',
736
- 'ims-org-id',
737
- ['AdobeID', 'openid', 'adobeio_api'],
738
- logger
921
+ 'ims-org-id@AdobeOrg',
922
+ ['AdobeID', 'openid', 'adobeio_api']
739
923
  );
924
+
925
+ // Initialize Adobe Commerce client
926
+ const connection = new ImsConnection(token, logger);
740
927
  const adobeCommerceClient = new AdobeCommerceClient(
741
928
  'https://your-commerce-store.com',
742
929
  connection
package/dist/index.d.mts CHANGED
@@ -1,4 +1,6 @@
1
1
  import openwhisk, { Dict, Activation } from 'openwhisk';
2
+ import { LogRecordProcessor } from '@opentelemetry/sdk-logs';
3
+ import { SdkLogRecord } from '@adobe/aio-lib-telemetry/otel';
2
4
  import { Response } from 'node-fetch';
3
5
  import { Logger } from '@adobe/aio-sdk';
4
6
  import { Got, RequestError } from 'got';
@@ -39,6 +41,9 @@ interface ErrorResponse {
39
41
  type RuntimeActionResponseType = SuccessResponse | ErrorResponse;
40
42
 
41
43
  declare class RuntimeAction {
44
+ private static actionType;
45
+ static setActionType(type: string): void;
46
+ static getActionType(): string;
42
47
  static execute(name?: string, httpMethods?: HttpMethod[], requiredParams?: string[], requiredHeaders?: string[], action?: (params: {
43
48
  [key: string]: any;
44
49
  }, ctx: {
@@ -262,7 +267,7 @@ declare class RuntimeApiGatewayService {
262
267
  private readonly imsToken;
263
268
  private readonly restClient;
264
269
  private readonly customLogger;
265
- constructor(clientId: string, clientSecret: string, technicalAccountId: string, technicalAccountEmail: string, imsOrgId: string, scopes: Array<string>, namespace: string, logger?: any);
270
+ constructor(namespace: string, imsOrgId: string, imsToken: string, logger?: any);
266
271
  private buildEndpoint;
267
272
  private getAuthenticatedHeaders;
268
273
  get(endpoint: string, additionalHeaders?: Record<string, string>): Promise<any>;
@@ -271,6 +276,43 @@ declare class RuntimeApiGatewayService {
271
276
  delete(endpoint: string, additionalHeaders?: Record<string, string>): Promise<any>;
272
277
  }
273
278
 
279
+ type EntrypointInstrumentationConfig = any;
280
+ interface BaseTelemetryValidator {
281
+ isConfigured(params: Record<string, unknown>): boolean;
282
+ validateConfiguration(params: Record<string, unknown>): void;
283
+ }
284
+ interface BaseTelemetry {
285
+ canInitialize(params: Record<string, unknown>): boolean;
286
+ getConfig(): EntrypointInstrumentationConfig;
287
+ initialize(action: (params: Record<string, unknown>) => any): (params: Record<string, unknown>) => any;
288
+ }
289
+
290
+ declare class Telemetry {
291
+ static createLogger(name: string, params: Record<string, unknown>): any;
292
+ private static wrapLogger;
293
+ static formatError(error: unknown): Record<string, unknown>;
294
+ static initialize(action: (params: Record<string, unknown>) => any): (params: Record<string, unknown>) => any;
295
+ }
296
+
297
+ declare class TelemetryInputError extends Error {
298
+ constructor(message: string);
299
+ }
300
+
301
+ declare class SuccessChecker {
302
+ execute(result: unknown): boolean;
303
+ }
304
+
305
+ declare class JsonMessageProcessor implements LogRecordProcessor {
306
+ private readonly wrappedProcessor;
307
+ constructor(wrappedProcessor: LogRecordProcessor);
308
+ private parseJavaScriptObjectNotation;
309
+ private flattenObject;
310
+ onEmit(logRecord: SdkLogRecord): void;
311
+ private mapSeverityNumberToLevel;
312
+ forceFlush(): Promise<void>;
313
+ shutdown(): Promise<void>;
314
+ }
315
+
274
316
  interface BearerTokenInfo {
275
317
  token: string | null;
276
318
  tokenLength: number;
@@ -644,14 +686,9 @@ declare class Oauth1aConnection implements Connection {
644
686
  }
645
687
 
646
688
  declare class ImsConnection implements Connection {
647
- private clientId;
648
- private clientSecret;
649
- private technicalAccountId;
650
- private technicalAccountEmail;
651
- private imsOrgId;
652
- private scopes;
653
- private customLogger;
654
- constructor(clientId: string, clientSecret: string, technicalAccountId: string, technicalAccountEmail: string, imsOrgId: string, scopes: Array<string>, logger?: any);
689
+ private readonly imsToken;
690
+ private readonly customLogger;
691
+ constructor(imsToken: string, logger?: any);
655
692
  extend(commerceGot: any): Promise<any>;
656
693
  }
657
694
 
@@ -919,4 +956,4 @@ declare class AdminUiSdk {
919
956
  getRegistration(): AdminUiSdkRegistration;
920
957
  }
921
958
 
922
- export { AdminUiSdk, type AdminUiSdkRegistration, AdobeAuth, AdobeCommerceClient, type AdobeIMSConfig, BasicAuthConnection, BearerToken, type BearerTokenInfo, type CommerceEvent, type CommerceEventConfig, type CommerceEventField, type Connection, type CreateEventResult, CreateEvents, type CreateProviderParams, type CreateProviderResult, type CreateRegistrationResult, CreateRegistrations, type ErrorResponse, EventConsumerAction, type EventData, type EventMetadata, type EventMetadataInputModel, type EventMetadataListResponse, EventMetadataManager, type ExtendedRequestError, type FileMetadata, type FileRecord, FileRepository, GenerateBasicAuthToken, type GetProviderQueryParams, type GetRegistrationQueryParams, GraphQlAction, type HALLink, type Headers, HttpMethod, HttpStatus, IOEventsApiError, type IOEventsError, ImsConnection, ImsToken, type ImsTokenResult, InfiniteLoopBreaker, type InfiniteLoopData, IoEventsGlobals, type ListProvidersQueryParams, type ListRegistrationQueryParams, type MenuItem, Oauth1aConnection, OnboardCommerce, type OnboardCommerceConfig, type OnboardCommerceResult, OnboardEvents, type OnboardEventsInput, type OnboardEventsResponse, OnboardEvents as OnboardIOEvents, Openwhisk, OpenwhiskAction, type Page, Parameters, type Provider, type ProviderInputModel, ProviderManager, PublishEvent, type PublishEventResult, type Registration, type RegistrationCreateModel, type RegistrationListResponse, RegistrationManager, RestClient, RuntimeAction, RuntimeActionResponse, type RuntimeActionResponseType, RuntimeApiGatewayService, ShippingCarrier, type ShippingCarrierData, ShippingCarrierMethod, type ShippingCarrierMethodAdditionalData, type ShippingCarrierMethodData, ShippingCarrierResponse, SignatureVerification, type SuccessResponse, type TokenResult, Validator, WebhookAction, type WebhookActionAddResponse, type WebhookActionExceptionResponse, WebhookActionOperation, type WebhookActionRemoveResponse, type WebhookActionReplaceResponse, WebhookActionResponse, type WebhookActionResponseType, type WebhookActionSuccessResponse, type WorkspaceConfig };
959
+ export { AdminUiSdk, type AdminUiSdkRegistration, AdobeAuth, AdobeCommerceClient, type AdobeIMSConfig, type BaseTelemetry, type BaseTelemetryValidator, BasicAuthConnection, BearerToken, type BearerTokenInfo, type CommerceEvent, type CommerceEventConfig, type CommerceEventField, type Connection, type CreateEventResult, CreateEvents, type CreateProviderParams, type CreateProviderResult, type CreateRegistrationResult, CreateRegistrations, type EntrypointInstrumentationConfig, type ErrorResponse, EventConsumerAction, type EventData, type EventMetadata, type EventMetadataInputModel, type EventMetadataListResponse, EventMetadataManager, type ExtendedRequestError, type FileMetadata, type FileRecord, FileRepository, GenerateBasicAuthToken, type GetProviderQueryParams, type GetRegistrationQueryParams, GraphQlAction, type HALLink, type Headers, HttpMethod, HttpStatus, IOEventsApiError, type IOEventsError, ImsConnection, ImsToken, type ImsTokenResult, InfiniteLoopBreaker, type InfiniteLoopData, IoEventsGlobals, JsonMessageProcessor, type ListProvidersQueryParams, type ListRegistrationQueryParams, type MenuItem, Oauth1aConnection, OnboardCommerce, type OnboardCommerceConfig, type OnboardCommerceResult, OnboardEvents, type OnboardEventsInput, type OnboardEventsResponse, OnboardEvents as OnboardIOEvents, Openwhisk, OpenwhiskAction, type Page, Parameters, type Provider, type ProviderInputModel, ProviderManager, PublishEvent, type PublishEventResult, type Registration, type RegistrationCreateModel, type RegistrationListResponse, RegistrationManager, RestClient, RuntimeAction, RuntimeActionResponse, type RuntimeActionResponseType, RuntimeApiGatewayService, ShippingCarrier, type ShippingCarrierData, ShippingCarrierMethod, type ShippingCarrierMethodAdditionalData, type ShippingCarrierMethodData, ShippingCarrierResponse, SignatureVerification, SuccessChecker, type SuccessResponse, Telemetry, TelemetryInputError, type TokenResult, Validator, WebhookAction, type WebhookActionAddResponse, type WebhookActionExceptionResponse, WebhookActionOperation, type WebhookActionRemoveResponse, type WebhookActionReplaceResponse, WebhookActionResponse, type WebhookActionResponseType, type WebhookActionSuccessResponse, type WorkspaceConfig };