@plentymarkets/shop-api 0.177.0 → 0.178.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/lib/__tests__/__fixtures__/PayPalTransaction.d.ts.map +1 -1
- package/lib/__tests__/integration/__config__/sdk.config.d.ts +1 -1
- package/lib/api/__tests__/unit/doGenerateAiTextBlock.unit.spec.d.ts +2 -0
- package/lib/api/__tests__/unit/doGenerateAiTextBlock.unit.spec.d.ts.map +1 -0
- package/lib/api/doGenerateAiTextBlock/index.d.ts +13 -0
- package/lib/api/doGenerateAiTextBlock/index.d.ts.map +1 -0
- package/lib/api/index.d.ts +1 -0
- package/lib/api/index.d.ts.map +1 -1
- package/lib/helpers/index.d.ts +0 -1
- package/lib/helpers/index.d.ts.map +1 -1
- package/lib/index.cjs.js +39 -4
- package/lib/index.cjs.js.map +1 -1
- package/lib/index.es.js +39 -5
- package/lib/index.es.js.map +1 -1
- package/lib/index.server.d.ts.map +1 -1
- package/lib/types/api/aiTextBlock.d.ts +14 -0
- package/lib/types/api/aiTextBlock.d.ts.map +1 -0
- package/lib/types/api/endpoints.d.ts +1 -4
- package/lib/types/api/endpoints.d.ts.map +1 -1
- package/lib/types/api/index.d.ts +1 -1
- package/lib/types/api/index.d.ts.map +1 -1
- package/lib/types/api/paypal.d.ts +1 -0
- package/lib/types/api/paypal.d.ts.map +1 -1
- package/lib/types/config/index.d.ts +0 -12
- package/lib/types/config/index.d.ts.map +1 -1
- package/package.json +3 -3
- package/server/__tests__/__fixtures__/PayPalTransaction.d.ts.map +1 -1
- package/server/__tests__/integration/__config__/sdk.config.d.ts +1 -1
- package/server/api/__tests__/unit/doGenerateAiTextBlock.unit.spec.d.ts +2 -0
- package/server/api/__tests__/unit/doGenerateAiTextBlock.unit.spec.d.ts.map +1 -0
- package/server/api/doGenerateAiTextBlock/index.d.ts +13 -0
- package/server/api/doGenerateAiTextBlock/index.d.ts.map +1 -0
- package/server/api/index.d.ts +1 -0
- package/server/api/index.d.ts.map +1 -1
- package/server/helpers/index.d.ts +0 -1
- package/server/helpers/index.d.ts.map +1 -1
- package/server/index.d.ts.map +1 -1
- package/server/index.js +40 -205
- package/server/index.js.map +1 -1
- package/server/types/api/aiTextBlock.d.ts +14 -0
- package/server/types/api/aiTextBlock.d.ts.map +1 -0
- package/server/types/api/endpoints.d.ts +1 -4
- package/server/types/api/endpoints.d.ts.map +1 -1
- package/server/types/api/index.d.ts +1 -1
- package/server/types/api/index.d.ts.map +1 -1
- package/server/types/api/paypal.d.ts +1 -0
- package/server/types/api/paypal.d.ts.map +1 -1
- package/server/types/config/index.d.ts +0 -12
- package/server/types/config/index.d.ts.map +1 -1
- package/lib/api/doInvokeCoreSupervisor/index.d.ts +0 -40
- package/lib/api/doInvokeCoreSupervisor/index.d.ts.map +0 -1
- package/lib/helpers/coreSupervisor.helper.d.ts +0 -6
- package/lib/helpers/coreSupervisor.helper.d.ts.map +0 -1
- package/lib/types/api/coreSupervisor.d.ts +0 -56
- package/lib/types/api/coreSupervisor.d.ts.map +0 -1
- package/server/api/doInvokeCoreSupervisor/index.d.ts +0 -40
- package/server/api/doInvokeCoreSupervisor/index.d.ts.map +0 -1
- package/server/helpers/coreSupervisor.helper.d.ts +0 -6
- package/server/helpers/coreSupervisor.helper.d.ts.map +0 -1
- package/server/types/api/coreSupervisor.d.ts +0 -56
- package/server/types/api/coreSupervisor.d.ts.map +0 -1
package/server/index.js
CHANGED
|
@@ -5,7 +5,6 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
var axios = require('axios');
|
|
6
6
|
var middleware = require('@vue-storefront/middleware');
|
|
7
7
|
var consola = require('consola');
|
|
8
|
-
var clientBedrockAgentcore = require('@aws-sdk/client-bedrock-agentcore');
|
|
9
8
|
|
|
10
9
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
11
10
|
|
|
@@ -300,108 +299,6 @@ const transformProductItem = (product) => {
|
|
|
300
299
|
};
|
|
301
300
|
};
|
|
302
301
|
|
|
303
|
-
const slugifyUser = (username) => username
|
|
304
|
-
.toLowerCase()
|
|
305
|
-
.normalize('NFD')
|
|
306
|
-
.replace(/[̀-ͯ]/g, '')
|
|
307
|
-
.replace(/ /g, '-');
|
|
308
|
-
const decodeStream = async (stream) => {
|
|
309
|
-
const decoder = new TextDecoder();
|
|
310
|
-
let data = '';
|
|
311
|
-
for await (const evt of stream) {
|
|
312
|
-
const candidate = evt;
|
|
313
|
-
const bytes = candidate?.chunk?.bytes ??
|
|
314
|
-
candidate?.bytes ??
|
|
315
|
-
(evt instanceof Uint8Array ? evt : undefined);
|
|
316
|
-
if (bytes) {
|
|
317
|
-
data += decoder.decode(bytes, { stream: true });
|
|
318
|
-
}
|
|
319
|
-
}
|
|
320
|
-
data += decoder.decode();
|
|
321
|
-
return data;
|
|
322
|
-
};
|
|
323
|
-
const extractTextFromSse = (raw) => {
|
|
324
|
-
const trimmed = raw.trim();
|
|
325
|
-
if (!trimmed) {
|
|
326
|
-
return '';
|
|
327
|
-
}
|
|
328
|
-
const lines = trimmed.split(/\r?\n/);
|
|
329
|
-
const payloadLines = [];
|
|
330
|
-
let hasSseFields = false;
|
|
331
|
-
for (const line of lines) {
|
|
332
|
-
const normalized = line.trim();
|
|
333
|
-
if (normalized === '') {
|
|
334
|
-
continue;
|
|
335
|
-
}
|
|
336
|
-
if (normalized.startsWith('data:')) {
|
|
337
|
-
hasSseFields = true;
|
|
338
|
-
const payload = normalized.slice('data:'.length).trimStart();
|
|
339
|
-
try {
|
|
340
|
-
const parsed = JSON.parse(payload);
|
|
341
|
-
payloadLines.push(typeof parsed === 'string' ? parsed : JSON.stringify(parsed));
|
|
342
|
-
}
|
|
343
|
-
catch {
|
|
344
|
-
payloadLines.push(payload);
|
|
345
|
-
}
|
|
346
|
-
continue;
|
|
347
|
-
}
|
|
348
|
-
if (/^(event|id|retry):/.test(normalized)) {
|
|
349
|
-
hasSseFields = true;
|
|
350
|
-
continue;
|
|
351
|
-
}
|
|
352
|
-
if (!hasSseFields) {
|
|
353
|
-
return trimmed;
|
|
354
|
-
}
|
|
355
|
-
payloadLines.push(line);
|
|
356
|
-
}
|
|
357
|
-
if (!hasSseFields) {
|
|
358
|
-
return trimmed;
|
|
359
|
-
}
|
|
360
|
-
return payloadLines.join('\n').trim();
|
|
361
|
-
};
|
|
362
|
-
const addAgentcoreCustomHeaders = (command, headers) => {
|
|
363
|
-
const stack = command.middlewareStack;
|
|
364
|
-
stack.addRelativeTo((next) => async (args) => {
|
|
365
|
-
args.request.headers = args.request.headers ?? {};
|
|
366
|
-
args.request.headers['X-Amzn-Bedrock-AgentCore-Runtime-Custom-Plenty-Auth-Token'] = headers.authToken || 'authToken';
|
|
367
|
-
args.request.headers['X-Amzn-Bedrock-AgentCore-Runtime-Custom-Plenty-Id'] = headers.plentyId;
|
|
368
|
-
args.request.headers['X-Amzn-Bedrock-AgentCore-Runtime-Custom-Role'] =
|
|
369
|
-
headers.role;
|
|
370
|
-
args.request.headers['X-Amzn-Bedrock-AgentCore-Runtime-Custom-Basic-Consent'] = headers.basicConsent ? 'true' : 'false';
|
|
371
|
-
args.request.headers['X-Amzn-Bedrock-AgentCore-Runtime-Custom-Advanced-Consent'] = headers.advancedConsent ? 'true' : 'false';
|
|
372
|
-
return next(args);
|
|
373
|
-
}, {
|
|
374
|
-
relation: 'before',
|
|
375
|
-
toMiddleware: 'awsAuthMiddleware',
|
|
376
|
-
name: 'agentcoreCustomHeaderMiddleware',
|
|
377
|
-
});
|
|
378
|
-
};
|
|
379
|
-
const DEFAULT_REGION = 'eu-central-1';
|
|
380
|
-
const DEFAULT_QUALIFIER = 'production';
|
|
381
|
-
const invokeAgentRuntime = async (options) => {
|
|
382
|
-
if (!options.runtimeArn) {
|
|
383
|
-
throw new ApiError({
|
|
384
|
-
key: 'missingConfig',
|
|
385
|
-
code: '500',
|
|
386
|
-
message: 'Core Supervisor runtimeArn is not configured.',
|
|
387
|
-
cause: 'api.coreSupervisor.runtimeArn',
|
|
388
|
-
});
|
|
389
|
-
}
|
|
390
|
-
const region = options.region || DEFAULT_REGION;
|
|
391
|
-
const runtimeArn = options.runtimeArn;
|
|
392
|
-
const qualifier = options.qualifier || DEFAULT_QUALIFIER;
|
|
393
|
-
const client = new clientBedrockAgentcore.BedrockAgentCoreClient({ region });
|
|
394
|
-
const command = new clientBedrockAgentcore.InvokeAgentRuntimeCommand({
|
|
395
|
-
runtimeSessionId: options.sessionId,
|
|
396
|
-
agentRuntimeArn: runtimeArn,
|
|
397
|
-
qualifier,
|
|
398
|
-
payload: new TextEncoder().encode(JSON.stringify(options.payload)),
|
|
399
|
-
});
|
|
400
|
-
addAgentcoreCustomHeaders(command, options.customHeaders);
|
|
401
|
-
const response = await client.send(command);
|
|
402
|
-
return response.response;
|
|
403
|
-
};
|
|
404
|
-
|
|
405
302
|
/**
|
|
406
303
|
* Method getProduct - Used to get product instance.
|
|
407
304
|
*
|
|
@@ -1673,10 +1570,11 @@ const getFacet = async (context, params) => {
|
|
|
1673
1570
|
}
|
|
1674
1571
|
const { data: response } = await context.client.get(url.href);
|
|
1675
1572
|
const itemList = response.data.itemList;
|
|
1676
|
-
if (!itemList) {
|
|
1573
|
+
if (!itemList && params.type !== 'last_seen') {
|
|
1677
1574
|
throw new Error('Category not found');
|
|
1678
1575
|
}
|
|
1679
|
-
const products = itemList
|
|
1576
|
+
const products = itemList?.documents.map((document) => document.data) ??
|
|
1577
|
+
[];
|
|
1680
1578
|
const facet = {
|
|
1681
1579
|
category: response.data.category,
|
|
1682
1580
|
products: products,
|
|
@@ -1685,7 +1583,7 @@ const getFacet = async (context, params) => {
|
|
|
1685
1583
|
breadcrumbs: response.data.breadcrumbs ?? [],
|
|
1686
1584
|
pagination: {
|
|
1687
1585
|
perPageOptions: [20, 40, 100],
|
|
1688
|
-
totals: itemList
|
|
1586
|
+
totals: itemList?.total ?? 0,
|
|
1689
1587
|
},
|
|
1690
1588
|
};
|
|
1691
1589
|
return { data: facet };
|
|
@@ -4430,7 +4328,41 @@ const doAddLastSeen = async (context, variationId) => {
|
|
|
4430
4328
|
return { data: response.data };
|
|
4431
4329
|
};
|
|
4432
4330
|
|
|
4433
|
-
|
|
4331
|
+
/**
|
|
4332
|
+
* Method doGenerateAiTextBlock - posts to the AI text-block endpoint.
|
|
4333
|
+
*
|
|
4334
|
+
* @remarks
|
|
4335
|
+
* Calls `POST {api.url}/rest/storefront/ai/text-block` and returns the
|
|
4336
|
+
* assistant text in `{text}`.
|
|
4337
|
+
*
|
|
4338
|
+
* @alpha
|
|
4339
|
+
*/
|
|
4340
|
+
const doGenerateAiTextBlock = async (context, params) => {
|
|
4341
|
+
const url = new URL('rest/storefront/ai/text-block', context.config.api.url);
|
|
4342
|
+
try {
|
|
4343
|
+
const { data } = await context.client.post(url.href, {
|
|
4344
|
+
prompt: params.prompt,
|
|
4345
|
+
sessionId: params.sessionId,
|
|
4346
|
+
user: params.user,
|
|
4347
|
+
pid: params.pid,
|
|
4348
|
+
});
|
|
4349
|
+
return { data: { text: data?.data?.text ?? '' } };
|
|
4350
|
+
}
|
|
4351
|
+
catch (error) {
|
|
4352
|
+
if (error instanceof ApiError) {
|
|
4353
|
+
throw error;
|
|
4354
|
+
}
|
|
4355
|
+
const message = error?.message ?? 'AI text-block invocation failed';
|
|
4356
|
+
throw new ApiError({
|
|
4357
|
+
key: 'unknownError',
|
|
4358
|
+
code: '500',
|
|
4359
|
+
message,
|
|
4360
|
+
cause: error,
|
|
4361
|
+
});
|
|
4362
|
+
}
|
|
4363
|
+
};
|
|
4364
|
+
|
|
4365
|
+
var api = /*#__PURE__*/Object.freeze({
|
|
4434
4366
|
__proto__: null,
|
|
4435
4367
|
getProduct: getProduct,
|
|
4436
4368
|
getProductsByIds: getProductsByIds,
|
|
@@ -4566,6 +4498,7 @@ var clientApi = /*#__PURE__*/Object.freeze({
|
|
|
4566
4498
|
getPreviewValid: getPreviewValid,
|
|
4567
4499
|
setOrderPaymentMethod: setOrderPaymentMethod,
|
|
4568
4500
|
doAddLastSeen: doAddLastSeen,
|
|
4501
|
+
doGenerateAiTextBlock: doGenerateAiTextBlock,
|
|
4569
4502
|
doCreatePayPalOrder: doCreatePayPalOrder,
|
|
4570
4503
|
doCreatePlentyPaymentFromPayPalOrder: doCreatePlentyPaymentFromPayPalOrder,
|
|
4571
4504
|
getPayPalOrder: getPayPalOrder,
|
|
@@ -4578,103 +4511,6 @@ var clientApi = /*#__PURE__*/Object.freeze({
|
|
|
4578
4511
|
getPayPalApplePayTransactionInfo: getPayPalApplePayTransactionInfo
|
|
4579
4512
|
});
|
|
4580
4513
|
|
|
4581
|
-
/**
|
|
4582
|
-
* Method doInvokeCoreSupervisor - invokes the Core Supervisor agent runtime.
|
|
4583
|
-
*
|
|
4584
|
-
* @remarks
|
|
4585
|
-
* * Forwards plenty-specific custom headers (auth token, plenty id, role,
|
|
4586
|
-
* consents) on the signed request to the agent runtime.
|
|
4587
|
-
* * Decodes the Server-Sent-Events stream returned by the runtime and returns
|
|
4588
|
-
* the concatenated assistant text.
|
|
4589
|
-
*
|
|
4590
|
-
* @param { DoInvokeCoreSupervisorParams } params
|
|
4591
|
-
* prompt: prompt to send to the agent.
|
|
4592
|
-
* sessionId: id used as the runtime session id (drives short-term memory).
|
|
4593
|
-
* plentyId: tenant id.
|
|
4594
|
-
* user: customer-facing user identifier (slugged into the payload `user_id`).
|
|
4595
|
-
* authToken: plentymarkets auth token, forwarded as a custom header.
|
|
4596
|
-
* coreFunctionality: agent role; defaults to `'core-supervisor'`.
|
|
4597
|
-
* basicConsent / advancedConsent: consent flags, default to `true`.
|
|
4598
|
-
* qualifier: runtime qualifier override (defaults to config / `'production'`).
|
|
4599
|
-
*
|
|
4600
|
-
* @returns
|
|
4601
|
-
* The assistant reply text wrapped in the standard `Data` envelope.
|
|
4602
|
-
*
|
|
4603
|
-
* @example
|
|
4604
|
-
* ``` ts
|
|
4605
|
-
* const { data } = await useSdk().plentysystems.doInvokeCoreSupervisor({
|
|
4606
|
-
* prompt: 'How do I create a new product?',
|
|
4607
|
-
* sessionId: 'abc-123',
|
|
4608
|
-
* plentyId: 12345,
|
|
4609
|
-
* user: 'jane.doe',
|
|
4610
|
-
* authToken: 'eyJhbGciOi...',
|
|
4611
|
-
* });
|
|
4612
|
-
* console.log(data.text);
|
|
4613
|
-
* ```
|
|
4614
|
-
*
|
|
4615
|
-
* @alpha
|
|
4616
|
-
*/
|
|
4617
|
-
const doInvokeCoreSupervisor = async (context, params) => {
|
|
4618
|
-
const config = context.config.api.coreSupervisor;
|
|
4619
|
-
const coreFunctionality = params.coreFunctionality ?? 'core-cms-text-block';
|
|
4620
|
-
const pid = '';
|
|
4621
|
-
const clientId = `${pid}-${slugifyUser(params.user)}`;
|
|
4622
|
-
try {
|
|
4623
|
-
if (process.env.PLENTY_SDK_PLAYGROUND !== 'true') {
|
|
4624
|
-
const preview = await getPreviewValid(context);
|
|
4625
|
-
if (!preview.data?.valid) {
|
|
4626
|
-
throw new ApiError({
|
|
4627
|
-
key: 'previewInvalid',
|
|
4628
|
-
code: '403',
|
|
4629
|
-
message: 'Preview session is not valid.',
|
|
4630
|
-
cause: 'preview/valid',
|
|
4631
|
-
});
|
|
4632
|
-
}
|
|
4633
|
-
}
|
|
4634
|
-
const stream = await invokeAgentRuntime({
|
|
4635
|
-
region: config?.region,
|
|
4636
|
-
runtimeArn: config?.runtimeArn,
|
|
4637
|
-
qualifier: params.qualifier ?? config?.qualifier,
|
|
4638
|
-
sessionId: params.sessionId,
|
|
4639
|
-
payload: {
|
|
4640
|
-
prompt: params.prompt,
|
|
4641
|
-
// eslint-disable-next-line camelcase
|
|
4642
|
-
user_id: clientId,
|
|
4643
|
-
},
|
|
4644
|
-
customHeaders: {
|
|
4645
|
-
authToken: params.authToken,
|
|
4646
|
-
plentyId: pid,
|
|
4647
|
-
role: coreFunctionality,
|
|
4648
|
-
basicConsent: params.basicConsent ?? true,
|
|
4649
|
-
advancedConsent: params.advancedConsent ?? true,
|
|
4650
|
-
},
|
|
4651
|
-
});
|
|
4652
|
-
if (!stream) {
|
|
4653
|
-
throw new ApiError({
|
|
4654
|
-
key: 'emptyResponse',
|
|
4655
|
-
code: '502',
|
|
4656
|
-
message: 'No response stream from the agent runtime.',
|
|
4657
|
-
cause: '',
|
|
4658
|
-
});
|
|
4659
|
-
}
|
|
4660
|
-
const raw = await decodeStream(stream);
|
|
4661
|
-
const text = extractTextFromSse(raw);
|
|
4662
|
-
return { data: { text } };
|
|
4663
|
-
}
|
|
4664
|
-
catch (error) {
|
|
4665
|
-
if (error instanceof ApiError) {
|
|
4666
|
-
throw error;
|
|
4667
|
-
}
|
|
4668
|
-
const message = error?.message ?? 'Core Supervisor invocation failed';
|
|
4669
|
-
throw new ApiError({
|
|
4670
|
-
key: 'unknownError',
|
|
4671
|
-
code: '500',
|
|
4672
|
-
message,
|
|
4673
|
-
cause: error,
|
|
4674
|
-
});
|
|
4675
|
-
}
|
|
4676
|
-
};
|
|
4677
|
-
|
|
4678
4514
|
const PlentyIdCookie = 'plentyID';
|
|
4679
4515
|
const PwaSessionIdCookie = 'pwa-session-id';
|
|
4680
4516
|
const FORWARD_HEADERS_KEYS = [
|
|
@@ -4855,7 +4691,6 @@ const onResponseWrapper = (response, config) => {
|
|
|
4855
4691
|
return response;
|
|
4856
4692
|
};
|
|
4857
4693
|
|
|
4858
|
-
const api = { ...clientApi, doInvokeCoreSupervisor };
|
|
4859
4694
|
const buildClient = (config) => {
|
|
4860
4695
|
const client = axios__default["default"].create({
|
|
4861
4696
|
withCredentials: true,
|
package/server/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Role passed to the backend as `coreFunctionality`.
|
|
3
|
+
*/
|
|
4
|
+
export type CoreFunctionality = 'core-support' | 'core-supervisor' | 'core-cms-text-block';
|
|
5
|
+
export interface DoGenerateAiTextBlockParams {
|
|
6
|
+
prompt: string;
|
|
7
|
+
sessionId: string;
|
|
8
|
+
user: string;
|
|
9
|
+
pid: number;
|
|
10
|
+
}
|
|
11
|
+
export interface AiTextBlockResponse {
|
|
12
|
+
text: string;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=aiTextBlock.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"aiTextBlock.d.ts","sourceRoot":"","sources":["../../../src/types/api/aiTextBlock.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,iBAAiB,GACzB,cAAc,GACd,iBAAiB,GACjB,qBAAqB,CAAC;AAE1B,MAAM,WAAW,2BAA2B;IAC1C,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,CAAC;CACd"}
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import { type WithoutContext } from '@vue-storefront/middleware';
|
|
2
2
|
import * as apiMethods from '../../api';
|
|
3
|
-
|
|
4
|
-
export type ApiMethods = typeof apiMethods & {
|
|
5
|
-
doInvokeCoreSupervisor: typeof doInvokeCoreSupervisor;
|
|
6
|
-
};
|
|
3
|
+
export type ApiMethods = typeof apiMethods;
|
|
7
4
|
export type Endpoints = WithoutContext<ApiMethods>;
|
|
8
5
|
//# sourceMappingURL=endpoints.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"endpoints.d.ts","sourceRoot":"","sources":["../../../src/types/api/endpoints.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,KAAK,UAAU,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"endpoints.d.ts","sourceRoot":"","sources":["../../../src/types/api/endpoints.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,KAAK,UAAU,MAAM,WAAW,CAAC;AAExC,MAAM,MAAM,UAAU,GAAG,OAAO,UAAU,CAAC;AAE3C,MAAM,MAAM,SAAS,GAAG,cAAc,CAAC,UAAU,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/api/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,yBAAyB,CAAC;AACxC,cAAc,cAAc,CA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AAM,CAAC;KAChB,EAAE,CAAC;CACL,CAAC"}
|
|
@@ -13,18 +13,6 @@ export interface MiddlewareConfig {
|
|
|
13
13
|
queryParams?: {
|
|
14
14
|
[key: string]: string | null | undefined;
|
|
15
15
|
};
|
|
16
|
-
/**
|
|
17
|
-
* Core Supervisor agent runtime targeted by `doInvokeCoreSupervisor`.
|
|
18
|
-
* All fields are optional; built-in defaults are used when unset.
|
|
19
|
-
*/
|
|
20
|
-
coreSupervisor?: {
|
|
21
|
-
/** Region of the agent runtime, e.g. `'eu-central-1'`. */
|
|
22
|
-
region?: string;
|
|
23
|
-
/** Full runtime ARN. */
|
|
24
|
-
runtimeArn?: string;
|
|
25
|
-
/** Default qualifier (alias) to invoke. Defaults to `'production'`. */
|
|
26
|
-
qualifier?: string;
|
|
27
|
-
};
|
|
28
16
|
};
|
|
29
17
|
_middlewareRequestHeaders?: {
|
|
30
18
|
[key: string]: string | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/config/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAEtC;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,GAAG,EAAE;QACH,GAAG,EAAE,MAAM,CAAC;QACZ,aAAa,EAAE,MAAM,GAAG,SAAS,CAAC;QAClC,KAAK,CAAC,EAAE,OAAO,CAAC;QAChB,YAAY,CAAC,EAAE;YACb,iBAAiB,CAAC,EAAE,OAAO,CAAC;SAC7B,CAAC;QACF,WAAW,CAAC,EAAE;YACZ,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;SAC1C,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/config/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAEtC;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,GAAG,EAAE;QACH,GAAG,EAAE,MAAM,CAAC;QACZ,aAAa,EAAE,MAAM,GAAG,SAAS,CAAC;QAClC,KAAK,CAAC,EAAE,OAAO,CAAC;QAChB,YAAY,CAAC,EAAE;YACb,iBAAiB,CAAC,EAAE,OAAO,CAAC;SAC7B,CAAC;QACF,WAAW,CAAC,EAAE;YACZ,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;SAC1C,CAAC;KACH,CAAC;IACF,yBAAyB,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAA;KAAE,CAAC;IAClE,mBAAmB,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,CAAA;KAAE,CAAC;IACvE,UAAU,CAAC,EAAE,YAAY,GAAG,SAAS,CAAC;CACvC"}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { CoreSupervisorResponse, Data, DoInvokeCoreSupervisorParams } from '../../types/api';
|
|
2
|
-
import { PlentysystemsIntegrationContext } from '../../types/context';
|
|
3
|
-
/**
|
|
4
|
-
* Method doInvokeCoreSupervisor - invokes the Core Supervisor agent runtime.
|
|
5
|
-
*
|
|
6
|
-
* @remarks
|
|
7
|
-
* * Forwards plenty-specific custom headers (auth token, plenty id, role,
|
|
8
|
-
* consents) on the signed request to the agent runtime.
|
|
9
|
-
* * Decodes the Server-Sent-Events stream returned by the runtime and returns
|
|
10
|
-
* the concatenated assistant text.
|
|
11
|
-
*
|
|
12
|
-
* @param { DoInvokeCoreSupervisorParams } params
|
|
13
|
-
* prompt: prompt to send to the agent.
|
|
14
|
-
* sessionId: id used as the runtime session id (drives short-term memory).
|
|
15
|
-
* plentyId: tenant id.
|
|
16
|
-
* user: customer-facing user identifier (slugged into the payload `user_id`).
|
|
17
|
-
* authToken: plentymarkets auth token, forwarded as a custom header.
|
|
18
|
-
* coreFunctionality: agent role; defaults to `'core-supervisor'`.
|
|
19
|
-
* basicConsent / advancedConsent: consent flags, default to `true`.
|
|
20
|
-
* qualifier: runtime qualifier override (defaults to config / `'production'`).
|
|
21
|
-
*
|
|
22
|
-
* @returns
|
|
23
|
-
* The assistant reply text wrapped in the standard `Data` envelope.
|
|
24
|
-
*
|
|
25
|
-
* @example
|
|
26
|
-
* ``` ts
|
|
27
|
-
* const { data } = await useSdk().plentysystems.doInvokeCoreSupervisor({
|
|
28
|
-
* prompt: 'How do I create a new product?',
|
|
29
|
-
* sessionId: 'abc-123',
|
|
30
|
-
* plentyId: 12345,
|
|
31
|
-
* user: 'jane.doe',
|
|
32
|
-
* authToken: 'eyJhbGciOi...',
|
|
33
|
-
* });
|
|
34
|
-
* console.log(data.text);
|
|
35
|
-
* ```
|
|
36
|
-
*
|
|
37
|
-
* @alpha
|
|
38
|
-
*/
|
|
39
|
-
export declare const doInvokeCoreSupervisor: (context: PlentysystemsIntegrationContext, params: DoInvokeCoreSupervisorParams) => Promise<Data<CoreSupervisorResponse>>;
|
|
40
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/api/doInvokeCoreSupervisor/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,sBAAsB,EACtB,IAAI,EACJ,4BAA4B,EAC7B,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,+BAA+B,EAAE,MAAM,qBAAqB,CAAC;AAStE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,eAAO,MAAM,sBAAsB,GACjC,SAAS,+BAA+B,EACxC,QAAQ,4BAA4B,KACnC,OAAO,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAmEtC,CAAC"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { InvokeAgentRuntimeOptions } from '../types/api';
|
|
2
|
-
export declare const slugifyUser: (username: string) => string;
|
|
3
|
-
export declare const decodeStream: (stream: AsyncIterable<unknown>) => Promise<string>;
|
|
4
|
-
export declare const extractTextFromSse: (raw: string) => string;
|
|
5
|
-
export declare const invokeAgentRuntime: (options: InvokeAgentRuntimeOptions) => Promise<AsyncIterable<unknown> | undefined>;
|
|
6
|
-
//# sourceMappingURL=coreSupervisor.helper.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"coreSupervisor.helper.d.ts","sourceRoot":"","sources":["../../src/helpers/coreSupervisor.helper.ts"],"names":[],"mappings":"AAIA,OAAO,EAGL,yBAAyB,EAC1B,MAAM,cAAc,CAAC;AAgBtB,eAAO,MAAM,WAAW,GAAI,UAAU,MAAM,KAAG,MAKxB,CAAC;AAExB,eAAO,MAAM,YAAY,GACvB,QAAQ,aAAa,CAAC,OAAO,CAAC,KAC7B,OAAO,CAAC,MAAM,CAkBhB,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAAI,KAAK,MAAM,KAAG,MAgDhD,CAAC;AAuCF,eAAO,MAAM,kBAAkB,GAC7B,SAAS,yBAAyB,KACjC,OAAO,CAAC,aAAa,CAAC,OAAO,CAAC,GAAG,SAAS,CAwB5C,CAAC"}
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Role passed to the Bedrock AgentCore runtime via the
|
|
3
|
-
* `X-Amzn-Bedrock-AgentCore-Runtime-Custom-Role` header.
|
|
4
|
-
*/
|
|
5
|
-
export type CoreFunctionality = 'core-support' | 'core-supervisor' | 'core-cms-text-block';
|
|
6
|
-
export interface DoInvokeCoreSupervisorParams {
|
|
7
|
-
/** Prompt forwarded to the agent. */
|
|
8
|
-
prompt: string;
|
|
9
|
-
/** Stable id reused for the runtime session (drives short-term memory). */
|
|
10
|
-
sessionId: string;
|
|
11
|
-
/** Tenant id; forwarded as a custom header and used to build the client id. */
|
|
12
|
-
plentyId: number;
|
|
13
|
-
/** Human-readable user identifier; slugged into the `user_id` payload field. */
|
|
14
|
-
user: string;
|
|
15
|
-
/** plentymarkets auth token forwarded as a custom header for the agent's tools. */
|
|
16
|
-
authToken: string;
|
|
17
|
-
/** Agent role. Defaults to `'core-supervisor'`. */
|
|
18
|
-
coreFunctionality?: CoreFunctionality;
|
|
19
|
-
/** Forwarded as the basic-consent custom header. Defaults to `true`. */
|
|
20
|
-
basicConsent?: boolean;
|
|
21
|
-
/** Forwarded as the advanced-consent custom header. Defaults to `true`. */
|
|
22
|
-
advancedConsent?: boolean;
|
|
23
|
-
/**
|
|
24
|
-
* Runtime qualifier override (e.g. `'development'`).
|
|
25
|
-
* Defaults to `api.coreSupervisor.qualifier` or `'production'`.
|
|
26
|
-
*/
|
|
27
|
-
qualifier?: string;
|
|
28
|
-
}
|
|
29
|
-
export interface CoreSupervisorResponse {
|
|
30
|
-
/** Parsed assistant reply (SSE payload concatenated). */
|
|
31
|
-
text: string;
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* Custom header values forwarded with the agent runtime request.
|
|
35
|
-
*/
|
|
36
|
-
export interface AgentcoreCustomHeaders {
|
|
37
|
-
authToken: string;
|
|
38
|
-
plentyId: string;
|
|
39
|
-
role: string;
|
|
40
|
-
basicConsent: boolean;
|
|
41
|
-
advancedConsent: boolean;
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* Options for invoking the Core Supervisor agent runtime.
|
|
45
|
-
* `region`, `runtimeArn`, and `qualifier` fall back to built-in defaults
|
|
46
|
-
* when omitted.
|
|
47
|
-
*/
|
|
48
|
-
export interface InvokeAgentRuntimeOptions {
|
|
49
|
-
region?: string;
|
|
50
|
-
runtimeArn?: string;
|
|
51
|
-
qualifier?: string;
|
|
52
|
-
sessionId: string;
|
|
53
|
-
payload: unknown;
|
|
54
|
-
customHeaders: AgentcoreCustomHeaders;
|
|
55
|
-
}
|
|
56
|
-
//# sourceMappingURL=coreSupervisor.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"coreSupervisor.d.ts","sourceRoot":"","sources":["../../../src/types/api/coreSupervisor.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,MAAM,iBAAiB,GACzB,cAAc,GACd,iBAAiB,GACjB,qBAAqB,CAAC;AAE1B,MAAM,WAAW,4BAA4B;IAC3C,qCAAqC;IACrC,MAAM,EAAE,MAAM,CAAC;IACf,2EAA2E;IAC3E,SAAS,EAAE,MAAM,CAAC;IAClB,+EAA+E;IAC/E,QAAQ,EAAE,MAAM,CAAC;IACjB,gFAAgF;IAChF,IAAI,EAAE,MAAM,CAAC;IACb,mFAAmF;IACnF,SAAS,EAAE,MAAM,CAAC;IAClB,mDAAmD;IACnD,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;IACtC,wEAAwE;IACxE,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,2EAA2E;IAC3E,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,sBAAsB;IACrC,yDAAyD;IACzD,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,OAAO,CAAC;IACtB,eAAe,EAAE,OAAO,CAAC;CAC1B;AAED;;;;GAIG;AACH,MAAM,WAAW,yBAAyB;IACxC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC;IACjB,aAAa,EAAE,sBAAsB,CAAC;CACvC"}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { CoreSupervisorResponse, Data, DoInvokeCoreSupervisorParams } from '../../types/api';
|
|
2
|
-
import { PlentysystemsIntegrationContext } from '../../types/context';
|
|
3
|
-
/**
|
|
4
|
-
* Method doInvokeCoreSupervisor - invokes the Core Supervisor agent runtime.
|
|
5
|
-
*
|
|
6
|
-
* @remarks
|
|
7
|
-
* * Forwards plenty-specific custom headers (auth token, plenty id, role,
|
|
8
|
-
* consents) on the signed request to the agent runtime.
|
|
9
|
-
* * Decodes the Server-Sent-Events stream returned by the runtime and returns
|
|
10
|
-
* the concatenated assistant text.
|
|
11
|
-
*
|
|
12
|
-
* @param { DoInvokeCoreSupervisorParams } params
|
|
13
|
-
* prompt: prompt to send to the agent.
|
|
14
|
-
* sessionId: id used as the runtime session id (drives short-term memory).
|
|
15
|
-
* plentyId: tenant id.
|
|
16
|
-
* user: customer-facing user identifier (slugged into the payload `user_id`).
|
|
17
|
-
* authToken: plentymarkets auth token, forwarded as a custom header.
|
|
18
|
-
* coreFunctionality: agent role; defaults to `'core-supervisor'`.
|
|
19
|
-
* basicConsent / advancedConsent: consent flags, default to `true`.
|
|
20
|
-
* qualifier: runtime qualifier override (defaults to config / `'production'`).
|
|
21
|
-
*
|
|
22
|
-
* @returns
|
|
23
|
-
* The assistant reply text wrapped in the standard `Data` envelope.
|
|
24
|
-
*
|
|
25
|
-
* @example
|
|
26
|
-
* ``` ts
|
|
27
|
-
* const { data } = await useSdk().plentysystems.doInvokeCoreSupervisor({
|
|
28
|
-
* prompt: 'How do I create a new product?',
|
|
29
|
-
* sessionId: 'abc-123',
|
|
30
|
-
* plentyId: 12345,
|
|
31
|
-
* user: 'jane.doe',
|
|
32
|
-
* authToken: 'eyJhbGciOi...',
|
|
33
|
-
* });
|
|
34
|
-
* console.log(data.text);
|
|
35
|
-
* ```
|
|
36
|
-
*
|
|
37
|
-
* @alpha
|
|
38
|
-
*/
|
|
39
|
-
export declare const doInvokeCoreSupervisor: (context: PlentysystemsIntegrationContext, params: DoInvokeCoreSupervisorParams) => Promise<Data<CoreSupervisorResponse>>;
|
|
40
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/api/doInvokeCoreSupervisor/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,sBAAsB,EACtB,IAAI,EACJ,4BAA4B,EAC7B,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,+BAA+B,EAAE,MAAM,qBAAqB,CAAC;AAStE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,eAAO,MAAM,sBAAsB,GACjC,SAAS,+BAA+B,EACxC,QAAQ,4BAA4B,KACnC,OAAO,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAmEtC,CAAC"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { InvokeAgentRuntimeOptions } from '../types/api';
|
|
2
|
-
export declare const slugifyUser: (username: string) => string;
|
|
3
|
-
export declare const decodeStream: (stream: AsyncIterable<unknown>) => Promise<string>;
|
|
4
|
-
export declare const extractTextFromSse: (raw: string) => string;
|
|
5
|
-
export declare const invokeAgentRuntime: (options: InvokeAgentRuntimeOptions) => Promise<AsyncIterable<unknown> | undefined>;
|
|
6
|
-
//# sourceMappingURL=coreSupervisor.helper.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"coreSupervisor.helper.d.ts","sourceRoot":"","sources":["../../src/helpers/coreSupervisor.helper.ts"],"names":[],"mappings":"AAIA,OAAO,EAGL,yBAAyB,EAC1B,MAAM,cAAc,CAAC;AAgBtB,eAAO,MAAM,WAAW,GAAI,UAAU,MAAM,KAAG,MAKxB,CAAC;AAExB,eAAO,MAAM,YAAY,GACvB,QAAQ,aAAa,CAAC,OAAO,CAAC,KAC7B,OAAO,CAAC,MAAM,CAkBhB,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAAI,KAAK,MAAM,KAAG,MAgDhD,CAAC;AAuCF,eAAO,MAAM,kBAAkB,GAC7B,SAAS,yBAAyB,KACjC,OAAO,CAAC,aAAa,CAAC,OAAO,CAAC,GAAG,SAAS,CAwB5C,CAAC"}
|