@contentstack/studio-client 1.3.0 → 1.5.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.
Files changed (54) hide show
  1. package/dist/breakpoints/BreakpointManager.js +0 -1
  2. package/dist/breakpoints/BreakpointManager.js.map +1 -1
  3. package/dist/composable-studio/initializer-sdk.js +1 -10
  4. package/dist/composable-studio/initializer-sdk.js.map +1 -1
  5. package/dist/composable-studio/sdk.js +448 -127
  6. package/dist/composable-studio/sdk.js.map +1 -1
  7. package/dist/config/config.schema.js +11 -0
  8. package/dist/config/config.schema.js.map +1 -1
  9. package/dist/config/default-config.js +1 -0
  10. package/dist/config/default-config.js.map +1 -1
  11. package/dist/config/process-user-config.js +10 -1
  12. package/dist/config/process-user-config.js.map +1 -1
  13. package/dist/config/stack-sdk-wrapper.js +52 -12
  14. package/dist/config/stack-sdk-wrapper.js.map +1 -1
  15. package/dist/context-menu/context-menu.js +0 -1
  16. package/dist/context-menu/context-menu.js.map +1 -1
  17. package/dist/design/handle-active-style-change.js +0 -1
  18. package/dist/design/handle-active-style-change.js.map +1 -1
  19. package/dist/dnd/dnd-manager.js +2 -3
  20. package/dist/dnd/dnd-manager.js.map +1 -1
  21. package/dist/highlight-node/highlight-node-manager.js +0 -1
  22. package/dist/highlight-node/highlight-node-manager.js.map +1 -1
  23. package/dist/highlight-node/highlight-node.js +30 -14
  24. package/dist/highlight-node/highlight-node.js.map +1 -1
  25. package/dist/index.d.ts +249 -25
  26. package/dist/index.js +6 -3
  27. package/dist/index.js.map +1 -1
  28. package/dist/node_modules/fflate/esm/browser.js +384 -0
  29. package/dist/node_modules/fflate/esm/browser.js.map +1 -0
  30. package/dist/packages/studio-internal/dist/utils/spec-compression.js +43 -0
  31. package/dist/packages/studio-internal/dist/utils/spec-compression.js.map +1 -0
  32. package/dist/query/expression-resolver.js +124 -0
  33. package/dist/query/expression-resolver.js.map +1 -0
  34. package/dist/query/query-executor.js +327 -0
  35. package/dist/query/query-executor.js.map +1 -0
  36. package/dist/url-change/url-change.js +65 -0
  37. package/dist/url-change/url-change.js.map +1 -0
  38. package/dist/utils/composable-studio-error.js +9 -7
  39. package/dist/utils/composable-studio-error.js.map +1 -1
  40. package/dist/utils/conditionBlock.js +16 -4
  41. package/dist/utils/conditionBlock.js.map +1 -1
  42. package/dist/utils/error-messages.default.js +141 -0
  43. package/dist/utils/error-messages.default.js.map +1 -0
  44. package/dist/utils/error-messages.js +47 -0
  45. package/dist/utils/error-messages.js.map +1 -0
  46. package/dist/utils/http-error.constants.js +96 -0
  47. package/dist/utils/http-error.constants.js.map +1 -0
  48. package/dist/utils/is-inside-iframe.js +16 -0
  49. package/dist/utils/is-inside-iframe.js.map +1 -0
  50. package/dist/utils/reference_fetcher.js +104 -8
  51. package/dist/utils/reference_fetcher.js.map +1 -1
  52. package/dist/utils/sdk.js +3 -0
  53. package/dist/utils/sdk.js.map +1 -1
  54. package/package.json +9 -8
@@ -14,14 +14,21 @@ const evaluateCondition = (condition, data) => {
14
14
  return handleNumberComparison(condition.operator, numValue, condition.value);
15
15
  }
