@adobe-commerce/aio-toolkit 1.0.5 → 1.0.6

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
@@ -231,6 +231,46 @@ declare class WebhookActionResponse {
231
231
  static remove(path: string): WebhookActionRemoveResponse;
232
232
  }
233
233
 
234
+ interface ImsTokenResult {
235
+ token: string | null;
236
+ expire_in: number;
237
+ }
238
+
239
+ declare class ImsToken {
240
+ private readonly clientId;
241
+ private readonly clientSecret;
242
+ private readonly technicalAccountId;
243
+ private readonly technicalAccountEmail;
244
+ private readonly imsOrgId;
245
+ private readonly scopes;
246
+ private readonly customLogger;
247
+ private state;
248
+ private readonly tokenContext;
249
+ private readonly key;
250
+ constructor(clientId: string, clientSecret: string, technicalAccountId: string, technicalAccountEmail: string, imsOrgId: string, scopes: Array<string>, logger?: any, cacheKey?: string, tokenContext?: string);
251
+ execute(): Promise<string | null>;
252
+ getImsToken(): Promise<ImsTokenResult | null>;
253
+ setValue(result: ImsTokenResult): Promise<boolean>;
254
+ getValue(): Promise<string | null>;
255
+ getState(): Promise<any>;
256
+ }
257
+
258
+ declare class RuntimeApiGatewayService {
259
+ private static readonly BASE_URL;
260
+ private readonly namespace;
261
+ private readonly imsOrgId;
262
+ private readonly imsToken;
263
+ private readonly restClient;
264
+ private readonly customLogger;
265
+ constructor(clientId: string, clientSecret: string, technicalAccountId: string, technicalAccountEmail: string, imsOrgId: string, scopes: Array<string>, namespace: string, logger?: any);
266
+ private buildEndpoint;
267
+ private getAuthenticatedHeaders;
268
+ get(endpoint: string, additionalHeaders?: Record<string, string>): Promise<any>;
269
+ post(endpoint: string, payload: any, additionalHeaders?: Record<string, string>): Promise<any>;
270
+ put(endpoint: string, payload: any, additionalHeaders?: Record<string, string>): Promise<any>;
271
+ delete(endpoint: string, additionalHeaders?: Record<string, string>): Promise<any>;
272
+ }
273
+
234
274
  interface BearerTokenInfo {
235
275
  token: string | null;
236
276
  tokenLength: number;
@@ -443,10 +483,6 @@ declare class InfiniteLoopBreaker {
443
483
  private static fingerPrint;
444
484
  }
445
485
 
446
- declare class AdobeAuth {
447
- static getToken(clientId: string, clientSecret: string, technicalAccountId: string, technicalAccountEmail: string, imsOrgId: string, scopes: string[], currentContext?: string): Promise<string>;
448
- }
449
-
450
486
  interface Connection {
451
487
  extend: (client: Got) => Promise<Got>;
452
488
  }
@@ -472,6 +508,120 @@ declare class AdobeCommerceClient {
472
508
  private getHttpClient;
473
509
  }
474
510
 
511
+ declare const IoEventsGlobals: {
512
+ readonly BASE_URL: "https://api.adobe.io";
513
+ readonly STATUS_CODES: {
514
+ readonly OK: 200;
515
+ readonly BAD_REQUEST: 400;
516
+ readonly UNAUTHORIZED: 401;
517
+ readonly FORBIDDEN: 403;
518
+ readonly NOT_FOUND: 404;
519
+ readonly REQUEST_TIMEOUT: 408;
520
+ readonly TIMEOUT: 408;
521
+ readonly CONFLICT: 409;
522
+ readonly INTERNAL_SERVER_ERROR: 500;
523
+ };
524
+ readonly HEADERS: {
525
+ readonly CONFLICTING_ID: "x-conflicting-id";
526
+ };
527
+ };
528
+ interface HALLink {
529
+ href: string;
530
+ templated?: boolean;
531
+ type?: string;
532
+ title?: string;
533
+ }
534
+ interface IOEventsError {
535
+ error?: string;
536
+ message?: string;
537
+ error_code?: string;
538
+ details?: string;
539
+ }
540
+ declare class IOEventsApiError extends Error {
541
+ readonly statusCode: number;
542
+ readonly errorCode: string | undefined;
543
+ readonly details: string | undefined;
544
+ constructor(message: string, statusCode: number, errorCode?: string, details?: string);
545
+ }
546
+
547
+ interface Provider {
548
+ id: string;
549
+ label: string;
550
+ description: string;
551
+ source: string;
552
+ docs_url?: string;
553
+ provider_metadata: string;
554
+ instance_id?: string;
555
+ event_delivery_format: string;
556
+ publisher: string;
557
+ _links?: {
558
+ 'rel:eventmetadata'?: HALLink;
559
+ 'rel:update'?: HALLink;
560
+ self?: HALLink;
561
+ };
562
+ }
563
+
564
+ interface OnboardCommerceConfig {
565
+ adobeCommerceClient: AdobeCommerceClient;
566
+ merchantId: string;
567
+ environmentId: string;
568
+ logger?: any;
569
+ }
570
+ interface CommerceEventField {
571
+ name: string;
572
+ }
573
+ interface CommerceEvent {
574
+ name: string;
575
+ fields: CommerceEventField[];
576
+ }
577
+ interface CommerceEventConfig {
578
+ event: CommerceEvent;
579
+ }
580
+ interface WorkspaceConfig {
581
+ project: {
582
+ id: string;
583
+ name: string;
584
+ title: string;
585
+ org: {
586
+ id: string;
587
+ name: string;
588
+ ims_org_id: string;
589
+ };
590
+ workspace: {
591
+ id: string;
592
+ name: string;
593
+ title: string;
594
+ action_url: string;
595
+ app_url: string;
596
+ details?: any;
597
+ };
598
+ };
599
+ }
600
+ interface OnboardCommerceResult {
601
+ success: boolean;
602
+ message: string;
603
+ error?: string;
604
+ }
605
+
606
+ declare class OnboardCommerce {
607
+ private readonly adobeCommerceClient;
608
+ private readonly merchantId;
609
+ private readonly environmentId;
610
+ private readonly customLogger;
611
+ private readonly configureProvider;
612
+ private readonly eventSubscriptionService;
613
+ private readonly eventService;
614
+ constructor(adobeCommerceClient: AdobeCommerceClient, merchantId: string, environmentId: string, logger?: any);
615
+ process(provider: Provider, workspaceConfig: WorkspaceConfig, commerceEventsConfig?: CommerceEventConfig[]): Promise<any>;
616
+ private filterEventsBySubscriptionStatus;
617
+ private prepareEventPayload;
618
+ private logEventSubscriptionSummary;
619
+ }
620
+
621
+ declare class AdobeAuth {
622
+ static getToken(clientId: string, clientSecret: string, technicalAccountId: string, technicalAccountEmail: string, imsOrgId: string, scopes: string[], currentContext?: string): Promise<string>;
623
+ }
624
+
475
625
  declare class BasicAuthConnection implements Connection {
476
626
  private baseUrl;
477
627
  private username;
@@ -597,59 +747,6 @@ interface AdobeIMSConfig {
597
747
  scopes: string[];
598
748
  }
599
749
 
600
- declare const IoEventsGlobals: {
601
- readonly BASE_URL: "https://api.adobe.io";
602
- readonly STATUS_CODES: {
603
- readonly OK: 200;
604
- readonly BAD_REQUEST: 400;
605
- readonly UNAUTHORIZED: 401;
606
- readonly FORBIDDEN: 403;
607
- readonly NOT_FOUND: 404;
608
- readonly REQUEST_TIMEOUT: 408;
609
- readonly TIMEOUT: 408;
610
- readonly CONFLICT: 409;
611
- readonly INTERNAL_SERVER_ERROR: 500;
612
- };
613
- readonly HEADERS: {
614
- readonly CONFLICTING_ID: "x-conflicting-id";
615
- };
616
- };
617
- interface HALLink {
618
- href: string;
619
- templated?: boolean;
620
- type?: string;
621
- title?: string;
622
- }
623
- interface IOEventsError {
624
- error?: string;
625
- message?: string;
626
- error_code?: string;
627
- details?: string;
628
- }
629
- declare class IOEventsApiError extends Error {
630
- readonly statusCode: number;
631
- readonly errorCode: string | undefined;
632
- readonly details: string | undefined;
633
- constructor(message: string, statusCode: number, errorCode?: string, details?: string);
634
- }
635
-
636
- interface Provider {
637
- id: string;
638
- label: string;
639
- description: string;
640
- source: string;
641
- docs_url?: string;
642
- provider_metadata: string;
643
- instance_id?: string;
644
- event_delivery_format: string;
645
- publisher: string;
646
- _links?: {
647
- 'rel:eventmetadata'?: HALLink;
648
- 'rel:update'?: HALLink;
649
- self?: HALLink;
650
- };
651
- }
652
-
653
750
  interface GetProviderQueryParams {
654
751
  eventmetadata?: boolean;
655
752
  }
@@ -821,4 +918,4 @@ declare class AdminUiSdk {
821
918
  getRegistration(): AdminUiSdkRegistration;
822
919
  }
823
920
 
824
- export { AdminUiSdk, type AdminUiSdkRegistration, AdobeAuth, AdobeCommerceClient, type AdobeIMSConfig, BasicAuthConnection, BearerToken, type BearerTokenInfo, 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, InfiniteLoopBreaker, type InfiniteLoopData, IoEventsGlobals, type ListProvidersQueryParams, type ListRegistrationQueryParams, type MenuItem, Oauth1aConnection, OnboardEvents, type OnboardEventsInput, type OnboardEventsResponse, 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, 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 };
921
+ 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 };