@adobe-commerce/aio-toolkit 1.2.0 → 1.2.2

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
@@ -203,6 +203,99 @@ declare class FileRepository {
203
203
  private getFiles;
204
204
  }
205
205
 
206
+ declare enum AbdbColumnType {
207
+ STRING = "STRING",
208
+ NUMBER = "NUMBER",
209
+ BOOLEAN = "BOOLEAN",
210
+ DATETIME = "DATETIME"
211
+ }
212
+ interface AbdbColumnOptions {
213
+ name: string;
214
+ type: AbdbColumnType;
215
+ description?: string;
216
+ isRequired?: boolean;
217
+ }
218
+ interface AbdbColumnJson {
219
+ name: string;
220
+ type: AbdbColumnType;
221
+ description?: string;
222
+ isRequired?: true;
223
+ }
224
+
225
+ declare class AbdbColumn {
226
+ private readonly _name;
227
+ private readonly _type;
228
+ private readonly _description;
229
+ private readonly _isRequired;
230
+ constructor(options: AbdbColumnOptions);
231
+ getName(): string;
232
+ getType(): AbdbColumnType;
233
+ getDescription(): string | undefined;
234
+ getIsRequired(): boolean;
235
+ toJSON(): AbdbColumnJson;
236
+ clone(overrides?: Partial<AbdbColumnOptions>): AbdbColumn;
237
+ validate(value: unknown): void;
238
+ private _isMissingValue;
239
+ private _validateStringValue;
240
+ private _validateNumberValue;
241
+ private _validateBooleanValue;
242
+ private _validateDateTimeValue;
243
+ }
244
+
245
+ type AddColumnOptions = Omit<AbdbColumnOptions, 'name' | 'type'>;
246
+ type AbdbRunCallback<T = unknown> = (collection: DbCollection, client: DbClient) => Promise<T>;
247
+
248
+ type AbdbCollectionCallback = (collection: AbdbCollection) => void;
249
+ declare class AbdbCollection {
250
+ private readonly _name;
251
+ private readonly _columns;
252
+ constructor(name: string, callback?: AbdbCollectionCallback);
253
+ getName(): string;
254
+ addColumn(name: string, type: AbdbColumnType, options?: AddColumnOptions): this;
255
+ addColumn(name: string, type: AbdbColumnType, description?: string, isRequired?: boolean): this;
256
+ getColumns(): AbdbColumn[];
257
+ getColumn(name: string): AbdbColumn | undefined;
258
+ hasColumn(name: string): boolean;
259
+ validate(record: Record<string, unknown>): void;
260
+ validateAll(record: Record<string, unknown>): string[];
261
+ run<T>(callback: AbdbRunCallback<T>, token: string, region?: string): Promise<T>;
262
+ private _validateCollectionName;
263
+ private _validateColumnName;
264
+ private _validateIdentifier;
265
+ }
266
+
267
+ interface AbdbRecord {
268
+ _id?: string;
269
+ _created_at?: string;
270
+ _updated_at?: string;
271
+ [key: string]: unknown;
272
+ }
273
+ type AbdbRepositoryFilter = Record<string, unknown>;
274
+
275
+ declare class AbdbRepository<T extends AbdbRecord = AbdbRecord> {
276
+ private readonly _collection;
277
+ private readonly _token;
278
+ private readonly _region;
279
+ constructor(collection: AbdbCollection, token: string, region?: string);
280
+ getName(): string;
281
+ getCollection(): AbdbCollection;
282
+ find(filter?: AbdbRepositoryFilter): Promise<T[]>;
283
+ findOne(filter: AbdbRepositoryFilter): Promise<T | null>;
284
+ findById(id: string): Promise<T | null>;
285
+ delete(filter?: AbdbRepositoryFilter): Promise<Record<string, any>>;
286
+ deleteOne(filter?: AbdbRepositoryFilter): Promise<Record<string, any>>;
287
+ deleteById(id: string): Promise<Record<string, any>>;
288
+ insert(payloads: Array<Partial<T>>): Promise<Record<string, any>>;
289
+ insertOne(payload: Partial<T>): Promise<Record<string, any>>;
290
+ update(payload: Partial<T>, filter?: AbdbRepositoryFilter, options?: Record<string, any>): Promise<Record<string, any>>;
291
+ updateOne(payload: Partial<T>, filter?: AbdbRepositoryFilter, options?: Record<string, any>): Promise<Record<string, any>>;
292
+ save(payload?: Partial<T>, id?: string): Promise<Record<string, any>>;
293
+ isIdExists(id: string): Promise<boolean>;
294
+ exists(filter?: AbdbRepositoryFilter, options?: Record<string, any>): Promise<boolean>;
295
+ count(filter?: AbdbRepositoryFilter, options?: Record<string, any>): Promise<number>;
296
+ private _validatePartial;
297
+ }
298
+
206
299
  interface EventData {
207
300
  type: string;
208
301
  data: any;
@@ -328,67 +421,6 @@ declare class RuntimeApiGatewayService {
328
421
  delete(endpoint: string, additionalHeaders?: Record<string, string>): Promise<any>;
329
422
  }
330
423
 
331
- declare enum AbdbColumnType {
332
- STRING = "STRING",
333
- NUMBER = "NUMBER",
334
- BOOLEAN = "BOOLEAN",
335
- DATETIME = "DATETIME"
336
- }
337
- interface AbdbColumnOptions {
338
- name: string;
339
- type: AbdbColumnType;
340
- description?: string;
341
- isRequired?: boolean;
342
- }
343
- interface AbdbColumnJson {
344
- name: string;
345
- type: AbdbColumnType;
346
- description?: string;
347
- isRequired?: true;
348
- }
349
-
350
- declare class AbdbColumn {
351
- private readonly _name;
352
- private readonly _type;
353
- private readonly _description;
354
- private readonly _isRequired;
355
- constructor(options: AbdbColumnOptions);
356
- getName(): string;
357
- getType(): AbdbColumnType;
358
- getDescription(): string | undefined;
359
- getIsRequired(): boolean;
360
- toJSON(): AbdbColumnJson;
361
- clone(overrides?: Partial<AbdbColumnOptions>): AbdbColumn;
362
- validate(value: unknown): void;
363
- private _isMissingValue;
364
- private _validateStringValue;
365
- private _validateNumberValue;
366
- private _validateBooleanValue;
367
- private _validateDateTimeValue;
368
- }
369
-
370
- type AddColumnOptions = Omit<AbdbColumnOptions, 'name' | 'type'>;
371
- type AbdbRunCallback<T = unknown> = (collection: DbCollection, client: DbClient) => Promise<T>;
372
-
373
- type AbdbCollectionCallback = (collection: AbdbCollection) => void;
374
- declare class AbdbCollection {
375
- private readonly _name;
376
- private readonly _columns;
377
- constructor(name: string, callback?: AbdbCollectionCallback);
378
- getName(): string;
379
- addColumn(name: string, type: AbdbColumnType, options?: AddColumnOptions): this;
380
- addColumn(name: string, type: AbdbColumnType, description?: string, isRequired?: boolean): this;
381
- getColumns(): AbdbColumn[];
382
- getColumn(name: string): AbdbColumn | undefined;
383
- hasColumn(name: string): boolean;
384
- validate(record: Record<string, unknown>): void;
385
- validateAll(record: Record<string, unknown>): string[];
386
- run<T>(callback: AbdbRunCallback<T>, token: string, region?: string): Promise<T>;
387
- private _validateCollectionName;
388
- private _validateColumnName;
389
- private _validateIdentifier;
390
- }
391
-
392
424
  declare class TelemetryInputError extends Error {
393
425
  constructor(message: string);
394
426
  }
@@ -1051,4 +1083,4 @@ declare class AdminUiSdk {
1051
1083
  getRegistration(): AdminUiSdkRegistration;
1052
1084
  }
1053
1085
 
1054
- export { AbdbCollection, type AbdbCollectionCallback, AbdbColumn, type AbdbColumnJson, type AbdbColumnOptions, AbdbColumnType, type AbdbRunCallback, type AddColumnOptions, 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 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 OpenwhiskConfig, 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 };
1086
+ export { AbdbCollection, type AbdbCollectionCallback, AbdbColumn, type AbdbColumnJson, type AbdbColumnOptions, AbdbColumnType, type AbdbRecord, AbdbRepository, type AbdbRepositoryFilter, type AbdbRunCallback, type AddColumnOptions, 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 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 OpenwhiskConfig, 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 };