@cmssy/core 19.23.0 → 19.25.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/dist/index.cjs +29 -4
- package/dist/index.d.cts +6 -2
- package/dist/index.d.ts +6 -2
- package/dist/index.js +29 -5
- package/dist/internal/locale.cjs +1 -1
- package/dist/internal/locale.js +1 -1
- package/dist/internal.cjs +8 -2
- package/dist/internal.js +8 -2
- package/dist/preflight.cjs +1 -1
- package/dist/preflight.js +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -225,7 +225,7 @@ function documentText(document2) {
|
|
|
225
225
|
}
|
|
226
226
|
|
|
227
227
|
// src/version.ts
|
|
228
|
-
var CMSSY_CORE_VERSION = "19.
|
|
228
|
+
var CMSSY_CORE_VERSION = "19.25.0" ;
|
|
229
229
|
var CMSSY_USER_AGENT = `@cmssy/core/${CMSSY_CORE_VERSION}`;
|
|
230
230
|
|
|
231
231
|
// src/data/http.ts
|
|
@@ -590,9 +590,15 @@ var BUYER_PRICES_QUERY = typedOperation(`query BuyerPrices(
|
|
|
590
590
|
$workspaceId: ID!
|
|
591
591
|
$items: [PriceQueryItem!]!
|
|
592
592
|
$channel: String
|
|
593
|
+
$previewSecret: String
|
|
593
594
|
) {
|
|
594
595
|
account {
|
|
595
|
-
prices(
|
|
596
|
+
prices(
|
|
597
|
+
workspaceId: $workspaceId
|
|
598
|
+
items: $items
|
|
599
|
+
channel: $channel
|
|
600
|
+
previewSecret: $previewSecret
|
|
601
|
+
) {
|
|
596
602
|
recordId
|
|
597
603
|
variantKey
|
|
598
604
|
currency
|
|
@@ -650,7 +656,8 @@ async function getBuyerPrices(config, items, options) {
|
|
|
650
656
|
items: items.map(
|
|
651
657
|
({ recordId, variantKey }) => variantKey ? { recordId, variantKey } : { recordId }
|
|
652
658
|
),
|
|
653
|
-
...channelVariable(options.channel)
|
|
659
|
+
...channelVariable(options.channel),
|
|
660
|
+
...previewSecretVariable(options.previewSecret)
|
|
654
661
|
},
|
|
655
662
|
{
|
|
656
663
|
public: true,
|
|
@@ -679,6 +686,7 @@ var BUYER_CATALOG_PRICES_QUERY = typedOperation(`query BuyerCatalogPrices(
|
|
|
679
686
|
$limit: Int
|
|
680
687
|
$offset: Int
|
|
681
688
|
$channel: String
|
|
689
|
+
$previewSecret: String
|
|
682
690
|
) {
|
|
683
691
|
account {
|
|
684
692
|
catalogPrices(
|
|
@@ -693,6 +701,7 @@ var BUYER_CATALOG_PRICES_QUERY = typedOperation(`query BuyerCatalogPrices(
|
|
|
693
701
|
sort: $sort
|
|
694
702
|
limit: $limit
|
|
695
703
|
offset: $offset
|
|
704
|
+
previewSecret: $previewSecret
|
|
696
705
|
channel: $channel
|
|
697
706
|
) {
|
|
698
707
|
total
|
|
@@ -753,7 +762,8 @@ async function getBuyerCatalogPrices(config, query, options) {
|
|
|
753
762
|
{
|
|
754
763
|
...query,
|
|
755
764
|
workspaceId: options.workspaceId,
|
|
756
|
-
...channelVariable(options.channel)
|
|
765
|
+
...channelVariable(options.channel),
|
|
766
|
+
...previewSecretVariable(options.previewSecret)
|
|
757
767
|
},
|
|
758
768
|
{
|
|
759
769
|
public: true,
|
|
@@ -772,6 +782,9 @@ async function getBuyerCatalogPrices(config, query, options) {
|
|
|
772
782
|
function channelVariable(channel) {
|
|
773
783
|
return channel === void 0 ? {} : { channel };
|
|
774
784
|
}
|
|
785
|
+
function previewSecretVariable(previewSecret) {
|
|
786
|
+
return previewSecret ? { previewSecret } : {};
|
|
787
|
+
}
|
|
775
788
|
|
|
776
789
|
// src/data/public-prices.ts
|
|
777
790
|
var CMSSY_PUBLIC_PRICES_MAX_ITEMS = 50;
|
|
@@ -1029,6 +1042,17 @@ function checkoutErrorReason(error) {
|
|
|
1029
1042
|
}
|
|
1030
1043
|
return void 0;
|
|
1031
1044
|
}
|
|
1045
|
+
function checkoutErrorItemId(error) {
|
|
1046
|
+
if (!(error instanceof CmssyGraphqlError)) return void 0;
|
|
1047
|
+
for (const entry of error.errors) {
|
|
1048
|
+
const ext = entry.extensions;
|
|
1049
|
+
if (!ext || typeof ext.reason !== "string" || !REASONS.has(ext.reason)) {
|
|
1050
|
+
continue;
|
|
1051
|
+
}
|
|
1052
|
+
return typeof ext.itemId === "string" ? ext.itemId : void 0;
|
|
1053
|
+
}
|
|
1054
|
+
return void 0;
|
|
1055
|
+
}
|
|
1032
1056
|
function isCount(value) {
|
|
1033
1057
|
return typeof value === "number" && Number.isInteger(value);
|
|
1034
1058
|
}
|
|
@@ -1741,6 +1765,7 @@ exports.blocksToSchemas = blocksToSchemas;
|
|
|
1741
1765
|
exports.buildBlockManifest = buildBlockManifest;
|
|
1742
1766
|
exports.channelRefusal = channelRefusal;
|
|
1743
1767
|
exports.channelRefusalReasonValues = channelRefusalReasonValues;
|
|
1768
|
+
exports.checkoutErrorItemId = checkoutErrorItemId;
|
|
1744
1769
|
exports.checkoutErrorReason = checkoutErrorReason;
|
|
1745
1770
|
exports.checkoutErrorReasonValues = checkoutErrorReasonValues;
|
|
1746
1771
|
exports.createCmssyClient = createCmssyClient;
|
package/dist/index.d.cts
CHANGED
|
@@ -62,6 +62,7 @@ interface BuyerPricesVariables {
|
|
|
62
62
|
workspaceId: string;
|
|
63
63
|
items: CmssyPriceQueryItem[];
|
|
64
64
|
channel?: string | null;
|
|
65
|
+
previewSecret?: string | null;
|
|
65
66
|
}
|
|
66
67
|
interface BuyerPricesResult {
|
|
67
68
|
account: {
|
|
@@ -73,6 +74,7 @@ interface GetBuyerPricesOptions {
|
|
|
73
74
|
workspaceId: string;
|
|
74
75
|
accessToken: string;
|
|
75
76
|
channel?: string | null;
|
|
77
|
+
previewSecret?: string;
|
|
76
78
|
fetch?: FetchLike;
|
|
77
79
|
signal?: AbortSignal;
|
|
78
80
|
retry?: RetryOption;
|
|
@@ -119,6 +121,7 @@ interface BuyerCatalogPricesVariables {
|
|
|
119
121
|
limit?: number | null;
|
|
120
122
|
offset?: number | null;
|
|
121
123
|
channel?: string | null;
|
|
124
|
+
previewSecret?: string | null;
|
|
122
125
|
}
|
|
123
126
|
interface BuyerCatalogPricesResult {
|
|
124
127
|
account: {
|
|
@@ -126,7 +129,7 @@ interface BuyerCatalogPricesResult {
|
|
|
126
129
|
};
|
|
127
130
|
}
|
|
128
131
|
declare const BUYER_CATALOG_PRICES_QUERY: CmssyOperation<BuyerCatalogPricesResult, BuyerCatalogPricesVariables>;
|
|
129
|
-
type GetBuyerCatalogPricesQuery = Omit<BuyerCatalogPricesVariables, "workspaceId" | "channel">;
|
|
132
|
+
type GetBuyerCatalogPricesQuery = Omit<BuyerCatalogPricesVariables, "workspaceId" | "channel" | "previewSecret">;
|
|
130
133
|
declare function getBuyerCatalogPrices(config: CmssyClientConfig, query: GetBuyerCatalogPricesQuery, options: GetBuyerPricesOptions): Promise<CmssyBuyerCatalogPage>;
|
|
131
134
|
|
|
132
135
|
declare const CMSSY_PUBLIC_PRICES_MAX_ITEMS = 50;
|
|
@@ -222,6 +225,7 @@ interface CmssyQuantityRuleViolation {
|
|
|
222
225
|
itemId: string | null;
|
|
223
226
|
}
|
|
224
227
|
declare function checkoutErrorReason(error: unknown): CmssyCheckoutErrorReason | undefined;
|
|
228
|
+
declare function checkoutErrorItemId(error: unknown): string | undefined;
|
|
225
229
|
declare function quantityRuleViolation(error: unknown): CmssyQuantityRuleViolation | undefined;
|
|
226
230
|
declare const channelRefusalReasonValues: readonly ["UNKNOWN_CHANNEL", "MEMBERS_ONLY", "COMPANY_MEMBERS_ONLY"];
|
|
227
231
|
type CmssyChannelRefusalReason = (typeof channelRefusalReasonValues)[number];
|
|
@@ -399,4 +403,4 @@ declare class CmssyWebhookError extends Error {
|
|
|
399
403
|
}
|
|
400
404
|
declare function verifyCmssyWebhook(options: VerifyCmssyWebhookOptions): Promise<CmssyWebhookEvent>;
|
|
401
405
|
|
|
402
|
-
export { BUYER_CATALOG_PRICES_QUERY, BUYER_PRICES_QUERY, type BlockManifest, type BlockManifestBlock, type BlockManifestSource, type BuyerCatalogPricesResult, type BuyerCatalogPricesVariables, type BuyerPricesResult, type BuyerPricesVariables, CMSSY_BUYER_PRICES_MAX_ITEMS, CMSSY_EDIT_HEADER, CMSSY_EDIT_QUERY_PARAM, CMSSY_EDIT_TOKEN_HEADER, CMSSY_PUBLIC_PRICES_MAX_ITEMS, CMSSY_SECRET_QUERY_PARAM, type CmssyBuyerCatalogPage, type CmssyBuyerCatalogPrice, type CmssyBuyerCatalogSort, type CmssyBuyerPrice, type CmssyChannelRefusal, type CmssyChannelRefusalReason, type CmssyCheckoutErrorReason, CmssyClientConfig, type CmssyMemberPriceList, CmssyOperation, type CmssyOrderProgress, type CmssyOrderProgressInput, type CmssyPriceDisplayMode, type CmssyPriceListSource, type CmssyPriceQueryItem, type CmssyPriceTier, type CmssyPriceWithheldReason, type CmssyPublicCatalogPage, type CmssyPublicPriceResult, type CmssyPublicPricedRecord, type CmssyPublicPricedRecordData, type CmssyQuantityRuleReason, type CmssyQuantityRuleViolation, type CmssyTaxTreatment, type CmssyTaxedAmount, CmssyWebhookError, type ConditionalFormField, FetchLike, type GetBuyerCatalogPricesQuery, type GetBuyerPricesOptions, type GetPublicCatalogPricesQuery, type GetPublicPricesOptions, type MediaLike, type MintCmssyEditTokenOptions, PUBLIC_CATALOG_PRICES_QUERY, PUBLIC_PRICES_QUERY, type PublicCatalogPricesResult, type PublicCatalogPricesVariables, type PublicPricesResult, type PublicPricesVariables, RetryOption, type VerifyCmssyEditTokenOptions, blocksToMeta, blocksToSchemas, buildBlockManifest, channelRefusal, channelRefusalReasonValues, checkoutErrorReason, checkoutErrorReasonValues, fields, getBuyerCatalogPrices, getBuyerPrices, getPublicCatalogPrices, getPublicPrices, isFormFieldRequired, isFormFieldVisible, isVerifiedEditUrl, layoutRegionsToBridge, mediaAlt, mediaDuration, mediaType, mediaUrl, mediaUrls, mintCmssyEditToken, orderProgress, orderProgressValues, priceDisplayModeValues, priceListSourceValues, priceWithheldReasonValues, propsToSchema, quantityRuleReasonValues, quantityRuleViolation, registryToManifestBlocks, verifyCmssyEditToken, verifyCmssyWebhook, visibleFormFields };
|
|
406
|
+
export { BUYER_CATALOG_PRICES_QUERY, BUYER_PRICES_QUERY, type BlockManifest, type BlockManifestBlock, type BlockManifestSource, type BuyerCatalogPricesResult, type BuyerCatalogPricesVariables, type BuyerPricesResult, type BuyerPricesVariables, CMSSY_BUYER_PRICES_MAX_ITEMS, CMSSY_EDIT_HEADER, CMSSY_EDIT_QUERY_PARAM, CMSSY_EDIT_TOKEN_HEADER, CMSSY_PUBLIC_PRICES_MAX_ITEMS, CMSSY_SECRET_QUERY_PARAM, type CmssyBuyerCatalogPage, type CmssyBuyerCatalogPrice, type CmssyBuyerCatalogSort, type CmssyBuyerPrice, type CmssyChannelRefusal, type CmssyChannelRefusalReason, type CmssyCheckoutErrorReason, CmssyClientConfig, type CmssyMemberPriceList, CmssyOperation, type CmssyOrderProgress, type CmssyOrderProgressInput, type CmssyPriceDisplayMode, type CmssyPriceListSource, type CmssyPriceQueryItem, type CmssyPriceTier, type CmssyPriceWithheldReason, type CmssyPublicCatalogPage, type CmssyPublicPriceResult, type CmssyPublicPricedRecord, type CmssyPublicPricedRecordData, type CmssyQuantityRuleReason, type CmssyQuantityRuleViolation, type CmssyTaxTreatment, type CmssyTaxedAmount, CmssyWebhookError, type ConditionalFormField, FetchLike, type GetBuyerCatalogPricesQuery, type GetBuyerPricesOptions, type GetPublicCatalogPricesQuery, type GetPublicPricesOptions, type MediaLike, type MintCmssyEditTokenOptions, PUBLIC_CATALOG_PRICES_QUERY, PUBLIC_PRICES_QUERY, type PublicCatalogPricesResult, type PublicCatalogPricesVariables, type PublicPricesResult, type PublicPricesVariables, RetryOption, type VerifyCmssyEditTokenOptions, blocksToMeta, blocksToSchemas, buildBlockManifest, channelRefusal, channelRefusalReasonValues, checkoutErrorItemId, checkoutErrorReason, checkoutErrorReasonValues, fields, getBuyerCatalogPrices, getBuyerPrices, getPublicCatalogPrices, getPublicPrices, isFormFieldRequired, isFormFieldVisible, isVerifiedEditUrl, layoutRegionsToBridge, mediaAlt, mediaDuration, mediaType, mediaUrl, mediaUrls, mintCmssyEditToken, orderProgress, orderProgressValues, priceDisplayModeValues, priceListSourceValues, priceWithheldReasonValues, propsToSchema, quantityRuleReasonValues, quantityRuleViolation, registryToManifestBlocks, verifyCmssyEditToken, verifyCmssyWebhook, visibleFormFields };
|
package/dist/index.d.ts
CHANGED
|
@@ -62,6 +62,7 @@ interface BuyerPricesVariables {
|
|
|
62
62
|
workspaceId: string;
|
|
63
63
|
items: CmssyPriceQueryItem[];
|
|
64
64
|
channel?: string | null;
|
|
65
|
+
previewSecret?: string | null;
|
|
65
66
|
}
|
|
66
67
|
interface BuyerPricesResult {
|
|
67
68
|
account: {
|
|
@@ -73,6 +74,7 @@ interface GetBuyerPricesOptions {
|
|
|
73
74
|
workspaceId: string;
|
|
74
75
|
accessToken: string;
|
|
75
76
|
channel?: string | null;
|
|
77
|
+
previewSecret?: string;
|
|
76
78
|
fetch?: FetchLike;
|
|
77
79
|
signal?: AbortSignal;
|
|
78
80
|
retry?: RetryOption;
|
|
@@ -119,6 +121,7 @@ interface BuyerCatalogPricesVariables {
|
|
|
119
121
|
limit?: number | null;
|
|
120
122
|
offset?: number | null;
|
|
121
123
|
channel?: string | null;
|
|
124
|
+
previewSecret?: string | null;
|
|
122
125
|
}
|
|
123
126
|
interface BuyerCatalogPricesResult {
|
|
124
127
|
account: {
|
|
@@ -126,7 +129,7 @@ interface BuyerCatalogPricesResult {
|
|
|
126
129
|
};
|
|
127
130
|
}
|
|
128
131
|
declare const BUYER_CATALOG_PRICES_QUERY: CmssyOperation<BuyerCatalogPricesResult, BuyerCatalogPricesVariables>;
|
|
129
|
-
type GetBuyerCatalogPricesQuery = Omit<BuyerCatalogPricesVariables, "workspaceId" | "channel">;
|
|
132
|
+
type GetBuyerCatalogPricesQuery = Omit<BuyerCatalogPricesVariables, "workspaceId" | "channel" | "previewSecret">;
|
|
130
133
|
declare function getBuyerCatalogPrices(config: CmssyClientConfig, query: GetBuyerCatalogPricesQuery, options: GetBuyerPricesOptions): Promise<CmssyBuyerCatalogPage>;
|
|
131
134
|
|
|
132
135
|
declare const CMSSY_PUBLIC_PRICES_MAX_ITEMS = 50;
|
|
@@ -222,6 +225,7 @@ interface CmssyQuantityRuleViolation {
|
|
|
222
225
|
itemId: string | null;
|
|
223
226
|
}
|
|
224
227
|
declare function checkoutErrorReason(error: unknown): CmssyCheckoutErrorReason | undefined;
|
|
228
|
+
declare function checkoutErrorItemId(error: unknown): string | undefined;
|
|
225
229
|
declare function quantityRuleViolation(error: unknown): CmssyQuantityRuleViolation | undefined;
|
|
226
230
|
declare const channelRefusalReasonValues: readonly ["UNKNOWN_CHANNEL", "MEMBERS_ONLY", "COMPANY_MEMBERS_ONLY"];
|
|
227
231
|
type CmssyChannelRefusalReason = (typeof channelRefusalReasonValues)[number];
|
|
@@ -399,4 +403,4 @@ declare class CmssyWebhookError extends Error {
|
|
|
399
403
|
}
|
|
400
404
|
declare function verifyCmssyWebhook(options: VerifyCmssyWebhookOptions): Promise<CmssyWebhookEvent>;
|
|
401
405
|
|
|
402
|
-
export { BUYER_CATALOG_PRICES_QUERY, BUYER_PRICES_QUERY, type BlockManifest, type BlockManifestBlock, type BlockManifestSource, type BuyerCatalogPricesResult, type BuyerCatalogPricesVariables, type BuyerPricesResult, type BuyerPricesVariables, CMSSY_BUYER_PRICES_MAX_ITEMS, CMSSY_EDIT_HEADER, CMSSY_EDIT_QUERY_PARAM, CMSSY_EDIT_TOKEN_HEADER, CMSSY_PUBLIC_PRICES_MAX_ITEMS, CMSSY_SECRET_QUERY_PARAM, type CmssyBuyerCatalogPage, type CmssyBuyerCatalogPrice, type CmssyBuyerCatalogSort, type CmssyBuyerPrice, type CmssyChannelRefusal, type CmssyChannelRefusalReason, type CmssyCheckoutErrorReason, CmssyClientConfig, type CmssyMemberPriceList, CmssyOperation, type CmssyOrderProgress, type CmssyOrderProgressInput, type CmssyPriceDisplayMode, type CmssyPriceListSource, type CmssyPriceQueryItem, type CmssyPriceTier, type CmssyPriceWithheldReason, type CmssyPublicCatalogPage, type CmssyPublicPriceResult, type CmssyPublicPricedRecord, type CmssyPublicPricedRecordData, type CmssyQuantityRuleReason, type CmssyQuantityRuleViolation, type CmssyTaxTreatment, type CmssyTaxedAmount, CmssyWebhookError, type ConditionalFormField, FetchLike, type GetBuyerCatalogPricesQuery, type GetBuyerPricesOptions, type GetPublicCatalogPricesQuery, type GetPublicPricesOptions, type MediaLike, type MintCmssyEditTokenOptions, PUBLIC_CATALOG_PRICES_QUERY, PUBLIC_PRICES_QUERY, type PublicCatalogPricesResult, type PublicCatalogPricesVariables, type PublicPricesResult, type PublicPricesVariables, RetryOption, type VerifyCmssyEditTokenOptions, blocksToMeta, blocksToSchemas, buildBlockManifest, channelRefusal, channelRefusalReasonValues, checkoutErrorReason, checkoutErrorReasonValues, fields, getBuyerCatalogPrices, getBuyerPrices, getPublicCatalogPrices, getPublicPrices, isFormFieldRequired, isFormFieldVisible, isVerifiedEditUrl, layoutRegionsToBridge, mediaAlt, mediaDuration, mediaType, mediaUrl, mediaUrls, mintCmssyEditToken, orderProgress, orderProgressValues, priceDisplayModeValues, priceListSourceValues, priceWithheldReasonValues, propsToSchema, quantityRuleReasonValues, quantityRuleViolation, registryToManifestBlocks, verifyCmssyEditToken, verifyCmssyWebhook, visibleFormFields };
|
|
406
|
+
export { BUYER_CATALOG_PRICES_QUERY, BUYER_PRICES_QUERY, type BlockManifest, type BlockManifestBlock, type BlockManifestSource, type BuyerCatalogPricesResult, type BuyerCatalogPricesVariables, type BuyerPricesResult, type BuyerPricesVariables, CMSSY_BUYER_PRICES_MAX_ITEMS, CMSSY_EDIT_HEADER, CMSSY_EDIT_QUERY_PARAM, CMSSY_EDIT_TOKEN_HEADER, CMSSY_PUBLIC_PRICES_MAX_ITEMS, CMSSY_SECRET_QUERY_PARAM, type CmssyBuyerCatalogPage, type CmssyBuyerCatalogPrice, type CmssyBuyerCatalogSort, type CmssyBuyerPrice, type CmssyChannelRefusal, type CmssyChannelRefusalReason, type CmssyCheckoutErrorReason, CmssyClientConfig, type CmssyMemberPriceList, CmssyOperation, type CmssyOrderProgress, type CmssyOrderProgressInput, type CmssyPriceDisplayMode, type CmssyPriceListSource, type CmssyPriceQueryItem, type CmssyPriceTier, type CmssyPriceWithheldReason, type CmssyPublicCatalogPage, type CmssyPublicPriceResult, type CmssyPublicPricedRecord, type CmssyPublicPricedRecordData, type CmssyQuantityRuleReason, type CmssyQuantityRuleViolation, type CmssyTaxTreatment, type CmssyTaxedAmount, CmssyWebhookError, type ConditionalFormField, FetchLike, type GetBuyerCatalogPricesQuery, type GetBuyerPricesOptions, type GetPublicCatalogPricesQuery, type GetPublicPricesOptions, type MediaLike, type MintCmssyEditTokenOptions, PUBLIC_CATALOG_PRICES_QUERY, PUBLIC_PRICES_QUERY, type PublicCatalogPricesResult, type PublicCatalogPricesVariables, type PublicPricesResult, type PublicPricesVariables, RetryOption, type VerifyCmssyEditTokenOptions, blocksToMeta, blocksToSchemas, buildBlockManifest, channelRefusal, channelRefusalReasonValues, checkoutErrorItemId, checkoutErrorReason, checkoutErrorReasonValues, fields, getBuyerCatalogPrices, getBuyerPrices, getPublicCatalogPrices, getPublicPrices, isFormFieldRequired, isFormFieldVisible, isVerifiedEditUrl, layoutRegionsToBridge, mediaAlt, mediaDuration, mediaType, mediaUrl, mediaUrls, mintCmssyEditToken, orderProgress, orderProgressValues, priceDisplayModeValues, priceListSourceValues, priceWithheldReasonValues, propsToSchema, quantityRuleReasonValues, quantityRuleViolation, registryToManifestBlocks, verifyCmssyEditToken, verifyCmssyWebhook, visibleFormFields };
|
package/dist/index.js
CHANGED
|
@@ -224,7 +224,7 @@ function documentText(document2) {
|
|
|
224
224
|
}
|
|
225
225
|
|
|
226
226
|
// src/version.ts
|
|
227
|
-
var CMSSY_CORE_VERSION = "19.
|
|
227
|
+
var CMSSY_CORE_VERSION = "19.25.0" ;
|
|
228
228
|
var CMSSY_USER_AGENT = `@cmssy/core/${CMSSY_CORE_VERSION}`;
|
|
229
229
|
|
|
230
230
|
// src/data/http.ts
|
|
@@ -589,9 +589,15 @@ var BUYER_PRICES_QUERY = typedOperation(`query BuyerPrices(
|
|
|
589
589
|
$workspaceId: ID!
|
|
590
590
|
$items: [PriceQueryItem!]!
|
|
591
591
|
$channel: String
|
|
592
|
+
$previewSecret: String
|
|
592
593
|
) {
|
|
593
594
|
account {
|
|
594
|
-
prices(
|
|
595
|
+
prices(
|
|
596
|
+
workspaceId: $workspaceId
|
|
597
|
+
items: $items
|
|
598
|
+
channel: $channel
|
|
599
|
+
previewSecret: $previewSecret
|
|
600
|
+
) {
|
|
595
601
|
recordId
|
|
596
602
|
variantKey
|
|
597
603
|
currency
|
|
@@ -649,7 +655,8 @@ async function getBuyerPrices(config, items, options) {
|
|
|
649
655
|
items: items.map(
|
|
650
656
|
({ recordId, variantKey }) => variantKey ? { recordId, variantKey } : { recordId }
|
|
651
657
|
),
|
|
652
|
-
...channelVariable(options.channel)
|
|
658
|
+
...channelVariable(options.channel),
|
|
659
|
+
...previewSecretVariable(options.previewSecret)
|
|
653
660
|
},
|
|
654
661
|
{
|
|
655
662
|
public: true,
|
|
@@ -678,6 +685,7 @@ var BUYER_CATALOG_PRICES_QUERY = typedOperation(`query BuyerCatalogPrices(
|
|
|
678
685
|
$limit: Int
|
|
679
686
|
$offset: Int
|
|
680
687
|
$channel: String
|
|
688
|
+
$previewSecret: String
|
|
681
689
|
) {
|
|
682
690
|
account {
|
|
683
691
|
catalogPrices(
|
|
@@ -692,6 +700,7 @@ var BUYER_CATALOG_PRICES_QUERY = typedOperation(`query BuyerCatalogPrices(
|
|
|
692
700
|
sort: $sort
|
|
693
701
|
limit: $limit
|
|
694
702
|
offset: $offset
|
|
703
|
+
previewSecret: $previewSecret
|
|
695
704
|
channel: $channel
|
|
696
705
|
) {
|
|
697
706
|
total
|
|
@@ -752,7 +761,8 @@ async function getBuyerCatalogPrices(config, query, options) {
|
|
|
752
761
|
{
|
|
753
762
|
...query,
|
|
754
763
|
workspaceId: options.workspaceId,
|
|
755
|
-
...channelVariable(options.channel)
|
|
764
|
+
...channelVariable(options.channel),
|
|
765
|
+
...previewSecretVariable(options.previewSecret)
|
|
756
766
|
},
|
|
757
767
|
{
|
|
758
768
|
public: true,
|
|
@@ -771,6 +781,9 @@ async function getBuyerCatalogPrices(config, query, options) {
|
|
|
771
781
|
function channelVariable(channel) {
|
|
772
782
|
return channel === void 0 ? {} : { channel };
|
|
773
783
|
}
|
|
784
|
+
function previewSecretVariable(previewSecret) {
|
|
785
|
+
return previewSecret ? { previewSecret } : {};
|
|
786
|
+
}
|
|
774
787
|
|
|
775
788
|
// src/data/public-prices.ts
|
|
776
789
|
var CMSSY_PUBLIC_PRICES_MAX_ITEMS = 50;
|
|
@@ -1028,6 +1041,17 @@ function checkoutErrorReason(error) {
|
|
|
1028
1041
|
}
|
|
1029
1042
|
return void 0;
|
|
1030
1043
|
}
|
|
1044
|
+
function checkoutErrorItemId(error) {
|
|
1045
|
+
if (!(error instanceof CmssyGraphqlError)) return void 0;
|
|
1046
|
+
for (const entry of error.errors) {
|
|
1047
|
+
const ext = entry.extensions;
|
|
1048
|
+
if (!ext || typeof ext.reason !== "string" || !REASONS.has(ext.reason)) {
|
|
1049
|
+
continue;
|
|
1050
|
+
}
|
|
1051
|
+
return typeof ext.itemId === "string" ? ext.itemId : void 0;
|
|
1052
|
+
}
|
|
1053
|
+
return void 0;
|
|
1054
|
+
}
|
|
1031
1055
|
function isCount(value) {
|
|
1032
1056
|
return typeof value === "number" && Number.isInteger(value);
|
|
1033
1057
|
}
|
|
@@ -1690,4 +1714,4 @@ async function verifyCmssyWebhook(options) {
|
|
|
1690
1714
|
return parsed;
|
|
1691
1715
|
}
|
|
1692
1716
|
|
|
1693
|
-
export { BUYER_CATALOG_PRICES_QUERY, BUYER_PRICES_QUERY, CMSSY_BUYER_PRICES_MAX_ITEMS, CMSSY_EDIT_HEADER, CMSSY_EDIT_QUERY_PARAM, CMSSY_EDIT_TOKEN_HEADER, CMSSY_LOCALE_HEADER, CMSSY_PUBLIC_PRICES_MAX_ITEMS, CMSSY_RATE_LIMIT_WINDOW_MS, CMSSY_RETRY_MODES, CMSSY_SECRET_QUERY_PARAM, CmssyGraphqlError, CmssyRequestError, CmssyWebhookError, DEFAULT_CMSSY_API_URL, DEFAULT_CMSSY_EDITOR_ORIGINS, PROTOCOL_VERSION, PUBLIC_CATALOG_PRICES_QUERY, PUBLIC_PRICES_QUERY, SHORTCUT_ACTIONS, applyCmssyCsp, blocksToMeta, blocksToSchemas, buildBlockManifest, channelRefusal, channelRefusalReasonValues, checkoutErrorReason, checkoutErrorReasonValues, createCmssyClient, createRetryingFetch, defineCmssyConfig, defineCmssyLayout, fields, getBuyerCatalogPrices, getBuyerPrices, getPublicCatalogPrices, getPublicPrices, graphqlRequest, isFormFieldRequired, isFormFieldVisible, isProtocolCompatible, isTransientRequestError, isVerifiedEditUrl, layoutRegionsToBridge, localizeHref, mediaAlt, mediaDuration, mediaType, mediaUrl, mediaUrls, mintCmssyEditToken, normalizeOrigin, orderProgress, orderProgressValues, parseEditorMessage, postToEditor, priceDisplayModeValues, priceListSourceValues, priceWithheldReasonValues, propsToSchema, quantityRuleReasonValues, quantityRuleViolation, registryToManifestBlocks, resolveCmssyLocale, resolveEditorOrigin, typedOperation, verifyCmssyEditToken, verifyCmssyWebhook, visibleFormFields };
|
|
1717
|
+
export { BUYER_CATALOG_PRICES_QUERY, BUYER_PRICES_QUERY, CMSSY_BUYER_PRICES_MAX_ITEMS, CMSSY_EDIT_HEADER, CMSSY_EDIT_QUERY_PARAM, CMSSY_EDIT_TOKEN_HEADER, CMSSY_LOCALE_HEADER, CMSSY_PUBLIC_PRICES_MAX_ITEMS, CMSSY_RATE_LIMIT_WINDOW_MS, CMSSY_RETRY_MODES, CMSSY_SECRET_QUERY_PARAM, CmssyGraphqlError, CmssyRequestError, CmssyWebhookError, DEFAULT_CMSSY_API_URL, DEFAULT_CMSSY_EDITOR_ORIGINS, PROTOCOL_VERSION, PUBLIC_CATALOG_PRICES_QUERY, PUBLIC_PRICES_QUERY, SHORTCUT_ACTIONS, applyCmssyCsp, blocksToMeta, blocksToSchemas, buildBlockManifest, channelRefusal, channelRefusalReasonValues, checkoutErrorItemId, checkoutErrorReason, checkoutErrorReasonValues, createCmssyClient, createRetryingFetch, defineCmssyConfig, defineCmssyLayout, fields, getBuyerCatalogPrices, getBuyerPrices, getPublicCatalogPrices, getPublicPrices, graphqlRequest, isFormFieldRequired, isFormFieldVisible, isProtocolCompatible, isTransientRequestError, isVerifiedEditUrl, layoutRegionsToBridge, localizeHref, mediaAlt, mediaDuration, mediaType, mediaUrl, mediaUrls, mintCmssyEditToken, normalizeOrigin, orderProgress, orderProgressValues, parseEditorMessage, postToEditor, priceDisplayModeValues, priceListSourceValues, priceWithheldReasonValues, propsToSchema, quantityRuleReasonValues, quantityRuleViolation, registryToManifestBlocks, resolveCmssyLocale, resolveEditorOrigin, typedOperation, verifyCmssyEditToken, verifyCmssyWebhook, visibleFormFields };
|
package/dist/internal/locale.cjs
CHANGED
package/dist/internal/locale.js
CHANGED
package/dist/internal.cjs
CHANGED
|
@@ -154,7 +154,7 @@ function documentText(document2) {
|
|
|
154
154
|
}
|
|
155
155
|
|
|
156
156
|
// src/version.ts
|
|
157
|
-
var CMSSY_CORE_VERSION = "19.
|
|
157
|
+
var CMSSY_CORE_VERSION = "19.25.0" ;
|
|
158
158
|
var CMSSY_USER_AGENT = `@cmssy/core/${CMSSY_CORE_VERSION}`;
|
|
159
159
|
|
|
160
160
|
// src/data/http.ts
|
|
@@ -1368,9 +1368,15 @@ var BUYER_PRICES_QUERY = typedOperation(`query BuyerPrices(
|
|
|
1368
1368
|
$workspaceId: ID!
|
|
1369
1369
|
$items: [PriceQueryItem!]!
|
|
1370
1370
|
$channel: String
|
|
1371
|
+
$previewSecret: String
|
|
1371
1372
|
) {
|
|
1372
1373
|
account {
|
|
1373
|
-
prices(
|
|
1374
|
+
prices(
|
|
1375
|
+
workspaceId: $workspaceId
|
|
1376
|
+
items: $items
|
|
1377
|
+
channel: $channel
|
|
1378
|
+
previewSecret: $previewSecret
|
|
1379
|
+
) {
|
|
1374
1380
|
recordId
|
|
1375
1381
|
variantKey
|
|
1376
1382
|
currency
|
package/dist/internal.js
CHANGED
|
@@ -152,7 +152,7 @@ function documentText(document2) {
|
|
|
152
152
|
}
|
|
153
153
|
|
|
154
154
|
// src/version.ts
|
|
155
|
-
var CMSSY_CORE_VERSION = "19.
|
|
155
|
+
var CMSSY_CORE_VERSION = "19.25.0" ;
|
|
156
156
|
var CMSSY_USER_AGENT = `@cmssy/core/${CMSSY_CORE_VERSION}`;
|
|
157
157
|
|
|
158
158
|
// src/data/http.ts
|
|
@@ -1366,9 +1366,15 @@ var BUYER_PRICES_QUERY = typedOperation(`query BuyerPrices(
|
|
|
1366
1366
|
$workspaceId: ID!
|
|
1367
1367
|
$items: [PriceQueryItem!]!
|
|
1368
1368
|
$channel: String
|
|
1369
|
+
$previewSecret: String
|
|
1369
1370
|
) {
|
|
1370
1371
|
account {
|
|
1371
|
-
prices(
|
|
1372
|
+
prices(
|
|
1373
|
+
workspaceId: $workspaceId
|
|
1374
|
+
items: $items
|
|
1375
|
+
channel: $channel
|
|
1376
|
+
previewSecret: $previewSecret
|
|
1377
|
+
) {
|
|
1372
1378
|
recordId
|
|
1373
1379
|
variantKey
|
|
1374
1380
|
currency
|
package/dist/preflight.cjs
CHANGED
|
@@ -152,7 +152,7 @@ function documentText(document) {
|
|
|
152
152
|
}
|
|
153
153
|
|
|
154
154
|
// src/version.ts
|
|
155
|
-
var CMSSY_CORE_VERSION = "19.
|
|
155
|
+
var CMSSY_CORE_VERSION = "19.25.0" ;
|
|
156
156
|
var CMSSY_USER_AGENT = `@cmssy/core/${CMSSY_CORE_VERSION}`;
|
|
157
157
|
|
|
158
158
|
// src/content/content-client.ts
|
package/dist/preflight.js
CHANGED
|
@@ -150,7 +150,7 @@ function documentText(document) {
|
|
|
150
150
|
}
|
|
151
151
|
|
|
152
152
|
// src/version.ts
|
|
153
|
-
var CMSSY_CORE_VERSION = "19.
|
|
153
|
+
var CMSSY_CORE_VERSION = "19.25.0" ;
|
|
154
154
|
var CMSSY_USER_AGENT = `@cmssy/core/${CMSSY_CORE_VERSION}`;
|
|
155
155
|
|
|
156
156
|
// src/content/content-client.ts
|