@adobe-commerce/aio-toolkit 1.0.0
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 +205 -0
- package/LICENSE +56 -0
- package/README.md +658 -0
- package/dist/index.d.mts +631 -0
- package/dist/index.d.ts +631 -0
- package/dist/index.js +4891 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +4829 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +108 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,631 @@
|
|
|
1
|
+
import openwhisk, { Dict, Activation } from 'openwhisk';
|
|
2
|
+
import { Logger } from '@adobe/aio-sdk';
|
|
3
|
+
import { Got, RequestError } from 'got';
|
|
4
|
+
|
|
5
|
+
declare enum HttpStatus {
|
|
6
|
+
OK = 200,
|
|
7
|
+
BAD_REQUEST = 400,
|
|
8
|
+
UNAUTHORIZED = 401,
|
|
9
|
+
NOT_FOUND = 404,
|
|
10
|
+
METHOD_NOT_ALLOWED = 405,
|
|
11
|
+
INTERNAL_ERROR = 500
|
|
12
|
+
}
|
|
13
|
+
declare enum HttpMethod {
|
|
14
|
+
GET = "get",
|
|
15
|
+
POST = "post",
|
|
16
|
+
PUT = "put",
|
|
17
|
+
DELETE = "delete",
|
|
18
|
+
PATCH = "patch",
|
|
19
|
+
HEAD = "head",
|
|
20
|
+
OPTIONS = "options"
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
interface SuccessResponse {
|
|
24
|
+
statusCode: HttpStatus;
|
|
25
|
+
body: object | string;
|
|
26
|
+
headers?: {
|
|
27
|
+
[key: string]: string;
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
interface ErrorResponse {
|
|
31
|
+
error: {
|
|
32
|
+
statusCode: HttpStatus;
|
|
33
|
+
body: {
|
|
34
|
+
error: string;
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
type RuntimeActionResponseType = SuccessResponse | ErrorResponse;
|
|
39
|
+
|
|
40
|
+
declare class RuntimeAction {
|
|
41
|
+
static execute(name?: string, httpMethods?: HttpMethod[], requiredParams?: string[], requiredHeaders?: string[], action?: (params: {
|
|
42
|
+
[key: string]: any;
|
|
43
|
+
}, ctx: {
|
|
44
|
+
logger: any;
|
|
45
|
+
headers: {
|
|
46
|
+
[key: string]: any;
|
|
47
|
+
};
|
|
48
|
+
}) => Promise<RuntimeActionResponseType>): (params: {
|
|
49
|
+
[key: string]: any;
|
|
50
|
+
}) => Promise<RuntimeActionResponseType>;
|
|
51
|
+
private static validateRequest;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
declare class RuntimeActionResponse {
|
|
55
|
+
static success(response: object | string, headers?: {
|
|
56
|
+
[key: string]: string;
|
|
57
|
+
}): SuccessResponse;
|
|
58
|
+
static error(statusCode: HttpStatus, error: string): ErrorResponse;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
declare class Parameters {
|
|
62
|
+
static stringify(params: {
|
|
63
|
+
[key: string]: any;
|
|
64
|
+
}): string;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
declare class Validator {
|
|
68
|
+
static getMissingKeys(obj: {
|
|
69
|
+
[key: string]: any;
|
|
70
|
+
}, required: string[]): string[];
|
|
71
|
+
static checkMissingRequestInputs(params: {
|
|
72
|
+
[key: string]: any;
|
|
73
|
+
}, requiredParams?: string[], requiredHeaders?: string[]): string | null;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
declare class EventConsumerAction {
|
|
77
|
+
static execute(name?: string, requiredParams?: string[], requiredHeaders?: string[], action?: (params: {
|
|
78
|
+
[key: string]: any;
|
|
79
|
+
}, ctx: {
|
|
80
|
+
logger: any;
|
|
81
|
+
headers: {
|
|
82
|
+
[key: string]: any;
|
|
83
|
+
};
|
|
84
|
+
}) => Promise<RuntimeActionResponseType>): (params: {
|
|
85
|
+
[key: string]: any;
|
|
86
|
+
}) => Promise<RuntimeActionResponseType>;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
declare class GraphQlAction {
|
|
90
|
+
static execute(schema?: string, resolvers?: (ctx: {
|
|
91
|
+
logger: any;
|
|
92
|
+
headers: {
|
|
93
|
+
[key: string]: any;
|
|
94
|
+
};
|
|
95
|
+
params: {
|
|
96
|
+
[key: string]: any;
|
|
97
|
+
};
|
|
98
|
+
}) => Promise<any>, name?: string, disableIntrospection?: boolean): (params: {
|
|
99
|
+
[key: string]: any;
|
|
100
|
+
}) => Promise<RuntimeActionResponseType>;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
declare class Openwhisk {
|
|
104
|
+
openwhiskClient: ReturnType<typeof openwhisk>;
|
|
105
|
+
constructor(host: string, apiKey: string);
|
|
106
|
+
execute(action: string, params: Dict): Promise<Activation<Dict>>;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
declare class OpenwhiskAction {
|
|
110
|
+
static execute(name?: string, action?: (params: {
|
|
111
|
+
[key: string]: any;
|
|
112
|
+
}, ctx: {
|
|
113
|
+
logger: any;
|
|
114
|
+
headers: {
|
|
115
|
+
[key: string]: any;
|
|
116
|
+
};
|
|
117
|
+
}) => Promise<RuntimeActionResponseType>): (params: {
|
|
118
|
+
[key: string]: any;
|
|
119
|
+
}) => Promise<RuntimeActionResponseType>;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
interface FileRecord {
|
|
123
|
+
id: string | number;
|
|
124
|
+
created_at: string;
|
|
125
|
+
updated_at: string;
|
|
126
|
+
[key: string]: any;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
declare class FileRepository {
|
|
130
|
+
private readonly filepath;
|
|
131
|
+
private files;
|
|
132
|
+
constructor(filepath: string);
|
|
133
|
+
list(): Promise<FileRecord[]>;
|
|
134
|
+
load(id?: string): Promise<FileRecord>;
|
|
135
|
+
save(payload?: Partial<FileRecord>): Promise<boolean>;
|
|
136
|
+
delete(ids?: (string | number)[]): Promise<FileRecord[]>;
|
|
137
|
+
private getFiles;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
interface BearerTokenInfo {
|
|
141
|
+
token: string | null;
|
|
142
|
+
tokenLength: number;
|
|
143
|
+
isValid: boolean;
|
|
144
|
+
expiry: string | null;
|
|
145
|
+
timeUntilExpiry: number | null;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
declare class BearerToken {
|
|
149
|
+
static extract(params: {
|
|
150
|
+
[key: string]: any;
|
|
151
|
+
}): BearerTokenInfo;
|
|
152
|
+
static info(token: string | null): BearerTokenInfo;
|
|
153
|
+
private static _isTokenValid;
|
|
154
|
+
private static _calculateExpiry;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
interface Headers {
|
|
158
|
+
[key: string]: string;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
declare class RestClient {
|
|
162
|
+
get(endpoint: string, headers?: Headers): Promise<any>;
|
|
163
|
+
post(endpoint: string, headers?: Headers, payload?: any): Promise<any>;
|
|
164
|
+
put(endpoint: string, headers?: Headers, payload?: any): Promise<any>;
|
|
165
|
+
delete(endpoint: string, headers?: Headers): Promise<any>;
|
|
166
|
+
apiCall(endpoint: string, method?: string, headers?: Headers, payload?: any): Promise<any>;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
interface SampleEventTemplate {
|
|
170
|
+
[key: string]: any;
|
|
171
|
+
}
|
|
172
|
+
interface OnboardEvent {
|
|
173
|
+
eventCode: string;
|
|
174
|
+
runtimeAction: string;
|
|
175
|
+
deliveryType: string;
|
|
176
|
+
sampleEventTemplate: SampleEventTemplate;
|
|
177
|
+
}
|
|
178
|
+
interface OnboardRegistration {
|
|
179
|
+
key: string;
|
|
180
|
+
label: string;
|
|
181
|
+
description: string;
|
|
182
|
+
events: OnboardEvent[];
|
|
183
|
+
}
|
|
184
|
+
interface OnboardProvider {
|
|
185
|
+
key: string;
|
|
186
|
+
label: string;
|
|
187
|
+
description: string;
|
|
188
|
+
docsUrl: string | null;
|
|
189
|
+
registrations: OnboardRegistration[];
|
|
190
|
+
}
|
|
191
|
+
interface OnboardEventsInput {
|
|
192
|
+
providers: OnboardProvider[];
|
|
193
|
+
}
|
|
194
|
+
interface ParsedRegistration {
|
|
195
|
+
key: string;
|
|
196
|
+
label: string;
|
|
197
|
+
description: string;
|
|
198
|
+
providerKey: string;
|
|
199
|
+
}
|
|
200
|
+
interface ParsedEvent {
|
|
201
|
+
eventCode: string;
|
|
202
|
+
runtimeAction: string;
|
|
203
|
+
deliveryType: string;
|
|
204
|
+
sampleEventTemplate: any;
|
|
205
|
+
registrationKey: string;
|
|
206
|
+
providerKey: string;
|
|
207
|
+
}
|
|
208
|
+
interface CreateProviderResult {
|
|
209
|
+
created: boolean;
|
|
210
|
+
skipped: boolean;
|
|
211
|
+
provider: {
|
|
212
|
+
id?: string;
|
|
213
|
+
instanceId?: string;
|
|
214
|
+
key: string;
|
|
215
|
+
label: string;
|
|
216
|
+
originalLabel: string;
|
|
217
|
+
description?: string;
|
|
218
|
+
docsUrl?: string | null;
|
|
219
|
+
};
|
|
220
|
+
error?: string;
|
|
221
|
+
reason?: string;
|
|
222
|
+
raw?: any;
|
|
223
|
+
}
|
|
224
|
+
interface CreateEventResult {
|
|
225
|
+
created: boolean;
|
|
226
|
+
skipped: boolean;
|
|
227
|
+
event: {
|
|
228
|
+
id?: string;
|
|
229
|
+
eventCode: string;
|
|
230
|
+
label?: string;
|
|
231
|
+
description?: string;
|
|
232
|
+
sampleEventTemplate?: any;
|
|
233
|
+
};
|
|
234
|
+
provider?: CreateProviderResult['provider'];
|
|
235
|
+
error?: string;
|
|
236
|
+
reason?: string;
|
|
237
|
+
raw?: any;
|
|
238
|
+
}
|
|
239
|
+
interface CreateRegistrationResult {
|
|
240
|
+
created: boolean;
|
|
241
|
+
skipped: boolean;
|
|
242
|
+
registration: {
|
|
243
|
+
id?: string;
|
|
244
|
+
key: string;
|
|
245
|
+
label: string;
|
|
246
|
+
originalLabel: string;
|
|
247
|
+
description?: string;
|
|
248
|
+
clientId?: string;
|
|
249
|
+
name?: string;
|
|
250
|
+
webhookUrl?: string;
|
|
251
|
+
deliveryType?: string;
|
|
252
|
+
runtimeAction?: string;
|
|
253
|
+
};
|
|
254
|
+
provider?: CreateProviderResult['provider'];
|
|
255
|
+
error?: string;
|
|
256
|
+
reason?: string;
|
|
257
|
+
raw?: any;
|
|
258
|
+
}
|
|
259
|
+
interface OnboardEventsResponse {
|
|
260
|
+
createdProviders: CreateProviderResult[];
|
|
261
|
+
createdEvents: CreateEventResult[];
|
|
262
|
+
createdRegistrations: CreateRegistrationResult[];
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
declare class OnboardEvents {
|
|
266
|
+
private readonly projectName;
|
|
267
|
+
private readonly consumerId;
|
|
268
|
+
private readonly projectId;
|
|
269
|
+
private readonly workspaceId;
|
|
270
|
+
private readonly apiKey;
|
|
271
|
+
private readonly accessToken;
|
|
272
|
+
private readonly logger;
|
|
273
|
+
private readonly createProviders;
|
|
274
|
+
private readonly createEvents;
|
|
275
|
+
private readonly createRegistrations;
|
|
276
|
+
constructor(projectName: string, consumerId: string, projectId: string, workspaceId: string, apiKey: string, accessToken: string);
|
|
277
|
+
getLogger(): Logger;
|
|
278
|
+
process(input: OnboardEventsInput): Promise<OnboardEventsResponse>;
|
|
279
|
+
private generateSummary;
|
|
280
|
+
private logSummary;
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
declare class CreateEvents {
|
|
284
|
+
private readonly consumerId;
|
|
285
|
+
private readonly projectId;
|
|
286
|
+
private readonly workspaceId;
|
|
287
|
+
private readonly clientId;
|
|
288
|
+
private readonly accessToken;
|
|
289
|
+
private readonly logger;
|
|
290
|
+
private eventMetadataManager;
|
|
291
|
+
constructor(consumerId: string, projectId: string, workspaceId: string, clientId: string, accessToken: string, logger: Logger);
|
|
292
|
+
private getEventMetadataManager;
|
|
293
|
+
private createEvent;
|
|
294
|
+
private fetchMetadata;
|
|
295
|
+
process(events: ParsedEvent[], providerResults: CreateProviderResult[], projectName?: string): Promise<CreateEventResult[]>;
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
interface Registration {
|
|
299
|
+
registration_id: string;
|
|
300
|
+
name: string;
|
|
301
|
+
description?: string;
|
|
302
|
+
webhook_url?: string;
|
|
303
|
+
events_of_interest?: Array<{
|
|
304
|
+
provider_id: string;
|
|
305
|
+
event_code: string;
|
|
306
|
+
}>;
|
|
307
|
+
delivery_type: string;
|
|
308
|
+
enabled: boolean;
|
|
309
|
+
created_date: string;
|
|
310
|
+
updated_date: string;
|
|
311
|
+
runtime_action?: string;
|
|
312
|
+
[key: string]: any;
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
declare class CreateRegistrations {
|
|
316
|
+
private readonly consumerId;
|
|
317
|
+
private readonly projectId;
|
|
318
|
+
private readonly workspaceId;
|
|
319
|
+
private readonly clientId;
|
|
320
|
+
private readonly accessToken;
|
|
321
|
+
private readonly logger;
|
|
322
|
+
private registrationManager?;
|
|
323
|
+
constructor(consumerId: string, projectId: string, workspaceId: string, clientId: string, accessToken: string, logger: Logger);
|
|
324
|
+
process(registrations: ParsedRegistration[], events: ParsedEvent[], providerResults: CreateProviderResult[], projectName?: string): Promise<CreateRegistrationResult[]>;
|
|
325
|
+
private getRegistrationManager;
|
|
326
|
+
fetchRegistrations(): Promise<Map<string, Registration>>;
|
|
327
|
+
private groupEventsByProvider;
|
|
328
|
+
private preparePayload;
|
|
329
|
+
private createRegistration;
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
interface InfiniteLoopData {
|
|
333
|
+
keyFn: string | (() => string);
|
|
334
|
+
fingerprintFn: any | (() => any);
|
|
335
|
+
eventTypes: string[];
|
|
336
|
+
event: string;
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
declare class InfiniteLoopBreaker {
|
|
340
|
+
private static readonly FINGERPRINT_ALGORITHM;
|
|
341
|
+
private static readonly FINGERPRINT_ENCODING;
|
|
342
|
+
private static readonly DEFAULT_INFINITE_LOOP_BREAKER_TTL;
|
|
343
|
+
static isInfiniteLoop({ keyFn, fingerprintFn, eventTypes, event, }: InfiniteLoopData): Promise<boolean>;
|
|
344
|
+
static storeFingerPrint(keyFn: string | (() => string), fingerprintFn: any | (() => any), ttl?: number): Promise<void>;
|
|
345
|
+
static fnFingerprint(obj: any): () => any;
|
|
346
|
+
static fnInfiniteLoopKey(key: any): () => any;
|
|
347
|
+
private static fingerPrint;
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
declare class AdobeAuth {
|
|
351
|
+
static getToken(clientId: string, clientSecret: string, technicalAccountId: string, technicalAccountEmail: string, imsOrgId: string, scopes: string[], currentContext?: string): Promise<string>;
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
interface Connection {
|
|
355
|
+
extend: (client: Got) => Promise<Got>;
|
|
356
|
+
}
|
|
357
|
+
interface ExtendedRequestError extends RequestError {
|
|
358
|
+
responseBody?: any;
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
declare class AdobeCommerceClient {
|
|
362
|
+
private baseUrl;
|
|
363
|
+
private connection;
|
|
364
|
+
private logger;
|
|
365
|
+
constructor(baseUrl: string, connection: Connection, logger?: any);
|
|
366
|
+
get(endpoint: string, headers?: Record<string, string>): Promise<any>;
|
|
367
|
+
post(endpoint: string, headers?: Record<string, string>, payload?: any): Promise<any>;
|
|
368
|
+
put(endpoint: string, headers?: Record<string, string>, payload?: any): Promise<any>;
|
|
369
|
+
delete(endpoint: string, headers?: Record<string, string>): Promise<any>;
|
|
370
|
+
private apiCall;
|
|
371
|
+
private getHttpClient;
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
declare class BasicAuthConnection implements Connection {
|
|
375
|
+
private baseUrl;
|
|
376
|
+
private username;
|
|
377
|
+
private password;
|
|
378
|
+
private logger;
|
|
379
|
+
constructor(baseUrl: string, username: string, password: string, logger?: any);
|
|
380
|
+
extend(commerceGot: any): Promise<any>;
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
declare class Oauth1aConnection implements Connection {
|
|
384
|
+
private consumerKey;
|
|
385
|
+
private consumerSecret;
|
|
386
|
+
private accessToken;
|
|
387
|
+
private accessTokenSecret;
|
|
388
|
+
private logger;
|
|
389
|
+
constructor(consumerKey: string, consumerSecret: string, accessToken: string, accessTokenSecret: string, logger?: any);
|
|
390
|
+
extend(commerceGot: Got): Promise<Got>;
|
|
391
|
+
headersProvider(): (url: string, method: string) => any;
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
declare class ImsConnection implements Connection {
|
|
395
|
+
private clientId;
|
|
396
|
+
private clientSecret;
|
|
397
|
+
private technicalAccountId;
|
|
398
|
+
private technicalAccountEmail;
|
|
399
|
+
private imsOrgId;
|
|
400
|
+
private scopes;
|
|
401
|
+
private logger;
|
|
402
|
+
private currentContext;
|
|
403
|
+
constructor(clientId: string, clientSecret: string, technicalAccountId: string, technicalAccountEmail: string, imsOrgId: string, scopes: Array<string>, logger?: any, currentContext?: string);
|
|
404
|
+
extend(commerceGot: any): Promise<any>;
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
interface TokenResult {
|
|
408
|
+
token: string | null;
|
|
409
|
+
expire_in: number;
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
declare class GenerateBasicAuthToken {
|
|
413
|
+
private baseUrl;
|
|
414
|
+
private username;
|
|
415
|
+
private password;
|
|
416
|
+
private key;
|
|
417
|
+
private logger;
|
|
418
|
+
private state;
|
|
419
|
+
constructor(baseUrl: string, username: string, password: string, logger?: any);
|
|
420
|
+
execute(): Promise<string | null>;
|
|
421
|
+
getCommerceToken(): Promise<TokenResult | null>;
|
|
422
|
+
createEndpoint(endpoint: string): string;
|
|
423
|
+
setValue(result: TokenResult): Promise<boolean>;
|
|
424
|
+
getValue(): Promise<string | null>;
|
|
425
|
+
getState(): Promise<any>;
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
interface AdobeIMSConfig {
|
|
429
|
+
client_id: string;
|
|
430
|
+
client_secrets: string[];
|
|
431
|
+
technical_account_id: string;
|
|
432
|
+
technical_account_email: string;
|
|
433
|
+
ims_org_id: string;
|
|
434
|
+
scopes: string[];
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
declare const IoEventsGlobals: {
|
|
438
|
+
readonly BASE_URL: "https://api.adobe.io";
|
|
439
|
+
readonly STATUS_CODES: {
|
|
440
|
+
readonly OK: 200;
|
|
441
|
+
readonly BAD_REQUEST: 400;
|
|
442
|
+
readonly UNAUTHORIZED: 401;
|
|
443
|
+
readonly FORBIDDEN: 403;
|
|
444
|
+
readonly NOT_FOUND: 404;
|
|
445
|
+
readonly REQUEST_TIMEOUT: 408;
|
|
446
|
+
readonly TIMEOUT: 408;
|
|
447
|
+
readonly CONFLICT: 409;
|
|
448
|
+
readonly INTERNAL_SERVER_ERROR: 500;
|
|
449
|
+
};
|
|
450
|
+
readonly HEADERS: {
|
|
451
|
+
readonly CONFLICTING_ID: "x-conflicting-id";
|
|
452
|
+
};
|
|
453
|
+
};
|
|
454
|
+
interface HALLink {
|
|
455
|
+
href: string;
|
|
456
|
+
templated?: boolean;
|
|
457
|
+
type?: string;
|
|
458
|
+
title?: string;
|
|
459
|
+
}
|
|
460
|
+
interface IOEventsError {
|
|
461
|
+
error?: string;
|
|
462
|
+
message?: string;
|
|
463
|
+
error_code?: string;
|
|
464
|
+
details?: string;
|
|
465
|
+
}
|
|
466
|
+
declare class IOEventsApiError extends Error {
|
|
467
|
+
readonly statusCode: number;
|
|
468
|
+
readonly errorCode: string | undefined;
|
|
469
|
+
readonly details: string | undefined;
|
|
470
|
+
constructor(message: string, statusCode: number, errorCode?: string, details?: string);
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
interface Provider {
|
|
474
|
+
id: string;
|
|
475
|
+
label: string;
|
|
476
|
+
description: string;
|
|
477
|
+
source: string;
|
|
478
|
+
docs_url?: string;
|
|
479
|
+
provider_metadata: string;
|
|
480
|
+
instance_id?: string;
|
|
481
|
+
event_delivery_format: string;
|
|
482
|
+
publisher: string;
|
|
483
|
+
_links?: {
|
|
484
|
+
'rel:eventmetadata'?: HALLink;
|
|
485
|
+
'rel:update'?: HALLink;
|
|
486
|
+
self?: HALLink;
|
|
487
|
+
};
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
interface GetProviderQueryParams {
|
|
491
|
+
eventmetadata?: boolean;
|
|
492
|
+
}
|
|
493
|
+
|
|
494
|
+
interface ListProvidersQueryParams {
|
|
495
|
+
providerMetadataId?: string;
|
|
496
|
+
instanceId?: string;
|
|
497
|
+
providerMetadataIds?: string[];
|
|
498
|
+
eventmetadata?: boolean;
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
interface ProviderInputModel {
|
|
502
|
+
label: string;
|
|
503
|
+
description?: string;
|
|
504
|
+
docs_url?: string;
|
|
505
|
+
provider_metadata?: string;
|
|
506
|
+
instance_id?: string;
|
|
507
|
+
data_residency_region?: string;
|
|
508
|
+
}
|
|
509
|
+
interface CreateProviderParams {
|
|
510
|
+
projectId: string;
|
|
511
|
+
workspaceId: string;
|
|
512
|
+
providerData: ProviderInputModel;
|
|
513
|
+
}
|
|
514
|
+
|
|
515
|
+
declare class ProviderManager {
|
|
516
|
+
private readonly clientId;
|
|
517
|
+
private readonly consumerId;
|
|
518
|
+
private readonly projectId;
|
|
519
|
+
private readonly workspaceId;
|
|
520
|
+
private readonly accessToken;
|
|
521
|
+
private readonly listService;
|
|
522
|
+
private readonly getService;
|
|
523
|
+
private readonly createService;
|
|
524
|
+
private readonly deleteService;
|
|
525
|
+
constructor(clientId: string, consumerId: string, projectId: string, workspaceId: string, accessToken: string);
|
|
526
|
+
list(queryParams?: ListProvidersQueryParams): Promise<Provider[]>;
|
|
527
|
+
get(providerId: string, queryParams?: GetProviderQueryParams): Promise<Provider>;
|
|
528
|
+
create(providerData: ProviderInputModel): Promise<Provider>;
|
|
529
|
+
delete(providerId: string): Promise<void>;
|
|
530
|
+
}
|
|
531
|
+
|
|
532
|
+
interface EventMetadata {
|
|
533
|
+
event_code: string;
|
|
534
|
+
label?: string;
|
|
535
|
+
description?: string;
|
|
536
|
+
sample_event_template?: string;
|
|
537
|
+
[key: string]: any;
|
|
538
|
+
}
|
|
539
|
+
|
|
540
|
+
interface EventMetadataInputModel {
|
|
541
|
+
description: string;
|
|
542
|
+
label: string;
|
|
543
|
+
event_code: string;
|
|
544
|
+
sample_event_template?: Record<string, any>;
|
|
545
|
+
}
|
|
546
|
+
|
|
547
|
+
declare class EventMetadataManager {
|
|
548
|
+
private readonly clientId;
|
|
549
|
+
private readonly consumerId;
|
|
550
|
+
private readonly projectId;
|
|
551
|
+
private readonly workspaceId;
|
|
552
|
+
private readonly accessToken;
|
|
553
|
+
private readonly listService;
|
|
554
|
+
private readonly getService;
|
|
555
|
+
private readonly createService;
|
|
556
|
+
private readonly deleteService;
|
|
557
|
+
constructor(clientId: string, consumerId: string, projectId: string, workspaceId: string, accessToken: string);
|
|
558
|
+
list(providerId: string): Promise<EventMetadata[]>;
|
|
559
|
+
get(providerId: string, eventCode: string): Promise<EventMetadata>;
|
|
560
|
+
create(providerId: string, eventMetadataData: EventMetadataInputModel): Promise<EventMetadata>;
|
|
561
|
+
delete(providerId: string, eventCode?: string): Promise<void>;
|
|
562
|
+
}
|
|
563
|
+
|
|
564
|
+
interface EventsOfInterestInputModel {
|
|
565
|
+
provider_id: string;
|
|
566
|
+
event_code: string;
|
|
567
|
+
}
|
|
568
|
+
interface RegistrationCreateModel {
|
|
569
|
+
client_id: string;
|
|
570
|
+
name: string;
|
|
571
|
+
description?: string;
|
|
572
|
+
webhook_url?: string;
|
|
573
|
+
events_of_interest: EventsOfInterestInputModel[];
|
|
574
|
+
delivery_type: 'webhook' | 'webhook_batch' | 'journal' | 'aws_eventbridge';
|
|
575
|
+
runtime_action?: string;
|
|
576
|
+
enabled?: boolean;
|
|
577
|
+
}
|
|
578
|
+
|
|
579
|
+
interface RegistrationListResponse {
|
|
580
|
+
_embedded?: {
|
|
581
|
+
registrations?: Registration[];
|
|
582
|
+
};
|
|
583
|
+
_links?: {
|
|
584
|
+
self?: {
|
|
585
|
+
href: string;
|
|
586
|
+
};
|
|
587
|
+
next?: {
|
|
588
|
+
href: string;
|
|
589
|
+
};
|
|
590
|
+
};
|
|
591
|
+
[key: string]: any;
|
|
592
|
+
}
|
|
593
|
+
interface ListRegistrationQueryParams {
|
|
594
|
+
[key: string]: string | number | boolean | undefined;
|
|
595
|
+
}
|
|
596
|
+
|
|
597
|
+
declare class RegistrationManager {
|
|
598
|
+
private createService;
|
|
599
|
+
private deleteService;
|
|
600
|
+
private getService;
|
|
601
|
+
private listService;
|
|
602
|
+
constructor(clientId: string, consumerId: string, projectId: string, workspaceId: string, accessToken: string);
|
|
603
|
+
create(registrationData: RegistrationCreateModel): Promise<Registration>;
|
|
604
|
+
delete(registrationId: string): Promise<void>;
|
|
605
|
+
get(registrationId: string): Promise<Registration>;
|
|
606
|
+
list(queryParams?: ListRegistrationQueryParams): Promise<Registration[]>;
|
|
607
|
+
}
|
|
608
|
+
|
|
609
|
+
interface EventMetadataListResponse {
|
|
610
|
+
_embedded?: {
|
|
611
|
+
eventmetadata: EventMetadata[];
|
|
612
|
+
};
|
|
613
|
+
_links?: {
|
|
614
|
+
self?: {
|
|
615
|
+
href: string;
|
|
616
|
+
};
|
|
617
|
+
next?: {
|
|
618
|
+
href: string;
|
|
619
|
+
};
|
|
620
|
+
};
|
|
621
|
+
[key: string]: any;
|
|
622
|
+
}
|
|
623
|
+
|
|
624
|
+
interface GetRegistrationQueryParams {
|
|
625
|
+
consumerOrgId: string;
|
|
626
|
+
projectId: string;
|
|
627
|
+
workspaceId: string;
|
|
628
|
+
registrationId: string;
|
|
629
|
+
}
|
|
630
|
+
|
|
631
|
+
export { AdobeAuth, AdobeCommerceClient, type AdobeIMSConfig, BasicAuthConnection, BearerToken, type BearerTokenInfo, type Connection, type CreateEventResult, CreateEvents, type CreateProviderParams, type CreateProviderResult, type CreateRegistrationResult, CreateRegistrations, type ErrorResponse, EventConsumerAction, type EventMetadata, type EventMetadataInputModel, type EventMetadataListResponse, EventMetadataManager, type ExtendedRequestError, 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, Oauth1aConnection, OnboardEvents, type OnboardEventsInput, type OnboardEventsResponse, Openwhisk, OpenwhiskAction, Parameters, type Provider, type ProviderInputModel, ProviderManager, type Registration, type RegistrationCreateModel, type RegistrationListResponse, RegistrationManager, RestClient, RuntimeAction, RuntimeActionResponse, type RuntimeActionResponseType, type SuccessResponse, type TokenResult, Validator };
|