@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/dist/index.d.ts 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 };