@cmssy/core 19.22.0 → 19.23.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 +13 -3
- package/dist/index.d.cts +4 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.js +13 -3
- package/dist/internal/locale.cjs +1 -1
- package/dist/internal/locale.js +1 -1
- package/dist/internal.cjs +29 -12
- package/dist/internal.d.cts +2 -1
- package/dist/internal.d.ts +2 -1
- package/dist/internal.js +29 -12
- 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.23.0" ;
|
|
229
229
|
var CMSSY_USER_AGENT = `@cmssy/core/${CMSSY_CORE_VERSION}`;
|
|
230
230
|
|
|
231
231
|
// src/data/http.ts
|
|
@@ -784,6 +784,7 @@ var PUBLIC_PRICES_QUERY = typedOperation(`query PublicPrices(
|
|
|
784
784
|
$channel: String!
|
|
785
785
|
$items: [PriceQueryItem!]!
|
|
786
786
|
$locale: String
|
|
787
|
+
$previewSecret: String
|
|
787
788
|
) {
|
|
788
789
|
public {
|
|
789
790
|
pricing {
|
|
@@ -792,6 +793,7 @@ var PUBLIC_PRICES_QUERY = typedOperation(`query PublicPrices(
|
|
|
792
793
|
channel: $channel
|
|
793
794
|
items: $items
|
|
794
795
|
locale: $locale
|
|
796
|
+
previewSecret: $previewSecret
|
|
795
797
|
) {
|
|
796
798
|
currency
|
|
797
799
|
displayMode
|
|
@@ -863,6 +865,7 @@ var PUBLIC_CATALOG_PRICES_QUERY = typedOperation(`query PublicCatalogPrices(
|
|
|
863
865
|
$sort: BuyerCatalogSort
|
|
864
866
|
$limit: Int
|
|
865
867
|
$offset: Int
|
|
868
|
+
$previewSecret: String
|
|
866
869
|
) {
|
|
867
870
|
public {
|
|
868
871
|
pricing {
|
|
@@ -879,6 +882,7 @@ var PUBLIC_CATALOG_PRICES_QUERY = typedOperation(`query PublicCatalogPrices(
|
|
|
879
882
|
sort: $sort
|
|
880
883
|
limit: $limit
|
|
881
884
|
offset: $offset
|
|
885
|
+
previewSecret: $previewSecret
|
|
882
886
|
) {
|
|
883
887
|
total
|
|
884
888
|
hasMore
|
|
@@ -964,7 +968,8 @@ async function getPublicPrices(config, items, options) {
|
|
|
964
968
|
items: items.map(
|
|
965
969
|
({ recordId, variantKey }) => variantKey ? { recordId, variantKey } : { recordId }
|
|
966
970
|
),
|
|
967
|
-
...options.locale ? { locale: options.locale } : {}
|
|
971
|
+
...options.locale ? { locale: options.locale } : {},
|
|
972
|
+
...options.previewSecret ? { previewSecret: options.previewSecret } : {}
|
|
968
973
|
},
|
|
969
974
|
{
|
|
970
975
|
public: true,
|
|
@@ -982,7 +987,12 @@ async function getPublicCatalogPrices(config, query, options) {
|
|
|
982
987
|
const data = await graphqlRequest(
|
|
983
988
|
config,
|
|
984
989
|
PUBLIC_CATALOG_PRICES_QUERY,
|
|
985
|
-
{
|
|
990
|
+
{
|
|
991
|
+
...query,
|
|
992
|
+
workspaceId: options.workspaceId,
|
|
993
|
+
channel,
|
|
994
|
+
...options.previewSecret ? { previewSecret: options.previewSecret } : {}
|
|
995
|
+
},
|
|
986
996
|
{
|
|
987
997
|
public: true,
|
|
988
998
|
fetch: options.fetch,
|
package/dist/index.d.cts
CHANGED
|
@@ -163,6 +163,7 @@ interface PublicPricesVariables {
|
|
|
163
163
|
channel: string;
|
|
164
164
|
items: CmssyPriceQueryItem[];
|
|
165
165
|
locale?: string | null;
|
|
166
|
+
previewSecret?: string | null;
|
|
166
167
|
}
|
|
167
168
|
interface PublicPricesResult {
|
|
168
169
|
public: {
|
|
@@ -185,6 +186,7 @@ interface PublicCatalogPricesVariables {
|
|
|
185
186
|
sort?: CmssyBuyerCatalogSort | null;
|
|
186
187
|
limit?: number | null;
|
|
187
188
|
offset?: number | null;
|
|
189
|
+
previewSecret?: string | null;
|
|
188
190
|
}
|
|
189
191
|
interface PublicCatalogPricesResult {
|
|
190
192
|
public: {
|
|
@@ -198,12 +200,13 @@ interface GetPublicPricesOptions {
|
|
|
198
200
|
workspaceId: string;
|
|
199
201
|
channel?: string;
|
|
200
202
|
locale?: string | null;
|
|
203
|
+
previewSecret?: string;
|
|
201
204
|
fetch?: FetchLike;
|
|
202
205
|
signal?: AbortSignal;
|
|
203
206
|
retry?: RetryOption;
|
|
204
207
|
}
|
|
205
208
|
declare function getPublicPrices(config: CmssyClientConfig, items: readonly CmssyPriceQueryItem[], options: GetPublicPricesOptions): Promise<CmssyPublicPriceResult>;
|
|
206
|
-
type GetPublicCatalogPricesQuery = Omit<PublicCatalogPricesVariables, "workspaceId" | "channel">;
|
|
209
|
+
type GetPublicCatalogPricesQuery = Omit<PublicCatalogPricesVariables, "workspaceId" | "channel" | "previewSecret">;
|
|
207
210
|
declare function getPublicCatalogPrices(config: CmssyClientConfig, query: GetPublicCatalogPricesQuery, options: Omit<GetPublicPricesOptions, "locale">): Promise<CmssyPublicCatalogPage>;
|
|
208
211
|
|
|
209
212
|
declare const quantityRuleReasonValues: readonly ["QUANTITY_BELOW_MIN", "QUANTITY_ABOVE_MAX", "QUANTITY_NOT_ON_STEP"];
|
package/dist/index.d.ts
CHANGED
|
@@ -163,6 +163,7 @@ interface PublicPricesVariables {
|
|
|
163
163
|
channel: string;
|
|
164
164
|
items: CmssyPriceQueryItem[];
|
|
165
165
|
locale?: string | null;
|
|
166
|
+
previewSecret?: string | null;
|
|
166
167
|
}
|
|
167
168
|
interface PublicPricesResult {
|
|
168
169
|
public: {
|
|
@@ -185,6 +186,7 @@ interface PublicCatalogPricesVariables {
|
|
|
185
186
|
sort?: CmssyBuyerCatalogSort | null;
|
|
186
187
|
limit?: number | null;
|
|
187
188
|
offset?: number | null;
|
|
189
|
+
previewSecret?: string | null;
|
|
188
190
|
}
|
|
189
191
|
interface PublicCatalogPricesResult {
|
|
190
192
|
public: {
|
|
@@ -198,12 +200,13 @@ interface GetPublicPricesOptions {
|
|
|
198
200
|
workspaceId: string;
|
|
199
201
|
channel?: string;
|
|
200
202
|
locale?: string | null;
|
|
203
|
+
previewSecret?: string;
|
|
201
204
|
fetch?: FetchLike;
|
|
202
205
|
signal?: AbortSignal;
|
|
203
206
|
retry?: RetryOption;
|
|
204
207
|
}
|
|
205
208
|
declare function getPublicPrices(config: CmssyClientConfig, items: readonly CmssyPriceQueryItem[], options: GetPublicPricesOptions): Promise<CmssyPublicPriceResult>;
|
|
206
|
-
type GetPublicCatalogPricesQuery = Omit<PublicCatalogPricesVariables, "workspaceId" | "channel">;
|
|
209
|
+
type GetPublicCatalogPricesQuery = Omit<PublicCatalogPricesVariables, "workspaceId" | "channel" | "previewSecret">;
|
|
207
210
|
declare function getPublicCatalogPrices(config: CmssyClientConfig, query: GetPublicCatalogPricesQuery, options: Omit<GetPublicPricesOptions, "locale">): Promise<CmssyPublicCatalogPage>;
|
|
208
211
|
|
|
209
212
|
declare const quantityRuleReasonValues: readonly ["QUANTITY_BELOW_MIN", "QUANTITY_ABOVE_MAX", "QUANTITY_NOT_ON_STEP"];
|
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.23.0" ;
|
|
228
228
|
var CMSSY_USER_AGENT = `@cmssy/core/${CMSSY_CORE_VERSION}`;
|
|
229
229
|
|
|
230
230
|
// src/data/http.ts
|
|
@@ -783,6 +783,7 @@ var PUBLIC_PRICES_QUERY = typedOperation(`query PublicPrices(
|
|
|
783
783
|
$channel: String!
|
|
784
784
|
$items: [PriceQueryItem!]!
|
|
785
785
|
$locale: String
|
|
786
|
+
$previewSecret: String
|
|
786
787
|
) {
|
|
787
788
|
public {
|
|
788
789
|
pricing {
|
|
@@ -791,6 +792,7 @@ var PUBLIC_PRICES_QUERY = typedOperation(`query PublicPrices(
|
|
|
791
792
|
channel: $channel
|
|
792
793
|
items: $items
|
|
793
794
|
locale: $locale
|
|
795
|
+
previewSecret: $previewSecret
|
|
794
796
|
) {
|
|
795
797
|
currency
|
|
796
798
|
displayMode
|
|
@@ -862,6 +864,7 @@ var PUBLIC_CATALOG_PRICES_QUERY = typedOperation(`query PublicCatalogPrices(
|
|
|
862
864
|
$sort: BuyerCatalogSort
|
|
863
865
|
$limit: Int
|
|
864
866
|
$offset: Int
|
|
867
|
+
$previewSecret: String
|
|
865
868
|
) {
|
|
866
869
|
public {
|
|
867
870
|
pricing {
|
|
@@ -878,6 +881,7 @@ var PUBLIC_CATALOG_PRICES_QUERY = typedOperation(`query PublicCatalogPrices(
|
|
|
878
881
|
sort: $sort
|
|
879
882
|
limit: $limit
|
|
880
883
|
offset: $offset
|
|
884
|
+
previewSecret: $previewSecret
|
|
881
885
|
) {
|
|
882
886
|
total
|
|
883
887
|
hasMore
|
|
@@ -963,7 +967,8 @@ async function getPublicPrices(config, items, options) {
|
|
|
963
967
|
items: items.map(
|
|
964
968
|
({ recordId, variantKey }) => variantKey ? { recordId, variantKey } : { recordId }
|
|
965
969
|
),
|
|
966
|
-
...options.locale ? { locale: options.locale } : {}
|
|
970
|
+
...options.locale ? { locale: options.locale } : {},
|
|
971
|
+
...options.previewSecret ? { previewSecret: options.previewSecret } : {}
|
|
967
972
|
},
|
|
968
973
|
{
|
|
969
974
|
public: true,
|
|
@@ -981,7 +986,12 @@ async function getPublicCatalogPrices(config, query, options) {
|
|
|
981
986
|
const data = await graphqlRequest(
|
|
982
987
|
config,
|
|
983
988
|
PUBLIC_CATALOG_PRICES_QUERY,
|
|
984
|
-
{
|
|
989
|
+
{
|
|
990
|
+
...query,
|
|
991
|
+
workspaceId: options.workspaceId,
|
|
992
|
+
channel,
|
|
993
|
+
...options.previewSecret ? { previewSecret: options.previewSecret } : {}
|
|
994
|
+
},
|
|
985
995
|
{
|
|
986
996
|
public: true,
|
|
987
997
|
fetch: options.fetch,
|
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.23.0" ;
|
|
158
158
|
var CMSSY_USER_AGENT = `@cmssy/core/${CMSSY_CORE_VERSION}`;
|
|
159
159
|
|
|
160
160
|
// src/data/http.ts
|
|
@@ -640,10 +640,10 @@ var MODEL_DEFINITIONS_QUERY = typedOperation(`query PublicModelDefinitions($work
|
|
|
640
640
|
}
|
|
641
641
|
}
|
|
642
642
|
}`);
|
|
643
|
-
var MODEL_RECORDS_QUERY = typedOperation(`query PublicModelRecords($workspaceId: String!, $modelSlug: String!, $filter: JSON, $sort: String, $locale: String, $limit: Int, $offset: Int, $populate: [String!]) {
|
|
643
|
+
var MODEL_RECORDS_QUERY = typedOperation(`query PublicModelRecords($workspaceId: String!, $modelSlug: String!, $filter: JSON, $sort: String, $locale: String, $limit: Int, $offset: Int, $populate: [String!], $previewSecret: String) {
|
|
644
644
|
public {
|
|
645
645
|
model {
|
|
646
|
-
records(workspaceId: $workspaceId, modelSlug: $modelSlug, filter: $filter, sort: $sort, locale: $locale, limit: $limit, offset: $offset, populate: $populate) {
|
|
646
|
+
records(workspaceId: $workspaceId, modelSlug: $modelSlug, filter: $filter, sort: $sort, locale: $locale, limit: $limit, offset: $offset, populate: $populate, previewSecret: $previewSecret) {
|
|
647
647
|
items { id modelId data status createdAt updatedAt }
|
|
648
648
|
total
|
|
649
649
|
hasMore
|
|
@@ -782,10 +782,10 @@ function createCmssyClient(input) {
|
|
|
782
782
|
}
|
|
783
783
|
|
|
784
784
|
// src/data/block-content.ts
|
|
785
|
-
var RECORDS_BY_IDS_QUERY = typedOperation(`query PublicRecordsByIds($workspaceId: String!, $ids: [String!]!, $locale: String) {
|
|
785
|
+
var RECORDS_BY_IDS_QUERY = typedOperation(`query PublicRecordsByIds($workspaceId: String!, $ids: [String!]!, $locale: String, $previewSecret: String) {
|
|
786
786
|
public {
|
|
787
787
|
model {
|
|
788
|
-
recordsByIds(workspaceId: $workspaceId, ids: $ids, locale: $locale) {
|
|
788
|
+
recordsByIds(workspaceId: $workspaceId, ids: $ids, locale: $locale, previewSecret: $previewSecret) {
|
|
789
789
|
id modelId data status createdAt updatedAt
|
|
790
790
|
}
|
|
791
791
|
}
|
|
@@ -925,7 +925,7 @@ function collectionKey(ref) {
|
|
|
925
925
|
"\0"
|
|
926
926
|
);
|
|
927
927
|
}
|
|
928
|
-
async function resolveRelationContent(config, entries, schemas, locale, requestOptions = {}) {
|
|
928
|
+
async function resolveRelationContent(config, entries, schemas, locale, requestOptions = {}, previewSecret) {
|
|
929
929
|
const refs = collectRefs(entries, schemas);
|
|
930
930
|
if (refs.length === 0) return;
|
|
931
931
|
const client = createCmssyClient(config);
|
|
@@ -949,8 +949,20 @@ async function resolveRelationContent(config, entries, schemas, locale, requestO
|
|
|
949
949
|
let collectionItems;
|
|
950
950
|
try {
|
|
951
951
|
[recordsById, collectionItems] = await Promise.all([
|
|
952
|
-
fetchPickedRecords(
|
|
953
|
-
|
|
952
|
+
fetchPickedRecords(
|
|
953
|
+
client,
|
|
954
|
+
[...pickedIds],
|
|
955
|
+
locale,
|
|
956
|
+
requestOptions,
|
|
957
|
+
previewSecret
|
|
958
|
+
),
|
|
959
|
+
fetchCollections(
|
|
960
|
+
client,
|
|
961
|
+
collections,
|
|
962
|
+
locale,
|
|
963
|
+
requestOptions,
|
|
964
|
+
previewSecret
|
|
965
|
+
)
|
|
954
966
|
]);
|
|
955
967
|
} catch (err) {
|
|
956
968
|
if (typeof console !== "undefined") {
|
|
@@ -984,7 +996,7 @@ async function resolveRelationContent(config, entries, schemas, locale, requestO
|
|
|
984
996
|
}
|
|
985
997
|
}
|
|
986
998
|
}
|
|
987
|
-
async function fetchPickedRecords(client, ids, locale, requestOptions = {}) {
|
|
999
|
+
async function fetchPickedRecords(client, ids, locale, requestOptions = {}, previewSecret) {
|
|
988
1000
|
const byId = /* @__PURE__ */ new Map();
|
|
989
1001
|
const chunks = [];
|
|
990
1002
|
for (let i = 0; i < ids.length; i += BY_IDS_CHUNK) {
|
|
@@ -994,7 +1006,11 @@ async function fetchPickedRecords(client, ids, locale, requestOptions = {}) {
|
|
|
994
1006
|
chunks.map(async (chunk) => {
|
|
995
1007
|
const result = await client.queryScoped(
|
|
996
1008
|
RECORDS_BY_IDS_QUERY,
|
|
997
|
-
{
|
|
1009
|
+
{
|
|
1010
|
+
ids: chunk,
|
|
1011
|
+
locale: locale ?? null,
|
|
1012
|
+
previewSecret: previewSecret ?? null
|
|
1013
|
+
},
|
|
998
1014
|
requestOptions
|
|
999
1015
|
);
|
|
1000
1016
|
for (const record of result.public.model.recordsByIds) {
|
|
@@ -1004,7 +1020,7 @@ async function fetchPickedRecords(client, ids, locale, requestOptions = {}) {
|
|
|
1004
1020
|
);
|
|
1005
1021
|
return byId;
|
|
1006
1022
|
}
|
|
1007
|
-
async function fetchCollections(client, collections, locale, requestOptions = {}) {
|
|
1023
|
+
async function fetchCollections(client, collections, locale, requestOptions = {}, previewSecret) {
|
|
1008
1024
|
const byKey = /* @__PURE__ */ new Map();
|
|
1009
1025
|
await Promise.all(
|
|
1010
1026
|
[...collections.entries()].map(async ([key, { model, sort, limit }]) => {
|
|
@@ -1014,7 +1030,8 @@ async function fetchCollections(client, collections, locale, requestOptions = {}
|
|
|
1014
1030
|
modelSlug: model,
|
|
1015
1031
|
sort: sort ?? null,
|
|
1016
1032
|
limit: limit ?? COLLECTION_DEFAULT_LIMIT,
|
|
1017
|
-
locale: locale ?? null
|
|
1033
|
+
locale: locale ?? null,
|
|
1034
|
+
previewSecret: previewSecret ?? null
|
|
1018
1035
|
},
|
|
1019
1036
|
requestOptions
|
|
1020
1037
|
);
|
package/dist/internal.d.cts
CHANGED
|
@@ -37,6 +37,7 @@ interface ModelRecordsVariables {
|
|
|
37
37
|
limit?: number | null;
|
|
38
38
|
offset?: number | null;
|
|
39
39
|
populate?: string[] | null;
|
|
40
|
+
previewSecret?: string | null;
|
|
40
41
|
}
|
|
41
42
|
interface ModelRecordsResult {
|
|
42
43
|
public: {
|
|
@@ -91,7 +92,7 @@ type BlockSchemaMap = Record<string, Record<string, FieldDefinition>>;
|
|
|
91
92
|
* page.
|
|
92
93
|
*/
|
|
93
94
|
declare function normalizeBlockContent(content: Record<string, unknown>, schema: Record<string, FieldDefinition>, resolved?: Record<string, unknown>): void;
|
|
94
|
-
declare function resolveRelationContent(config: CmssyClientConfig, entries: RelationContentEntry[], schemas: BlockSchemaMap, locale?: string, requestOptions?: QueryScopedOptions): Promise<void>;
|
|
95
|
+
declare function resolveRelationContent(config: CmssyClientConfig, entries: RelationContentEntry[], schemas: BlockSchemaMap, locale?: string, requestOptions?: QueryScopedOptions, previewSecret?: string): Promise<void>;
|
|
95
96
|
|
|
96
97
|
/**
|
|
97
98
|
* Finds the forms a page needs by reading the blocks' schemas, so a form field
|
package/dist/internal.d.ts
CHANGED
|
@@ -37,6 +37,7 @@ interface ModelRecordsVariables {
|
|
|
37
37
|
limit?: number | null;
|
|
38
38
|
offset?: number | null;
|
|
39
39
|
populate?: string[] | null;
|
|
40
|
+
previewSecret?: string | null;
|
|
40
41
|
}
|
|
41
42
|
interface ModelRecordsResult {
|
|
42
43
|
public: {
|
|
@@ -91,7 +92,7 @@ type BlockSchemaMap = Record<string, Record<string, FieldDefinition>>;
|
|
|
91
92
|
* page.
|
|
92
93
|
*/
|
|
93
94
|
declare function normalizeBlockContent(content: Record<string, unknown>, schema: Record<string, FieldDefinition>, resolved?: Record<string, unknown>): void;
|
|
94
|
-
declare function resolveRelationContent(config: CmssyClientConfig, entries: RelationContentEntry[], schemas: BlockSchemaMap, locale?: string, requestOptions?: QueryScopedOptions): Promise<void>;
|
|
95
|
+
declare function resolveRelationContent(config: CmssyClientConfig, entries: RelationContentEntry[], schemas: BlockSchemaMap, locale?: string, requestOptions?: QueryScopedOptions, previewSecret?: string): Promise<void>;
|
|
95
96
|
|
|
96
97
|
/**
|
|
97
98
|
* Finds the forms a page needs by reading the blocks' schemas, so a form field
|
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.23.0" ;
|
|
156
156
|
var CMSSY_USER_AGENT = `@cmssy/core/${CMSSY_CORE_VERSION}`;
|
|
157
157
|
|
|
158
158
|
// src/data/http.ts
|
|
@@ -638,10 +638,10 @@ var MODEL_DEFINITIONS_QUERY = typedOperation(`query PublicModelDefinitions($work
|
|
|
638
638
|
}
|
|
639
639
|
}
|
|
640
640
|
}`);
|
|
641
|
-
var MODEL_RECORDS_QUERY = typedOperation(`query PublicModelRecords($workspaceId: String!, $modelSlug: String!, $filter: JSON, $sort: String, $locale: String, $limit: Int, $offset: Int, $populate: [String!]) {
|
|
641
|
+
var MODEL_RECORDS_QUERY = typedOperation(`query PublicModelRecords($workspaceId: String!, $modelSlug: String!, $filter: JSON, $sort: String, $locale: String, $limit: Int, $offset: Int, $populate: [String!], $previewSecret: String) {
|
|
642
642
|
public {
|
|
643
643
|
model {
|
|
644
|
-
records(workspaceId: $workspaceId, modelSlug: $modelSlug, filter: $filter, sort: $sort, locale: $locale, limit: $limit, offset: $offset, populate: $populate) {
|
|
644
|
+
records(workspaceId: $workspaceId, modelSlug: $modelSlug, filter: $filter, sort: $sort, locale: $locale, limit: $limit, offset: $offset, populate: $populate, previewSecret: $previewSecret) {
|
|
645
645
|
items { id modelId data status createdAt updatedAt }
|
|
646
646
|
total
|
|
647
647
|
hasMore
|
|
@@ -780,10 +780,10 @@ function createCmssyClient(input) {
|
|
|
780
780
|
}
|
|
781
781
|
|
|
782
782
|
// src/data/block-content.ts
|
|
783
|
-
var RECORDS_BY_IDS_QUERY = typedOperation(`query PublicRecordsByIds($workspaceId: String!, $ids: [String!]!, $locale: String) {
|
|
783
|
+
var RECORDS_BY_IDS_QUERY = typedOperation(`query PublicRecordsByIds($workspaceId: String!, $ids: [String!]!, $locale: String, $previewSecret: String) {
|
|
784
784
|
public {
|
|
785
785
|
model {
|
|
786
|
-
recordsByIds(workspaceId: $workspaceId, ids: $ids, locale: $locale) {
|
|
786
|
+
recordsByIds(workspaceId: $workspaceId, ids: $ids, locale: $locale, previewSecret: $previewSecret) {
|
|
787
787
|
id modelId data status createdAt updatedAt
|
|
788
788
|
}
|
|
789
789
|
}
|
|
@@ -923,7 +923,7 @@ function collectionKey(ref) {
|
|
|
923
923
|
"\0"
|
|
924
924
|
);
|
|
925
925
|
}
|
|
926
|
-
async function resolveRelationContent(config, entries, schemas, locale, requestOptions = {}) {
|
|
926
|
+
async function resolveRelationContent(config, entries, schemas, locale, requestOptions = {}, previewSecret) {
|
|
927
927
|
const refs = collectRefs(entries, schemas);
|
|
928
928
|
if (refs.length === 0) return;
|
|
929
929
|
const client = createCmssyClient(config);
|
|
@@ -947,8 +947,20 @@ async function resolveRelationContent(config, entries, schemas, locale, requestO
|
|
|
947
947
|
let collectionItems;
|
|
948
948
|
try {
|
|
949
949
|
[recordsById, collectionItems] = await Promise.all([
|
|
950
|
-
fetchPickedRecords(
|
|
951
|
-
|
|
950
|
+
fetchPickedRecords(
|
|
951
|
+
client,
|
|
952
|
+
[...pickedIds],
|
|
953
|
+
locale,
|
|
954
|
+
requestOptions,
|
|
955
|
+
previewSecret
|
|
956
|
+
),
|
|
957
|
+
fetchCollections(
|
|
958
|
+
client,
|
|
959
|
+
collections,
|
|
960
|
+
locale,
|
|
961
|
+
requestOptions,
|
|
962
|
+
previewSecret
|
|
963
|
+
)
|
|
952
964
|
]);
|
|
953
965
|
} catch (err) {
|
|
954
966
|
if (typeof console !== "undefined") {
|
|
@@ -982,7 +994,7 @@ async function resolveRelationContent(config, entries, schemas, locale, requestO
|
|
|
982
994
|
}
|
|
983
995
|
}
|
|
984
996
|
}
|
|
985
|
-
async function fetchPickedRecords(client, ids, locale, requestOptions = {}) {
|
|
997
|
+
async function fetchPickedRecords(client, ids, locale, requestOptions = {}, previewSecret) {
|
|
986
998
|
const byId = /* @__PURE__ */ new Map();
|
|
987
999
|
const chunks = [];
|
|
988
1000
|
for (let i = 0; i < ids.length; i += BY_IDS_CHUNK) {
|
|
@@ -992,7 +1004,11 @@ async function fetchPickedRecords(client, ids, locale, requestOptions = {}) {
|
|
|
992
1004
|
chunks.map(async (chunk) => {
|
|
993
1005
|
const result = await client.queryScoped(
|
|
994
1006
|
RECORDS_BY_IDS_QUERY,
|
|
995
|
-
{
|
|
1007
|
+
{
|
|
1008
|
+
ids: chunk,
|
|
1009
|
+
locale: locale ?? null,
|
|
1010
|
+
previewSecret: previewSecret ?? null
|
|
1011
|
+
},
|
|
996
1012
|
requestOptions
|
|
997
1013
|
);
|
|
998
1014
|
for (const record of result.public.model.recordsByIds) {
|
|
@@ -1002,7 +1018,7 @@ async function fetchPickedRecords(client, ids, locale, requestOptions = {}) {
|
|
|
1002
1018
|
);
|
|
1003
1019
|
return byId;
|
|
1004
1020
|
}
|
|
1005
|
-
async function fetchCollections(client, collections, locale, requestOptions = {}) {
|
|
1021
|
+
async function fetchCollections(client, collections, locale, requestOptions = {}, previewSecret) {
|
|
1006
1022
|
const byKey = /* @__PURE__ */ new Map();
|
|
1007
1023
|
await Promise.all(
|
|
1008
1024
|
[...collections.entries()].map(async ([key, { model, sort, limit }]) => {
|
|
@@ -1012,7 +1028,8 @@ async function fetchCollections(client, collections, locale, requestOptions = {}
|
|
|
1012
1028
|
modelSlug: model,
|
|
1013
1029
|
sort: sort ?? null,
|
|
1014
1030
|
limit: limit ?? COLLECTION_DEFAULT_LIMIT,
|
|
1015
|
-
locale: locale ?? null
|
|
1031
|
+
locale: locale ?? null,
|
|
1032
|
+
previewSecret: previewSecret ?? null
|
|
1016
1033
|
},
|
|
1017
1034
|
requestOptions
|
|
1018
1035
|
);
|
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.23.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.23.0" ;
|
|
154
154
|
var CMSSY_USER_AGENT = `@cmssy/core/${CMSSY_CORE_VERSION}`;
|
|
155
155
|
|
|
156
156
|
// src/content/content-client.ts
|