16
16
  case "string": {
17
- const strValue = String(conditionValue);
17
+ const normalizedStr = conditionValue == null ? "" : String(conditionValue);
18
+ const strValue = normalizedStr;
18
19
  const compareValue = condition.caseSensitive
19
20
  ? strValue
20
21
  : strValue.toLowerCase();
21
- const conditionValueString = condition.caseSensitive
22
- ? condition.value
23
- : condition.value.toLowerCase();
22
+ const conditionValueString = condition.value != null
23
+ ? condition.caseSensitive
24
+ ? String(condition.value)
25
+ : String(condition.value).toLowerCase()
26
+ : "";
24
27
  switch (condition.operator) {
28
+ case "isEmpty":
29
+ return strValue === "";
30
+ case "isNotEmpty":
31
+ return strValue !== "";
25
32
  case "contains":
26
33
  return compareValue.includes(conditionValueString);
27
34
  case "startsWith":
@@ -41,6 +48,7 @@ const evaluateCondition = (condition, data) => {
41
48
  case "boolean":
42
49
  switch (condition.operator) {
43
50
  case "is":
51
+ case "eq":
44
52
  return isEqual(conditionValue, condition.value);
45
53
  default:
46
54
  return false;
@@ -51,6 +59,7 @@ const evaluateCondition = (condition, data) => {
51
59
  case "modular_block":
52
60
  switch (condition.operator) {
53
61
  case "is":
62
+ case "eq":
54
63
  return !!conditionValue;
55
64
  default:
56
65
  return handleArrayCondition(condition, conditionValue);
@@ -63,6 +72,7 @@ const evaluateCondition = (condition, data) => {
63
72
  case "select":
64
73
  switch (condition.operator) {
65
74
  case "is":
75
+ case "eq":
66
76
  return isEqual(conditionValue, condition.value);
67
77
  case "isNot":
68
78
  return isNotEqual(conditionValue, condition.value);
@@ -77,6 +87,7 @@ const evaluateCondition = (condition, data) => {
77
87
  const extension = conditionValue.split(".").pop();
78
88
  switch (condition.operator) {
79
89
  case "is":
90
+ case "eq":
80
91
  return isEqual(extension, condition.value);
81
92
  case "isNot":
82
93
  return isNotEqual(extension, condition.value);
@@ -91,6 +102,7 @@ const evaluateCondition = (condition, data) => {
91
102
  case "reference": {
92
103
  switch (condition.operator) {
93
104
  case "contentTypeIs":
105
+ case "eq":
94
106
  return isEqual(conditionValue, condition.value);
95
107
  default:
96
108
  return handleArrayCondition(condition, conditionValue);
@@ -1 +1 @@
1
- {"version":3,"file":"conditionBlock.js","sources":["../../src/utils/conditionBlock.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;AAWA;MACa,iBAAiB,GAAG,CAAC,SAAoB,EAAE,IAAS,KAAa;AAC5E,IAAA,IAAI,CAAC,SAAS,EAAE,gBAAgB,EAAE;AAChC,QAAA,OAAO,KAAK;IACd;AACA,IAAA,MAAM,cAAc,GAAG,GAAG,CACxB,IAAI,EACJ,gBAAgB,CAAC,SAAS,EAAE,gBAAgB,CAAC,CAC9C;AAED,IAAA,QAAQ,SAAS,EAAE,IAAI;QACrB,KAAK,QAAQ,EAAE;AACb,YAAA,MAAM,QAAQ,GAAG,MAAM,CAAC,cAAc,CAAC;AACvC,YAAA,OAAO,sBAAsB,CAC3B,SAAS,CAAC,QAAQ,EAClB,QAAQ,E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AAQ;AACxB,gBAAA,KAAK,eAAe;AACpB,gBAAA,KAAK,IAAI;oBACP,OAAO,OAAO,CAAC,cAAc,EAAE,SAAS,CAAC,KAAK,CAAC;AACjD,gBAAA;AACE,oBAAA,OAAO,oBAAoB,CAAC,SAAS,EAAE,cAAc,CAAC;;QAE5D;AAEA,QAAA;AACE,YAAA,OAAO,KAAK;;AAElB;AAEA,SAAS,oBAAoB,CAAC,SAAoB,EAAE,cAAmB,EAAA;AACrE,IAAA,MAAM,UAAU,GAAG,KAAK,CAAC,OAAO,CAAC,cAAc,CAAC,GAAG,cAAc,GAAG,EAAE;AACtE,IAAA,OAAO,sBAAsB,CAC3B,SAAS,CAAC,QAAQ,EAClB,UAAU,CAAC,MAAM,EACjB,SAAS,CAAC,KAAK,CAChB;AACH;AAEA,SAAS,sBAAsB,CAC7B,QAAgB,EAChB,MAAc,EACd,MAAc,EAAA;IAEd,QAAQ,QAAQ;AACd,QAAA,KAAK,IAAI;AACP,YAAA,OAAO,OAAO,CAAC,MAAM,EAAE,MAAM,CAAC;AAChC,QAAA,KAAK,KAAK;AACR,YAAA,OAAO,UAAU,CAAC,MAAM,EAAE,MAAM,CAAC;AACnC,QAAA,KAAK,IAAI;AACP,YAAA,OAAO,aAAa,CAAC,MAAM,EAAE,MAAM,CAAC;AACtC,QAAA,KAAK,KAAK;AACR,YAAA,OAAO,oBAAoB,CAAC,MAAM,EAAE,MAAM,CAAC;AAC7C,QAAA,KAAK,IAAI;AACP,YAAA,OAAO,UAAU,CAAC,MAAM,EAAE,MAAM,CAAC;AACnC,QAAA,KAAK,KAAK;AACR,YAAA,OAAO,iBAAiB,CAAC,MAAM,EAAE,MAAM,CAAC;AAC1C,QAAA;AACE,YAAA,OAAO,KAAK;;AAElB;;;;"}
@@ -0,0 +1,141 @@
1
+ /**
2
+ * Keys for error message lookup. Use these constants instead of string literals.
3
+ * @internal
4
+ */
5
+ const ErrorMessageKey = {
6
+ AUTHENTICATION_ERROR: "AUTHENTICATION_ERROR",
7
+ INVALID_CREDENTIALS_DEFAULT: "INVALID_CREDENTIALS_DEFAULT",
8
+ NETWORK_ERROR_EMPTY: "NETWORK_ERROR_EMPTY",
9
+ NETWORK_ERROR_GENERIC: "NETWORK_ERROR_GENERIC",
10
+ NETWORK_ERROR_DETAIL_DEFAULT: "NETWORK_ERROR_DETAIL_DEFAULT",
11
+ COMPOSITION_NOT_FOUND_404: "COMPOSITION_NOT_FOUND_404",
12
+ SERVER_ERROR: "SERVER_ERROR",
13
+ SERVER_ERROR_DETAIL_DEFAULT: "SERVER_ERROR_DETAIL_DEFAULT",
14
+ COMPOSITION_NOT_FOUND_API: "COMPOSITION_NOT_FOUND_API",
15
+ COMPOSITION_NOT_FOUND_API_DETAIL_DEFAULT: "COMPOSITION_NOT_FOUND_API_DETAIL_DEFAULT",
16
+ COMPOSITION_NOT_FOUND_DEFAULT: "COMPOSITION_NOT_FOUND_DEFAULT",
17
+ FETCHING_CONNECTED_DATA_FAILED: "FETCHING_CONNECTED_DATA_FAILED",
18
+ PREVIEW_ENTRY_NOT_FOUND: "PREVIEW_ENTRY_NOT_FOUND",
19
+ STACK_SDK_NOT_AVAILABLE: "STACK_SDK_NOT_AVAILABLE",
20
+ UI_PARSING_ERROR: "UI_PARSING_ERROR",
21
+ COMPOSITION_NOT_FOUND_BY_URL: "COMPOSITION_NOT_FOUND_BY_URL",
22
+ MISSING_COMPOSITION_IDENTIFIER: "MISSING_COMPOSITION_IDENTIFIER",
23
+ };
24
+ /**
25
+ * Default (en) error message templates. Single source of truth for user-facing error messages.
26
+ * Use getErrorMessage() with ErrorMessageKey constants to resolve messages with placeholders.
27
+ * @internal
28
+ */
29
+ const defaultErrorMessages = {
30
+ [ErrorMessageKey.AUTHENTICATION_ERROR]: "Authentication failed: {detail}",
31
+ [ErrorMessageKey.INVALID_CREDENTIALS_DEFAULT]: "Invalid API key or delivery token. Please check your credentials.",
32
+ [ErrorMessageKey.NETWORK_ERROR_EMPTY]: "Network error: Unable to connect to Contentstack API. Please check your internet connection, API endpoint, and credentials.",
33
+ [ErrorMessageKey.NETWORK_ERROR_GENERIC]: "Network error: {detail}",
34
+ [ErrorMessageKey.NETWORK_ERROR_DETAIL_DEFAULT]: "Failed to connect to API",
35
+ [ErrorMessageKey.COMPOSITION_NOT_FOUND_404]: "Composition not found. The requested composition does not exist or has been deleted.",
36
+ [ErrorMessageKey.SERVER_ERROR]: "Server error ({statusCode}): {detail}",
37
+ [ErrorMessageKey.SERVER_ERROR_DETAIL_DEFAULT]: "The server encountered an error. Please try again later.",
38
+ [ErrorMessageKey.COMPOSITION_NOT_FOUND_API]: "API error ({statusCode}): {detail}",
39
+ [ErrorMessageKey.COMPOSITION_NOT_FOUND_API_DETAIL_DEFAULT]: "Failed to fetch composition",
40
+ [ErrorMessageKey.COMPOSITION_NOT_FOUND_DEFAULT]: "Composition not found. An unexpected error occurred while fetching the composition.",
41
+ [ErrorMessageKey.FETCHING_CONNECTED_DATA_FAILED]: "Failed to fetch connected data",
42
+ [ErrorMessageKey.PREVIEW_ENTRY_NOT_FOUND]: "Preview entry not found for content type: {contentType}. The connected content type does not have an entry matching the composition query.",
43
+ [ErrorMessageKey.STACK_SDK_NOT_AVAILABLE]: "Stack SDK not available to fetch composition.",
44
+ [ErrorMessageKey.UI_PARSING_ERROR]: "Failed to parse composition UI structure",
45
+ [ErrorMessageKey.COMPOSITION_NOT_FOUND_BY_URL]: "Composition not found for URL: {url}. No composition matches the provided URL pattern.",
46
+ [ErrorMessageKey.MISSING_COMPOSITION_IDENTIFIER]: "Please provide either composableUid or url to fetch the composition.",
47
+ };
48
+ /**
49
+ * Keys for troubleshooting info lookup. Use with getTroubleshootingInfo().
50
+ * @internal
51
+ */
52
+ const TroubleshootingInfoKey = {
53
+ NETWORK_ERROR: "NETWORK_ERROR",
54
+ AUTHENTICATION_ERROR: "AUTHENTICATION_ERROR",
55
+ COMPOSITION_NOT_FOUND_URL: "COMPOSITION_NOT_FOUND_URL",
56
+ COMPOSITION_NOT_FOUND_UID: "COMPOSITION_NOT_FOUND_UID",
57
+ PREVIEW_ENTRY_NOT_FOUND: "PREVIEW_ENTRY_NOT_FOUND",
58
+ };
59
+ /**
60
+ * Default (en) troubleshooting info by key. Single source of truth for cause/fix strings.
61
+ * @internal
62
+ */
63
+ const defaultTroubleshootingInfo = {
64
+ [TroubleshootingInfoKey.NETWORK_ERROR]: [
65
+ {
66
+ cause: "Network connectivity issue",
67
+ fix: "Check your internet connection and try again. Verify that the API endpoint is accessible.",
68
+ },
69
+ {
70
+ cause: "Invalid API credentials",
71
+ fix: "Verify your API key and delivery token are correct in the SDK configuration.",
72
+ },
73
+ {
74
+ cause: "Incorrect API endpoint",
75
+ fix: "Ensure the API endpoint URL is correct and points to the right Contentstack region.",
76
+ },
77
+ ],
78
+ [TroubleshootingInfoKey.AUTHENTICATION_ERROR]: [
79
+ {
80
+ cause: "Invalid API key",
81
+ fix: "Verify your API key is correct and has the necessary permissions. Check your Contentstack dashboard for the correct API key.",
82
+ },
83
+ {
84
+ cause: "Invalid delivery token",
85
+ fix: "Ensure your delivery token is valid and not expired. Generate a new token if needed.",
86
+ },
87
+ {
88
+ cause: "Missing permissions",
89
+ fix: "Check that your API credentials have the required permissions to access the content type and entries.",
90
+ },
91
+ ],
92
+ [TroubleshootingInfoKey.COMPOSITION_NOT_FOUND_URL]: [
93
+ {
94
+ cause: "No composition found for this URL",
95
+ fix: "Verify the URL is correct and matches an existing composition. Check that the composition is published and accessible.",
96
+ },
97
+ {
98
+ cause: "URL pattern does not match any composition",
99
+ fix: "Ensure the URL pattern in your composition matches the requested URL. Check the composition's URL field in Contentstack.",
100
+ },
101
+ {
102
+ cause: "Composition not published",
103
+ fix: "Publish the composition in Contentstack or use a preview/draft token to access unpublished content.",
104
+ },
105
+ ],
106
+ [TroubleshootingInfoKey.COMPOSITION_NOT_FOUND_UID]: [
107
+ {
108
+ cause: "Composition does not exist",
109
+ fix: "Verify the composition UID is correct. Check that the composition exists in your Contentstack stack.",
110
+ },
111
+ {
112
+ cause: "Composition UID is incorrect",
113
+ fix: "Double-check the composition UID you're using. You can find the correct UID on the composition listing page in studio",
114
+ },
115
+ {
116
+ cause: "Composition not published",
117
+ fix: "Publish the composition in Contentstack or use a preview/draft token to access unpublished content.",
118
+ },
119
+ ],
120
+ [TroubleshootingInfoKey.PREVIEW_ENTRY_NOT_FOUND]: [
121
+ {
122
+ cause: "No entry exists for the connected content type",
123
+ fix: "Create an entry for the connected content type in Contentstack, or verify the content type is correctly configured.",
124
+ },
125
+ {
126
+ cause: "URL pattern does not match any entry",
127
+ fix: "Ensure the URL in your composition query matches the URL field of an entry in the connected content type.",
128
+ },
129
+ {
130
+ cause: "Entry was deleted or unpublished",
131
+ fix: "Check if the entry exists and is published. Restore it from trash if deleted, or publish it if it's in draft state.",
132
+ },
133
+ {
134
+ cause: "Incorrect content type configuration",
135
+ fix: "Verify that the connected_content_type field in your composition is set to the correct content type UID.",
136
+ },
137
+ ],
138
+ };
139
+
140
+ export { ErrorMessageKey, TroubleshootingInfoKey, defaultErrorMessages, defaultTroubleshootingInfo };
141
+ //# sourceMappingURL=error-messages.default.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"error-messages.default.js","sources":["../../src/utils/error-messages.default.ts"],"sourcesContent":[null],"names":[],"mappings":"AAAA;;;AAGG;AACI,MAAM,eAAe,GAAG;AAC7B,IAAA,oBAAoB,EAAE,sBAAsB;AAC5C,IAAA,2BAA2B,EAAE,6BAA6B;AAC1D,IAAA,mBAAmB,EAAE,qBAAqB;AAC1C,IAAA,qBAAqB,EAAE,uBAAuB;AAC9C,IAAA,4BAA4B,EAAE,8BAA8B;AAC5D,IAAA,yBAAyB,EAAE,2BAA2B;AACtD,IAAA,YAAY,EAAE,cAAc;AAC5B,IAAA,2BAA2B,EAAE,6BAA6B;AAC1D,IAAA,yBAAyB,EAAE,2BAA2B;AACtD,IAAA,wCAAwC,EACtC,0CAA0C;AAC5C,IAAA,6BAA6B,EAAE,+BAA+B;AAC9D,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4BAA4B;AACnC,YAAA,GAAG,EAAE,sGAAsG;AAC5G,SAAA;AACD,QAAA;AACE,YAAA,KAAK,EAAE,8BAA8B;AACrC,YAAA,GAAG,EAAE,uHAAuH;AAC7H,SAAA;AACD,QAAA;AACE,YAAA,KAAK,EAAE,2BAA2B;AAClC,YAAA,GAAG,EAAE,qGAAqG;AAC3G,SAAA;AACF,KAAA;AACD,IAAA,CAAC,sBAAsB,CAAC,uBAAuB,GAAG;AAChD,QAAA;AACE,YAAA,KAAK,EAAE,gDAAgD;AACvD,YAAA,GAAG,EAAE,qHAAqH;AAC3H,SAAA;AACD,QAAA;AACE,YAAA,KAAK,EAAE,sCAAsC;AAC7C,YAAA,GAAG,EAAE,2GAA2G;AACjH,SAAA;AACD,QAAA;AACE,YAAA,KAAK,EAAE,kCAAkC;AACzC,YAAA,GAAG,EAAE,qHAAqH;AAC3H,SAAA;AACD,QAAA;AACE,YAAA,KAAK,EAAE,sCAAsC;AAC7C,YAAA,GAAG,EAAE,0GAA0G;AAChH,SAAA;AACF,KAAA;;;;;"}
@@ -0,0 +1,47 @@
1
+ import { defaultErrorMessages, defaultTroubleshootingInfo } from './error-messages.default.js';
2
+ export { ErrorMessageKey, TroubleshootingInfoKey } from './error-messages.default.js';
3
+
4
+ /**
5
+ * Error message lookup for studio-client. Messages are defined in error-messages.default.ts.
6
+ * Use getErrorMessage with ErrorMessageKey constants (no string literals).
7
+ * @internal
8
+ */
9
+ /**
10
+ * Returns the message string for the given key, substituting placeholders with params.
11
+ * Placeholders: {detail}, {statusCode}, {url}
12
+ * Use ErrorMessageKey constants for the key argument.
13
+ * @internal
14
+ */
15
+ function getErrorMessage(key, params) {
16
+ let template = defaultErrorMessages[key];
17
+ if (template == null) {
18
+ return String(key);
19
+ }
20
+ if (!params) {
21
+ return template;
22
+ }
23
+ if (params.detail !== undefined) {
24
+ template = template.replace(/\{detail\}/g, String(params.detail));
25
+ }
26
+ if (params.statusCode !== undefined) {
27
+ template = template.replace(/\{statusCode\}/g, String(params.statusCode));
28
+ }
29
+ if (params.url !== undefined) {
30
+ template = template.replace(/\{url\}/g, String(params.url));
31
+ }
32
+ if (params.contentType !== undefined) {
33
+ template = template.replace(/\{contentType\}/g, String(params.contentType));
34
+ }
35
+ return template;
36
+ }
37
+ /**
38
+ * Returns troubleshooting info (cause/fix pairs) for the given key.
39
+ * Use TroubleshootingInfoKey constants. Return type is compatible with TroubleshootingInfo[].
40
+ * @internal
41
+ */
42
+ function getTroubleshootingInfo(key) {
43
+ return defaultTroubleshootingInfo[key] ?? [];
44
+ }
45
+
46
+ export { getErrorMessage, getTroubleshootingInfo };
47
+ //# sourceMappingURL=error-messages.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"error-messages.js","sources":["../../src/utils/error-messages.ts"],"sourcesContent":[null],"names":[],"mappings":";;;AAAA;;;;AAIG;AAyBH;;;;;AAKG;AACG,SAAU,eAAe,CAC7B,GAAwB,EACxB,MAA2B,EAAA;AAE3B,IAAA,IAAI,QAAQ,GAAG,oBAAoB,CAAC,GAAG,CAAC;AACxC,IAAA,IAAI,QAAQ,IAAI,IAAI,EAAE;AACpB,QAAA,OAAO,MAAM,CAAC,GAAG,CAAC;IACpB;IACA,IAAI,CAAC,MAAM,EAAE;AACX,QAAA,OAAO,QAAQ;IACjB;AACA,IAAA,IAAI,MAAM,CAAC,MAAM,KAAK,SAAS,EAAE;AAC/B,QAAA,QAAQ,GAAG,QAAQ,CAAC,OAAO,CAAC,aAAa,EAAE,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IACnE;AACA,IAAA,IAAI,MAAM,CAAC,UAAU,KAAK,SAAS,EAAE;AACnC,QAAA,QAAQ,GAAG,QAAQ,CAAC,OAAO,CAAC,iBAAiB,EAAE,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;IAC3E;AACA,IAAA,IAAI,MAAM,CAAC,GAAG,KAAK,SAAS,EAAE;AAC5B,QAAA,QAAQ,GAAG,QAAQ,CAAC,OAAO,CAAC,UAAU,EAAE,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;IAC7D;AACA,IAAA,IAAI,MAAM,CAAC,WAAW,KAAK,SAAS,EAAE;AACpC,QAAA,QAAQ,GAAG,QAAQ,CAAC,OAAO,CAAC,kBAAkB,EAAE,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;IAC7E;AACA,IAAA,OAAO,QAAQ;AACjB;AAEA;;;;AAIG;AACG,SAAU,sBAAsB,CACpC,GAA+B,EAAA;AAE/B,IAAA,OAAO,0BAA0B,CAAC,GAAG,CAAC,IAAI,EAAE;AAC9C;;;;"}
@@ -0,0 +1,96 @@
1
+ /**
2
+ * HTTP status code constants and helpers for error classification.
3
+ * @internal
4
+ */
5
+ const HttpStatus = {
6
+ UNAUTHORIZED: 401,
7
+ FORBIDDEN: 403,
8
+ NOT_FOUND: 404,
9
+ SERVER_ERROR_MIN: 500,
10
+ SERVER_ERROR_MAX: 599,
11
+ };
12
+ /**
13
+ * Contentstack API error codes (from Contentstack API responses).
14
+ * @internal
15
+ */
16
+ const ContentstackErrorCode = {
17
+ UNAUTHORIZED: 104,
18
+ INVALID_CREDENTIALS: 105,
19
+ ENTRY_NOT_FOUND: 141,
20
+ };
21
+ /**
22
+ * Node.js / network error codes that indicate connection failures.
23
+ * @internal
24
+ */
25
+ const NetworkErrorCode = {
26
+ ENOTFOUND: "ENOTFOUND",
27
+ ECONNREFUSED: "ECONNREFUSED",
28
+ ETIMEDOUT: "ETIMEDOUT",
29
+ };
30
+ const NETWORK_ERROR_CODES = [
31
+ NetworkErrorCode.ENOTFOUND,
32
+ NetworkErrorCode.ECONNREFUSED,
33
+ NetworkErrorCode.ETIMEDOUT,
34
+ ];
35
+ const NETWORK_ERROR_TYPE = "network";
36
+ /**
37
+ * Returns the HTTP status code from an error object (supports both status and statusCode).
38
+ * @internal
39
+ */
40
+ function getStatusCode(err) {
41
+ const code = err?.status ?? err?.statusCode;
42
+ return typeof code === "number" && Number.isFinite(code) ? code : undefined;
43
+ }
44
+ /**
45
+ * Returns true if the status code indicates an authentication/authorization error (401 or 403).
46
+ * @internal
47
+ */
48
+ function isAuthError(statusCode) {
49
+ return (statusCode === HttpStatus.UNAUTHORIZED ||
50
+ statusCode === HttpStatus.FORBIDDEN);
51
+ }
52
+ /**
53
+ * Returns true if the status code indicates a server error (5xx).
54
+ * @internal
55
+ */
56
+ function isServerError(statusCode) {
57
+ return (statusCode >= HttpStatus.SERVER_ERROR_MIN &&
58
+ statusCode <= HttpStatus.SERVER_ERROR_MAX);
59
+ }
60
+ /**
61
+ * Returns true if the error is a Contentstack auth error by error_code (104 or 105).
62
+ * @internal
63
+ */
64
+ function isContentstackAuthError(err) {
65
+ const code = err?.error_code;
66
+ return (code === ContentstackErrorCode.UNAUTHORIZED ||
67
+ code === ContentstackErrorCode.INVALID_CREDENTIALS);
68
+ }
69
+ /**
70
+ * Returns true if the error has Contentstack auth error shape (errors.api_key or errors.authorization)
71
+ * without necessarily having an HTTP status. Used when API returns auth failure in body only.
72
+ * @internal
73
+ */
74
+ function hasAuthErrorShape(err) {
75
+ if (!err || typeof err !== "object")
76
+ return false;
77
+ const apiKey = err?.errors?.api_key;
78
+ const auth = err?.errors?.authorization;
79
+ return ((Array.isArray(apiKey) && apiKey.length > 0) ||
80
+ (Array.isArray(auth) && auth.length > 0));
81
+ }
82
+ /**
83
+ * Returns true if the error indicates a network-level failure (no HTTP response).
84
+ * @internal
85
+ */
86
+ function isNetworkError(err) {
87
+ if (!err)
88
+ return false;
89
+ const code = err?.code;
90
+ const type = err?.type;
91
+ return ((typeof code === "string" && NETWORK_ERROR_CODES.includes(code)) ||
92
+ type === NETWORK_ERROR_TYPE);
93
+ }
94
+
95
+ export { ContentstackErrorCode, HttpStatus, NETWORK_ERROR_CODES, NETWORK_ERROR_TYPE, NetworkErrorCode, getStatusCode, hasAuthErrorShape, isAuthError, isContentstackAuthError, isNetworkError, isServerError };
96
+ //# sourceMappingURL=http-error.constants.js.map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CAAC,gBAAgB;AAE7C;AAEA;;;AAGG;AACG,SAAU,uBAAuB,CAAC,GAAQ,EAAA;AAC9C,IAAA,MAAM,IAAI,GAAG,GAAG,EAAE,UAAU;AAC5B,IAAA,QACE,IAAI,KAAK,qBAAqB,CAAC,YAAY;AAC3C,QAAA,IAAI,KAAK,qBAAqB,CAAC,mBAAmB;AAEtD;AAEA;;;;AAIG;AACG,SAAU,iBAAiB,CAAC,GAAQ,EAAA;AACxC,IAAA,IAAI,CAAC,GAAG,IAAI,OAAO,GAAG,KAAK,QAAQ;AAAE,QAAA,OAAO,KAAK;AACjD,IAAA,MAAM,MAAM,GAAG,GAAG,EAAE,MAAM,EAAE,OAAO;AACnC,IAAA,MAAM,IAAI,GAAG,GAAG,EAAE,MAAM,EAAE,aAAa;AACvC,IAAA,QACE,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC;AAC3C,SAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC;AAE5C;AAEA;;;AAGG;AACG,SAAU,cAAc,CAAC,GAAQ,EAAA;AACrC,IAAA,IAAI,CAAC,GAAG;AAAE,QAAA,OAAO,KAAK;AACtB,IAAA,MAAM,IAAI,GAAG,GAAG,EAAE,IAAI;AACtB,IAAA,MAAM,IAAI,GAAG,GAAG,EAAE,IAAI;AACtB,IAAA,QACE,CAAC,OAAO,IAAI,KAAK,QAAQ,IAAI,mBAAmB,CAAC,QAAQ,CAAC,IAAW,CAAC;QACtE,IAAI,KAAK,kBAAkB;AAE/B;;;;"}
@@ -0,0 +1,16 @@
1
+ import { IS_BROWSER } from '@contentstack/studio-messenger';
2
+
3
+ /**
4
+ * Checks if the current context is inside an iframe.
5
+ *
6
+ * @returns {boolean} True if inside an iframe, false otherwise.
7
+ */
8
+ const isInsideIframe = () => {
9
+ if (!IS_BROWSER) {
10
+ return false;
11
+ }
12
+ return window.self !== window.top;
13
+ };
14
+
15
+ export { isInsideIframe };
16
+ //# sourceMappingURL=is-inside-iframe.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"is-inside-iframe.js","sources":["../../src/utils/is-inside-iframe.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAEA;;;;AAIG;AACI,MAAM,cAAc,GAAG,MAAc;IAC1C,IAAI,CAAC,UAAU,EAAE;AACf,QAAA,OAAO,KAAK;IACd;AACA,IAAA,OAAO,MAAM,CAAC,IAAI,KAAK,MAAM,CAAC,GAAG;AACnC;;;;"}
@@ -1,6 +1,7 @@
1
1
  import { DATA_SOURCES } from '@contentstack/studio-registry';
2
2
  import { uniq, merge } from 'lodash-es';
3
3
  import { getBindingStringForCS } from './sdk.js';
4
+ import { decompressSpec } from '../packages/studio-internal/dist/utils/spec-compression.js';
4
5
 
5
6
  /**
6
7
  * Helper function to process binding logic for template, contentstack, and repeater bindings
@@ -89,7 +90,7 @@ const getExtendedParams = (ct_uid, options) => {
89
90
  const getEntriesQueries = (compositionEntry, connectedContentTypeUid, options) => {
90
91
  const { ui: uiString } = compositionEntry;
91
92
  // TODO: error handling
92
- const ui = JSON.parse(uiString);
93
+ const ui = decompressSpec(uiString);
93
94
  const templateBindings = {
94
95
  path: {},
95
96
  };
@@ -99,6 +100,23 @@ const getEntriesQueries = (compositionEntry, connectedContentTypeUid, options) =
99
100
  // const repeaterBindings: string[] = [];
100
101
  // { ct_uid: { entry_uid: { path: {} } }}
101
102
  const staticBindings = {};
103
+ // Collects reference paths for static (contentstack) entries directly during
104
+ // traversal. When a REPEATER-type repeater is found inside a CONTENTSTACK
105
+ // context, runningPath gives the full path from entry root (e.g.
106
+ // "modular_blocks.experience.spa_service") — that's the reference path.
107
+ // This avoids building a nested tree in staticBindings which would include
108
+ // non-reference intermediate levels that the CMA API rejects (422).
109
+ const staticEntryRefPaths = {};
110
+ // Tracks which contentstack entry context we're currently inside
111
+ let currentStaticEntryKey = null;
112
+ // Collects template repeater reference paths directly during traversal.
113
+ // generateQueryDetails infers references from tree structure (nodes with
114
+ // children = references), but the reference condition handler creates
115
+ // intermediate nodes (e.g. "modular_blocks.test") that aren't references.
116
+ // This produces wrong include[] paths. Instead, we collect the actual
117
+ // reference paths here — the full schema path at each REPEATER-type
118
+ // repeater inside a reference condition.
119
+ const templateRepeaterRefPaths = [];
102
120
  // collects all templateBindings and static Bindings
103
121
  const traveller = (node, runningPath = [], runningRepeaterNode = templateRepeaterBindings.path) => {
104
122
  // HANDLE REPEATER REFERENCE BINDINGS
@@ -107,11 +125,43 @@ const getEntriesQueries = (compositionEntry, connectedContentTypeUid, options) =
107
125
  runningPath.push(node.metadata.condition.value);
108
126
  }
109
127
  if (node.metadata?.condition?.type === "reference") {
110
- const path = getSchemaPath(runningPath).join(".");
111
- if (!runningRepeaterNode[path]) {
112
- runningRepeaterNode[path] = {};
128
+ // The reference condition appears AFTER the repeater that iterates
129
+ // the reference field. So runningPath already includes the reference
130
+ // field name (e.g. ["modular_blocks","test","reference"]).
131
+ // Record this as the include[] path right here — the REPEATERs
132
+ // inside the reference condition are for fields INSIDE the referenced
133
+ // entry (not reference fields themselves).
134
+ const refPath = getSchemaPath(runningPath).join(".");
135
+ if (refPath) {
136
+ if (currentStaticEntryKey) {
137
+ const { ct_uid, entry_uid } = currentStaticEntryKey;
138
+ if (!staticEntryRefPaths[ct_uid]) {
139
+ staticEntryRefPaths[ct_uid] = {};
140
+ }
141
+ if (!staticEntryRefPaths[ct_uid][entry_uid]) {
142
+ staticEntryRefPaths[ct_uid][entry_uid] = [];
143
+ }
144
+ staticEntryRefPaths[ct_uid][entry_uid].push(refPath);
145
+ }
146
+ else {
147
+ templateRepeaterRefPaths.push(refPath);
148
+ }
149
+ }
150
+ // Use the absolute reference path at the top level of
151
+ // templateRepeaterBindings so that generateQueryDetails produces
152
+ // the correct onlyParent for fields inside this reference condition
153
+ // (e.g. "sections_of_the_page.experiences_activities.reference").
154
+ // Previously this nested the path inside runningRepeaterNode, which
155
+ // caused the parent to be "reference.sections_of_the_page…" — an
156
+ // invalid Contentstack only[] key that was silently ignored, leaving
157
+ // referenced-entry fields (e.g. image.url) out of the only[] projection
158
+ // and therefore absent from the API response.
159
+ if (refPath) {
160
+ if (!templateRepeaterBindings.path[refPath]) {
161
+ templateRepeaterBindings.path[refPath] = {};
162
+ }
163
+ runningRepeaterNode = templateRepeaterBindings.path[refPath];
113
164
  }
114
- runningRepeaterNode = runningRepeaterNode[path];
115
165
  }
116
166
  }
117
167
  const isRepeaterNode = node.type === "repeater";
@@ -134,13 +184,43 @@ const getEntriesQueries = (compositionEntry, connectedContentTypeUid, options) =
134
184
  staticBindings[_content_type_uid][uid] = { path: {} };
135
185
  }
136
186
  merge(staticBindings[_content_type_uid][uid].path, path);
187
+ // Start tracking which contentstack entry we're inside
188
+ currentStaticEntryKey = { ct_uid: _content_type_uid, entry_uid: uid };
189
+ }
190
+ else if (type === DATA_SOURCES.REPEATER) {
191
+ // Nested repeater inside a repeater — update the tree for
192
+ // onlyPaths tracking.
193
+ const bindingStr = getBindingStringForCS(items.binding);
194
+ if (bindingStr) {
195
+ if (!runningRepeaterNode[bindingStr]) {
196
+ runningRepeaterNode[bindingStr] = {};
197
+ }
198
+ runningRepeaterNode = runningRepeaterNode[bindingStr];
199
+ // Note: reference path recording is handled at the reference
200
+ // condition block (above), NOT here. The reference condition
201
+ // appears AFTER the repeater that iterates the reference field,
202
+ // so its runningPath already has the correct include[] path.
203
+ // Recording here would incorrectly include non-reference fields
204
+ // (like modular_blocks inside a referenced entry).
205
+ }
137
206
  }
138
207
  }
139
208
  }
140
209
  if (isConditionBlockNode) {
141
210
  if (node.metadata?.condition) {
142
211
  const { conditionBinding } = node.metadata.condition;
143
- processBinding(conditionBinding, templateBindings, staticBindings, runningRepeaterNode);
212
+ // Inside a contentstack repeater context, condition bindings that
213
+ // point back to the same static entry would add deep paths (e.g.
214
+ // modular_blocks.test.reference.modular_blocks) to staticBindings.
215
+ // generateQueryDetails treats intermediate nodes as references,
216
+ // producing invalid include[] paths. Skip CONTENTSTACK condition
217
+ // bindings when inside a repeater — the entry's include paths are
218
+ // already handled by staticEntryRefPaths.
219
+ const skipForStaticEntry = currentStaticEntryKey &&
220
+ conditionBinding?.type === DATA_SOURCES.CONTENTSTACK;
221
+ if (!skipForStaticEntry) {
222
+ processBinding(conditionBinding, templateBindings, staticBindings, runningRepeaterNode);
223
+ }
144
224
  }
145
225
  }
146
226
  for (const propKey in node.props) {
@@ -172,7 +252,7 @@ const getEntriesQueries = (compositionEntry, connectedContentTypeUid, options) =
172
252
  // generate query for templateBinding and each static binding
173
253
  const { referencePaths: templateReferencesPath, onlyPaths: templateOnlyKeys, } = generateQueryDetails(templateBindings);
174
254
  const { includeReferences: extendedReferencesPath, onlyPaths: extendedOnlyKeys, } = getExtendedParams(connectedContentTypeUid, options);
175
- const { referencePaths: repeaterReferencesPath, onlyPaths: repeaterOnlyKeys, } = generateQueryDetails(templateRepeaterBindings);
255
+ const { onlyPaths: repeaterOnlyKeys } = generateQueryDetails(templateRepeaterBindings);
176
256
  const contentstackEntriesReferencesPath = {};
177
257
  const contentstackEntriesOnlyKeys = {};
178
258
  for (const _content_type_uid in staticBindings) {
@@ -182,9 +262,19 @@ const getEntriesQueries = (compositionEntry, connectedContentTypeUid, options) =
182
262
  contentstackEntriesOnlyKeys[_content_type_uid] = {};
183
263
  const { referencePaths, onlyPaths } = generateQueryDetails(path);
184
264
  const { includeReferences, onlyPaths: extendedOnlyPaths } = getExtendedParams(_content_type_uid, options);
265
+ // Merge reference paths collected during traversal for this entry.
266
+ // These are full paths from entry root to reference fields (e.g.
267
+ // "modular_blocks.experience.spa_service") collected when REPEATER-type
268
+ // repeaters are found inside a CONTENTSTACK context.
269
+ const entryRefPaths = staticEntryRefPaths[_content_type_uid]?.[entry_uid] ?? [];
270
+ // Note: repeaterReferencesPath is NOT included here — those are
271
+ // template repeater paths (relative to repeater context), not
272
+ // absolute paths from the static entry root. entryRefPaths already
273
+ // contains the correct absolute reference paths for this entry.
185
274
  contentstackEntriesReferencesPath[_content_type_uid][entry_uid] = uniq([
186
275
  ...referencePaths,
187
276
  ...includeReferences,
277
+ ...entryRefPaths,
188
278
  ]);
189
279
  contentstackEntriesOnlyKeys[_content_type_uid][entry_uid] = uniq([
190
280
  ...onlyPaths,
@@ -195,7 +285,13 @@ const getEntriesQueries = (compositionEntry, connectedContentTypeUid, options) =
195
285
  const result = {
196
286
  templateReferencesPath: uniq([
197
287
  ...templateReferencesPath,
198
- ...repeaterReferencesPath,
288
+ // Use directly-collected paths instead of generateQueryDetails output.
289
+ // generateQueryDetails infers references from tree structure (nodes with
290
+ // children), but the reference condition creates intermediate nodes
291
+ // (e.g. "modular_blocks.test") that aren't references — causing bad
292
+ // include[] paths. templateRepeaterRefPaths has the exact reference
293
+ // paths collected during traversal.
294
+ ...templateRepeaterRefPaths,
199
295
  ...extendedReferencesPath,
200
296
  ]),
201
297
  templateOnlyKeys: removeRedundantPathsForTemplates(uniq([...templateOnlyKeys, ...repeaterOnlyKeys, ...extendedOnlyKeys])),
@@ -1 +1 @@
1
- {"version":3,"file":"reference_fetcher.js","sources":["../../src/utils/reference_fetcher.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;AAcA;;AAEG;AACH,MAAM,cAAc,GAAG,CACrB,OAAwC,EACxC,gBAAsC,EACtC,cAAoE,EACpE,mBAAkC,KAChC;AACF,IAAA,IAAI,CAAC,OAAO;QAAE;AAEd,IAAA,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,OAAO;AAC/B,IAAA,MAAM,UAAU,GAAG,IAAI,KAAK,YAAY,CAAC,QAAQ;AACjD,IAAA,MAAM,cAAc,GAAG,IAAI,KAAK,YAAY,CAAC,YAAY;AACzD,IAAA,MAAM,UAAU,GAAG,IAAI,KAAK,YAAY,CAAC,QAAQ;IAEjD,IAAI,UAAU,EAAE;AACd,QAAA,KAAK,CAAC,gBAAgB,EAAE,KAA6B,CAAC;IACxD;SAAO,IAAI,cAAc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QAAA,GAAG,2BAA2B;KAC/B;AACD,IAAA,KAAK,MAAM,iBAAiB,IAAI,2BAA2B,EAAE;QAC3D,KAAK,MAAM,SAAS,IAAI,2BAA2B,CAAC,iBAAiB,CAAC,EAAE;YACtE,MAAM,QAAQ,GACZ,2BAA2B,CAAC,iBAAiB,CAAC,CAAC,SAAS,CAAC;;AAE3D,YAAA,MAAM,CAAC,iBAAiB,CAAC,CAAC,SAAS,CAAC;gBAClC,gCAAgC,CAAC,QAAQ,CAAC;QAC9C;IACF;AACA,IAAA,OAAO,MAAM;AACf;;;;"}
package/dist/utils/sdk.js CHANGED
@@ -48,6 +48,9 @@ const getBindingStringForCS = (binding) => {
48
48
  if (!path)
49
49
  return "";
50
50
  const flattenPath = (path) => {
51
+ // Handle null/undefined path from dev11 server responses
52
+ if (!path || typeof path !== "object")
53
+ return "";
51
54
  if (Object.keys(path).length === 0)
52
55
  return "";
53
56
  const key = Object.keys(path)[0];