@parrel/ledger 0.0.0-stage → 5.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (239) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +793 -2
  3. package/dist/cli/commands.d.ts +51 -0
  4. package/dist/cli/commands.d.ts.map +1 -0
  5. package/dist/cli/commands.js +968 -0
  6. package/dist/cli/commands.js.map +1 -0
  7. package/dist/cli/index.d.ts +24 -0
  8. package/dist/cli/index.d.ts.map +1 -0
  9. package/dist/cli/index.js +35 -0
  10. package/dist/cli/index.js.map +1 -0
  11. package/dist/cli/parrel.d.ts +3 -0
  12. package/dist/cli/parrel.d.ts.map +1 -0
  13. package/dist/cli/parrel.js +5 -0
  14. package/dist/cli/parrel.js.map +1 -0
  15. package/dist/cli/utils/angular-setup.d.ts +14 -0
  16. package/dist/cli/utils/angular-setup.d.ts.map +1 -0
  17. package/dist/cli/utils/angular-setup.js +96 -0
  18. package/dist/cli/utils/angular-setup.js.map +1 -0
  19. package/dist/cli/utils/api-tree-builder.d.ts +24 -0
  20. package/dist/cli/utils/api-tree-builder.d.ts.map +1 -0
  21. package/dist/cli/utils/api-tree-builder.js +146 -0
  22. package/dist/cli/utils/api-tree-builder.js.map +1 -0
  23. package/dist/cli/utils/bundle-reader.d.ts +185 -0
  24. package/dist/cli/utils/bundle-reader.d.ts.map +1 -0
  25. package/dist/cli/utils/bundle-reader.js +518 -0
  26. package/dist/cli/utils/bundle-reader.js.map +1 -0
  27. package/dist/cli/utils/collision-detector.d.ts +21 -0
  28. package/dist/cli/utils/collision-detector.d.ts.map +1 -0
  29. package/dist/cli/utils/collision-detector.js +53 -0
  30. package/dist/cli/utils/collision-detector.js.map +1 -0
  31. package/dist/cli/utils/map-fields.d.ts +42 -0
  32. package/dist/cli/utils/map-fields.d.ts.map +1 -0
  33. package/dist/cli/utils/map-fields.js +90 -0
  34. package/dist/cli/utils/map-fields.js.map +1 -0
  35. package/dist/cli/utils/map-validator.d.ts +42 -0
  36. package/dist/cli/utils/map-validator.d.ts.map +1 -0
  37. package/dist/cli/utils/map-validator.js +119 -0
  38. package/dist/cli/utils/map-validator.js.map +1 -0
  39. package/dist/cli/utils/media-file.d.ts +41 -0
  40. package/dist/cli/utils/media-file.d.ts.map +1 -0
  41. package/dist/cli/utils/media-file.js +72 -0
  42. package/dist/cli/utils/media-file.js.map +1 -0
  43. package/dist/cli/utils/media-validator.d.ts +10 -0
  44. package/dist/cli/utils/media-validator.d.ts.map +1 -0
  45. package/dist/cli/utils/media-validator.js +85 -0
  46. package/dist/cli/utils/media-validator.js.map +1 -0
  47. package/dist/cli/utils/mock-augmenter.d.ts +19 -0
  48. package/dist/cli/utils/mock-augmenter.d.ts.map +1 -0
  49. package/dist/cli/utils/mock-augmenter.js +102 -0
  50. package/dist/cli/utils/mock-augmenter.js.map +1 -0
  51. package/dist/cli/utils/mock-validator.d.ts +27 -0
  52. package/dist/cli/utils/mock-validator.d.ts.map +1 -0
  53. package/dist/cli/utils/mock-validator.js +214 -0
  54. package/dist/cli/utils/mock-validator.js.map +1 -0
  55. package/dist/cli/utils/project-dir.d.ts +24 -0
  56. package/dist/cli/utils/project-dir.d.ts.map +1 -0
  57. package/dist/cli/utils/project-dir.js +32 -0
  58. package/dist/cli/utils/project-dir.js.map +1 -0
  59. package/dist/cli/utils/schema-loader.d.ts +19 -0
  60. package/dist/cli/utils/schema-loader.d.ts.map +1 -0
  61. package/dist/cli/utils/schema-loader.js +101 -0
  62. package/dist/cli/utils/schema-loader.js.map +1 -0
  63. package/dist/cli/utils/server-entry.d.ts +34 -0
  64. package/dist/cli/utils/server-entry.d.ts.map +1 -0
  65. package/dist/cli/utils/server-entry.js +111 -0
  66. package/dist/cli/utils/server-entry.js.map +1 -0
  67. package/dist/cli/utils/sync.d.ts +116 -0
  68. package/dist/cli/utils/sync.d.ts.map +1 -0
  69. package/dist/cli/utils/sync.js +134 -0
  70. package/dist/cli/utils/sync.js.map +1 -0
  71. package/dist/client/index.d.ts +39 -0
  72. package/dist/client/index.d.ts.map +1 -0
  73. package/dist/client/index.js +88 -0
  74. package/dist/client/index.js.map +1 -0
  75. package/dist/core/browser-session.d.ts +5 -0
  76. package/dist/core/browser-session.d.ts.map +1 -0
  77. package/dist/core/browser-session.js +12 -0
  78. package/dist/core/browser-session.js.map +1 -0
  79. package/dist/core/cache.d.ts +80 -0
  80. package/dist/core/cache.d.ts.map +1 -0
  81. package/dist/core/cache.js +95 -0
  82. package/dist/core/cache.js.map +1 -0
  83. package/dist/core/client.d.ts +64 -0
  84. package/dist/core/client.d.ts.map +1 -0
  85. package/dist/core/client.js +281 -0
  86. package/dist/core/client.js.map +1 -0
  87. package/dist/core/config.d.ts +20 -0
  88. package/dist/core/config.d.ts.map +1 -0
  89. package/dist/core/config.js +32 -0
  90. package/dist/core/config.js.map +1 -0
  91. package/dist/core/copy-read.d.ts +25 -0
  92. package/dist/core/copy-read.d.ts.map +1 -0
  93. package/dist/core/copy-read.js +123 -0
  94. package/dist/core/copy-read.js.map +1 -0
  95. package/dist/core/define-ledger.d.ts +38 -0
  96. package/dist/core/define-ledger.d.ts.map +1 -0
  97. package/dist/core/define-ledger.js +65 -0
  98. package/dist/core/define-ledger.js.map +1 -0
  99. package/dist/core/deprecated.d.ts +16 -0
  100. package/dist/core/deprecated.d.ts.map +1 -0
  101. package/dist/core/deprecated.js +14 -0
  102. package/dist/core/deprecated.js.map +1 -0
  103. package/dist/core/env.d.ts +103 -0
  104. package/dist/core/env.d.ts.map +1 -0
  105. package/dist/core/env.js +208 -0
  106. package/dist/core/env.js.map +1 -0
  107. package/dist/core/error-codes.generated.d.ts +12 -0
  108. package/dist/core/error-codes.generated.d.ts.map +1 -0
  109. package/dist/core/error-codes.generated.js +3 -0
  110. package/dist/core/error-codes.generated.js.map +1 -0
  111. package/dist/core/get-content.d.ts +62 -0
  112. package/dist/core/get-content.d.ts.map +1 -0
  113. package/dist/core/get-content.js +86 -0
  114. package/dist/core/get-content.js.map +1 -0
  115. package/dist/core/get-media.d.ts +58 -0
  116. package/dist/core/get-media.d.ts.map +1 -0
  117. package/dist/core/get-media.js +89 -0
  118. package/dist/core/get-media.js.map +1 -0
  119. package/dist/core/manifest.d.ts +38 -0
  120. package/dist/core/manifest.d.ts.map +1 -0
  121. package/dist/core/manifest.js +93 -0
  122. package/dist/core/manifest.js.map +1 -0
  123. package/dist/core/media-proxy.d.ts +41 -0
  124. package/dist/core/media-proxy.d.ts.map +1 -0
  125. package/dist/core/media-proxy.js +219 -0
  126. package/dist/core/media-proxy.js.map +1 -0
  127. package/dist/core/package-info.d.ts +34 -0
  128. package/dist/core/package-info.d.ts.map +1 -0
  129. package/dist/core/package-info.js +39 -0
  130. package/dist/core/package-info.js.map +1 -0
  131. package/dist/core/parrel-error.d.ts +160 -0
  132. package/dist/core/parrel-error.d.ts.map +1 -0
  133. package/dist/core/parrel-error.js +198 -0
  134. package/dist/core/parrel-error.js.map +1 -0
  135. package/dist/core/transform-content.d.ts +42 -0
  136. package/dist/core/transform-content.d.ts.map +1 -0
  137. package/dist/core/transform-content.js +185 -0
  138. package/dist/core/transform-content.js.map +1 -0
  139. package/dist/core/types.d.ts +406 -0
  140. package/dist/core/types.d.ts.map +1 -0
  141. package/dist/core/types.js +11 -0
  142. package/dist/core/types.js.map +1 -0
  143. package/dist/errors/error-messages.generated.d.ts +5 -0
  144. package/dist/errors/error-messages.generated.d.ts.map +1 -0
  145. package/dist/errors/error-messages.generated.js +971 -0
  146. package/dist/errors/error-messages.generated.js.map +1 -0
  147. package/dist/errors/get-error-info.d.ts +29 -0
  148. package/dist/errors/get-error-info.d.ts.map +1 -0
  149. package/dist/errors/get-error-info.js +43 -0
  150. package/dist/errors/get-error-info.js.map +1 -0
  151. package/dist/errors/index.d.ts +4 -0
  152. package/dist/errors/index.d.ts.map +1 -0
  153. package/dist/errors/index.js +4 -0
  154. package/dist/errors/index.js.map +1 -0
  155. package/dist/errors/types.d.ts +19 -0
  156. package/dist/errors/types.d.ts.map +1 -0
  157. package/dist/errors/types.js +2 -0
  158. package/dist/errors/types.js.map +1 -0
  159. package/dist/generated.d.ts +29 -0
  160. package/dist/generated.d.ts.map +1 -0
  161. package/dist/generated.js +29 -0
  162. package/dist/generated.js.map +1 -0
  163. package/dist/index.d.ts +19 -0
  164. package/dist/index.d.ts.map +1 -0
  165. package/dist/index.js +16 -0
  166. package/dist/index.js.map +1 -0
  167. package/dist/mock/dev-media.d.ts +15 -0
  168. package/dist/mock/dev-media.d.ts.map +1 -0
  169. package/dist/mock/dev-media.js +52 -0
  170. package/dist/mock/dev-media.js.map +1 -0
  171. package/dist/mock/file-store.d.ts +44 -0
  172. package/dist/mock/file-store.d.ts.map +1 -0
  173. package/dist/mock/file-store.js +170 -0
  174. package/dist/mock/file-store.js.map +1 -0
  175. package/dist/mock/index.d.ts +4 -0
  176. package/dist/mock/index.d.ts.map +1 -0
  177. package/dist/mock/index.js +3 -0
  178. package/dist/mock/index.js.map +1 -0
  179. package/dist/mock/media-fields.d.ts +25 -0
  180. package/dist/mock/media-fields.d.ts.map +1 -0
  181. package/dist/mock/media-fields.js +54 -0
  182. package/dist/mock/media-fields.js.map +1 -0
  183. package/dist/mock/mock-adapter.d.ts +65 -0
  184. package/dist/mock/mock-adapter.d.ts.map +1 -0
  185. package/dist/mock/mock-adapter.js +431 -0
  186. package/dist/mock/mock-adapter.js.map +1 -0
  187. package/dist/mock/mock-errors.d.ts +18 -0
  188. package/dist/mock/mock-errors.d.ts.map +1 -0
  189. package/dist/mock/mock-errors.js +56 -0
  190. package/dist/mock/mock-errors.js.map +1 -0
  191. package/dist/mock/node-import.d.ts +13 -0
  192. package/dist/mock/node-import.d.ts.map +1 -0
  193. package/dist/mock/node-import.js +16 -0
  194. package/dist/mock/node-import.js.map +1 -0
  195. package/dist/mock/seed-mock-store.d.ts +14 -0
  196. package/dist/mock/seed-mock-store.d.ts.map +1 -0
  197. package/dist/mock/seed-mock-store.js +106 -0
  198. package/dist/mock/seed-mock-store.js.map +1 -0
  199. package/dist/mock/shared-memory-store.d.ts +35 -0
  200. package/dist/mock/shared-memory-store.d.ts.map +1 -0
  201. package/dist/mock/shared-memory-store.js +46 -0
  202. package/dist/mock/shared-memory-store.js.map +1 -0
  203. package/dist/next/dev-rendering-helpers.d.ts +78 -0
  204. package/dist/next/dev-rendering-helpers.d.ts.map +1 -0
  205. package/dist/next/dev-rendering-helpers.js +103 -0
  206. package/dist/next/dev-rendering-helpers.js.map +1 -0
  207. package/dist/next/index.d.ts +35 -0
  208. package/dist/next/index.d.ts.map +1 -0
  209. package/dist/next/index.js +33 -0
  210. package/dist/next/index.js.map +1 -0
  211. package/dist/next/next-cache-adapter.d.ts +11 -0
  212. package/dist/next/next-cache-adapter.d.ts.map +1 -0
  213. package/dist/next/next-cache-adapter.js +12 -0
  214. package/dist/next/next-cache-adapter.js.map +1 -0
  215. package/dist/nuxt/index.d.ts +22 -0
  216. package/dist/nuxt/index.d.ts.map +1 -0
  217. package/dist/nuxt/index.js +57 -0
  218. package/dist/nuxt/index.js.map +1 -0
  219. package/dist/sveltekit/index.d.ts +35 -0
  220. package/dist/sveltekit/index.d.ts.map +1 -0
  221. package/dist/sveltekit/index.js +56 -0
  222. package/dist/sveltekit/index.js.map +1 -0
  223. package/dist/ui/content-editor.d.ts +9 -0
  224. package/dist/ui/content-editor.d.ts.map +1 -0
  225. package/dist/ui/content-editor.js +27 -0
  226. package/dist/ui/content-editor.js.map +1 -0
  227. package/dist/ui/index.d.ts +8 -0
  228. package/dist/ui/index.d.ts.map +1 -0
  229. package/dist/ui/index.js +8 -0
  230. package/dist/ui/index.js.map +1 -0
  231. package/dist/ui/ledger-overlay.d.ts +10 -0
  232. package/dist/ui/ledger-overlay.d.ts.map +1 -0
  233. package/dist/ui/ledger-overlay.js +27 -0
  234. package/dist/ui/ledger-overlay.js.map +1 -0
  235. package/dist/ui/media-uploader.d.ts +9 -0
  236. package/dist/ui/media-uploader.d.ts.map +1 -0
  237. package/dist/ui/media-uploader.js +27 -0
  238. package/dist/ui/media-uploader.js.map +1 -0
  239. package/package.json +134 -6
@@ -0,0 +1,971 @@
1
+ // Generated by scripts/errors/cli.mjs from the Parrel error pages. Do not edit by hand. Run `npm run errors:update`.
2
+ /** The name, status, message and advice of every code of @parrel/ledger. Used by `getErrorInfo()`. */
3
+ export const LEDGER_ERROR_MESSAGES = {
4
+ LE00100002: {
5
+ name: "SERVICE_INSTANCE_NOT_FOUND_FOR_READ",
6
+ status: 404,
7
+ message: "Unknown Ledger service.",
8
+ whatToDo: "Check the slug in your configuration. It is shown on the Connect tab of the service in the portal.",
9
+ },
10
+ LE00100003: {
11
+ name: "SERVICE_INSTANCE_NOT_FOUND_FOR_MAP",
12
+ status: 404,
13
+ message: "Unknown Ledger service.",
14
+ whatToDo: "Check the slug in your configuration or in your deployment pipeline. It is shown on the Connect tab of the service in the portal.",
15
+ },
16
+ LE00100004: {
17
+ name: "SERVICE_INSTANCE_NOT_FOUND_FOR_WRITE",
18
+ status: 404,
19
+ message: "Unknown Ledger service.",
20
+ whatToDo: "Check the slug. It is shown on the Connect tab of the service in the portal.",
21
+ },
22
+ LE00100005: {
23
+ name: "SERVICE_INSTANCE_ACCESS_DENIED_FOR_WRITE",
24
+ status: 403,
25
+ message: "You do not have access to this Ledger service.",
26
+ whatToDo: "Sign in with the account that owns the service, or ask the owner to give you access in the portal.",
27
+ },
28
+ LE00100006: {
29
+ name: "SERVICE_INSTANCE_INACTIVE",
30
+ status: 403,
31
+ message: "This Ledger service is not available.",
32
+ whatToDo: "Check the status of the service in the portal. Contact Parrel support if you cannot reactivate it.",
33
+ },
34
+ LE00100007: {
35
+ name: "SERVICE_INSTANCE_SLUG_INVALID",
36
+ status: 400,
37
+ message: "The service slug is not valid.",
38
+ whatToDo: "Use the slug exactly as shown on the Connect tab of the service in the portal.",
39
+ },
40
+ LE01000001: {
41
+ name: "MAP_NOT_FOUND",
42
+ status: 404,
43
+ message: "Not found.",
44
+ whatToDo: "Check the map name. Maps are created by running the map sync from your project.",
45
+ },
46
+ LE01000002: {
47
+ name: "MAP_NAME_INVALID",
48
+ status: 400,
49
+ message: "The map name is not valid.",
50
+ whatToDo: "Use a map name that only contains letters, digits, hyphens and underscores.",
51
+ },
52
+ LE01000003: {
53
+ name: "MAP_NAME_REQUIRED",
54
+ status: 400,
55
+ message: "The map name is required.",
56
+ whatToDo: "Give every map in the sync request a non-empty name.",
57
+ },
58
+ LE01000004: {
59
+ name: "MAP_MEDIA_DIR_INVALID",
60
+ status: 400,
61
+ message: "The media directory of the map is not valid.",
62
+ whatToDo: "Use a `mediaDir` that only contains letters, digits, hyphens and underscores, without slashes.",
63
+ },
64
+ LE01000005: {
65
+ name: "MAP_MEDIA_DIR_REQUIRED",
66
+ status: 400,
67
+ message: "The map needs a media directory.",
68
+ whatToDo: "Add a `mediaDir` to the map.",
69
+ },
70
+ LE01000006: {
71
+ name: "MAP_MEDIA_DIR_IMMUTABLE",
72
+ status: 400,
73
+ message: "The media directory of a map cannot be changed.",
74
+ whatToDo: "Keep the `mediaDir` of the map as it is.",
75
+ },
76
+ LE01000007: {
77
+ name: "MAP_FIELD_NAME_INVALID",
78
+ status: 400,
79
+ message: "A field name in the map is not valid.",
80
+ whatToDo: "Rename the field. Field names start with a letter and only contain letters, digits, hyphens and underscores.",
81
+ },
82
+ LE01000008: {
83
+ name: "MAP_CONTENT_REQUIRED",
84
+ status: 400,
85
+ message: "The map content is required.",
86
+ whatToDo: "Send the full content of every map in the sync request.",
87
+ },
88
+ LE01000009: {
89
+ name: "MAP_SYNC_MAPS_MISSING",
90
+ status: 400,
91
+ message: "The sync request must contain a maps object.",
92
+ whatToDo: "Send a body of the form `{ \"maps\": { \"<name>\": { ... } } }`.",
93
+ },
94
+ LE01000010: {
95
+ name: "MAP_SYNC_TOO_MANY_MAPS",
96
+ status: 400,
97
+ message: "The sync request contains too many maps.",
98
+ whatToDo: "Reduce the number of maps in the project to 200 or fewer.",
99
+ },
100
+ LE01000011: {
101
+ name: "MAP_VERSION_REQUIRED",
102
+ status: 400,
103
+ message: "The map needs a version.",
104
+ whatToDo: "Add a `version` such as `1.0` to the map.",
105
+ },
106
+ LE01000012: {
107
+ name: "MAP_VERSION_INVALID",
108
+ status: 400,
109
+ message: "The map version must have the format X.Y, for example 1.0.",
110
+ whatToDo: "Use a version such as `1.0`.",
111
+ },
112
+ LE01000013: {
113
+ name: "MAP_NAME_FIELD_REQUIRED",
114
+ status: 400,
115
+ message: "The map needs a name.",
116
+ whatToDo: "Add a non-empty `name` to the map.",
117
+ },
118
+ LE01000014: {
119
+ name: "MAP_FIELDS_REQUIRED",
120
+ status: 400,
121
+ message: "The map needs a fields object.",
122
+ whatToDo: "Add a `fields` object that defines the fields of the map.",
123
+ },
124
+ LE01000015: {
125
+ name: "MAP_FIELDS_NOT_AN_OBJECT",
126
+ status: 400,
127
+ message: "The fields of the map must be an object.",
128
+ whatToDo: "Make `fields` an object whose keys are field names.",
129
+ },
130
+ LE01000016: {
131
+ name: "MAP_FIELDS_EMPTY",
132
+ status: 400,
133
+ message: "The map needs at least one field.",
134
+ whatToDo: "Add at least one field definition to the map.",
135
+ },
136
+ LE01000017: {
137
+ name: "MAP_FIELDS_TOO_DEEP",
138
+ status: 400,
139
+ message: "The map fields are nested too deeply.",
140
+ whatToDo: "Flatten the structure of the map to at most 8 levels.",
141
+ },
142
+ LE01000018: {
143
+ name: "MAP_FIELDS_TOO_MANY",
144
+ status: 400,
145
+ message: "The map has too many fields.",
146
+ whatToDo: "Split the map into smaller maps.",
147
+ },
148
+ LE01000019: {
149
+ name: "MAP_FIELD_DEFINITION_INVALID",
150
+ status: 400,
151
+ message: "A field definition in the map must be an object.",
152
+ whatToDo: "Define every field as an object, for example `{ \"type\": \"string\" }`.",
153
+ },
154
+ LE01000020: {
155
+ name: "MAP_FIELD_TYPE_REQUIRED",
156
+ status: 400,
157
+ message: "Every field in the map needs a type.",
158
+ whatToDo: "Add a `type` to every field.",
159
+ },
160
+ LE01000021: {
161
+ name: "MAP_FIELD_TYPE_UNSUPPORTED",
162
+ status: 400,
163
+ message: "A field in the map has an unsupported type.",
164
+ whatToDo: "Change the `type` of the field to one of the supported types.",
165
+ },
166
+ LE01000022: {
167
+ name: "MAP_ARRAY_ITEMS_REQUIRED",
168
+ status: 400,
169
+ message: "An array field in the map needs an items definition.",
170
+ whatToDo: "Add an `items` definition that describes the elements of the array.",
171
+ },
172
+ LE01000023: {
173
+ name: "MAP_ARRAY_ITEMS_INVALID",
174
+ status: 400,
175
+ message: "The items of an array field must be an object.",
176
+ whatToDo: "Define `items` as an object, for example `{ \"type\": \"string\" }`.",
177
+ },
178
+ LE01000024: {
179
+ name: "MAP_ARRAY_ITEMS_TYPE_REQUIRED",
180
+ status: 400,
181
+ message: "The items of an array field need a type.",
182
+ whatToDo: "Add a `type` to the `items` definition.",
183
+ },
184
+ LE01000025: {
185
+ name: "MAP_OBJECT_FIELDS_INVALID",
186
+ status: 400,
187
+ message: "An object field must contain a fields object.",
188
+ whatToDo: "Add a `fields` object to the object field.",
189
+ },
190
+ LE01000026: {
191
+ name: "MAP_NESTED_FIELD_NAME_INVALID",
192
+ status: 400,
193
+ message: "A nested field name in the map must be a text.",
194
+ whatToDo: "Use text keys for the nested fields.",
195
+ },
196
+ LE01000027: {
197
+ name: "MAP_MEDIA_REFERENCE_TYPE_REQUIRED",
198
+ status: 400,
199
+ message: "A media reference field needs a media type.",
200
+ whatToDo: "Add a `mediaType` to the media reference field.",
201
+ },
202
+ LE01000028: {
203
+ name: "MAP_UPDATE_EXISTING_REQUIRED",
204
+ status: 400,
205
+ message: "The existing map is required to update it.",
206
+ whatToDo: "This should not happen. Contact Parrel support with the trace id.",
207
+ },
208
+ LE01000029: {
209
+ name: "MAP_UPDATE_PATCH_REQUIRED",
210
+ status: 400,
211
+ message: "The map update is required.",
212
+ whatToDo: "This should not happen. Contact Parrel support with the trace id.",
213
+ },
214
+ LE01000030: {
215
+ name: "MAP_SYNC_SERIALIZATION_FAILED",
216
+ status: 500,
217
+ message: "The map could not be saved. Try again later.",
218
+ whatToDo: "Try again later. Contact Parrel support with the trace id if it keeps happening.",
219
+ },
220
+ LE01000031: {
221
+ name: "MAP_READ_FAILED",
222
+ status: 500,
223
+ message: "The map could not be read. Try again later.",
224
+ whatToDo: "Try again later. Contact Parrel support with the trace id if it keeps happening.",
225
+ },
226
+ LE01000032: {
227
+ name: "MAP_SAVE_FAILED",
228
+ status: 500,
229
+ message: "The map could not be saved. Try again later.",
230
+ whatToDo: "Try again later. Contact Parrel support with the trace id if it keeps happening.",
231
+ },
232
+ LE01000033: {
233
+ name: "MAP_DELETE_FAILED",
234
+ status: 500,
235
+ message: "The map could not be deleted. Try again later.",
236
+ whatToDo: "Try again later. Contact Parrel support with the trace id if it keeps happening.",
237
+ },
238
+ LE01000041: {
239
+ name: "MAP_SYNC_BODY_TOO_LARGE",
240
+ status: 413,
241
+ message: "The sync request is too large.",
242
+ whatToDo: "Send fewer or smaller maps. A project with 200 maps of 500 fields fits easily in the limit; check that the CLI does not send content or media in the maps.",
243
+ },
244
+ LE01000042: {
245
+ name: "MAP_SYNC_CONFIRMATION_REQUIRED",
246
+ status: 409,
247
+ message: "This sync deletes or changes content. Run it again and confirm, or use --force.",
248
+ whatToDo: "Get the list with `POST /v1/map/sync/{slug}/preview`, show it to the person and send the sync again with its `previewId`. The command-line tool of `@parrel/ledger` does this and asks for a confirmation; `--force` sends `confirm: true` instead.",
249
+ },
250
+ LE01000043: {
251
+ name: "MAP_SYNC_PREVIEW_EXPIRED",
252
+ status: 409,
253
+ message: "The preview has expired. Run the sync again.",
254
+ whatToDo: "Run the preview again and send the sync with the new `previewId` within 5 minutes.",
255
+ },
256
+ LE01000044: {
257
+ name: "MAP_SYNC_PREVIEW_STALE",
258
+ status: 409,
259
+ message: "The maps or the content changed after the preview. Run the sync again.",
260
+ whatToDo: "Run the preview again with the maps you want to sync, check the new list and send the sync with the new `previewId`.",
261
+ },
262
+ LE02000001: {
263
+ name: "MANIFEST_READ_FAILED",
264
+ status: 500,
265
+ message: "The manifest could not be read. Try again later.",
266
+ whatToDo: "Try again later. Contact Parrel support with the trace id if it keeps happening.",
267
+ },
268
+ LE02000002: {
269
+ name: "MANIFEST_SAVE_FAILED",
270
+ status: 500,
271
+ message: "The manifest could not be saved. Try again later.",
272
+ whatToDo: "Try again later. Contact Parrel support with the trace id if it keeps happening.",
273
+ },
274
+ LE02000003: {
275
+ name: "RESOURCE_NOT_FOUND",
276
+ status: 404,
277
+ message: "Not found.",
278
+ whatToDo: "Check the resource name against the manifest of the service.",
279
+ },
280
+ LE02000004: {
281
+ name: "RESOURCE_READ_FAILED",
282
+ status: 500,
283
+ message: "The resource could not be read. Try again later.",
284
+ whatToDo: "Try again later. Contact Parrel support with the trace id if it keeps happening.",
285
+ },
286
+ LE02000005: {
287
+ name: "RESOURCE_SAVE_FAILED",
288
+ status: 500,
289
+ message: "The resource could not be saved. Try again later.",
290
+ whatToDo: "Try again later. Contact Parrel support with the trace id if it keeps happening.",
291
+ },
292
+ LE02000006: {
293
+ name: "RESOURCE_DELETE_FAILED",
294
+ status: 500,
295
+ message: "The resource could not be deleted. Try again later.",
296
+ whatToDo: "Try again later. Contact Parrel support with the trace id if it keeps happening.",
297
+ },
298
+ LE02000007: {
299
+ name: "STORAGE_OBJECT_CHECK_FAILED",
300
+ status: 500,
301
+ message: "The storage could not be checked. Try again later.",
302
+ whatToDo: "Try again later. Contact Parrel support with the trace id if it keeps happening.",
303
+ },
304
+ LE02000008: {
305
+ name: "RESOURCE_NAME_INVALID",
306
+ status: 400,
307
+ message: "The resource name is not valid.",
308
+ whatToDo: "Use a resource name that only contains letters, digits, dots, hyphens and underscores.",
309
+ },
310
+ LE02000009: {
311
+ name: "RESOURCE_CONTENT_REQUIRED",
312
+ status: 400,
313
+ message: "The resource content is required.",
314
+ whatToDo: "Send a body of the form `{ \"content\": ..., \"schema\": \"<map name>\" }`.",
315
+ },
316
+ LE02000010: {
317
+ name: "RESOURCE_CONTENT_NOT_SERIALIZABLE",
318
+ status: 400,
319
+ message: "The resource content could not be converted to JSON.",
320
+ whatToDo: "Send content that is valid JSON.",
321
+ },
322
+ LE02000011: {
323
+ name: "RESOURCE_CONTENT_NOT_AN_OBJECT",
324
+ status: 400,
325
+ message: "The resource content must be an object to be validated against a map.",
326
+ whatToDo: "Send the content as a JSON object, or write a single value with the `path` parameter.",
327
+ },
328
+ LE02000012: {
329
+ name: "RESOURCE_REQUIRED_FIELD_MISSING",
330
+ status: 400,
331
+ message: "The resource is missing a required field.",
332
+ whatToDo: "Add the required fields from the map to the content.",
333
+ },
334
+ LE02000013: {
335
+ name: "RESOURCE_SCHEMA_UNUSABLE",
336
+ status: 400,
337
+ message: "The map of this resource could not be used to validate it.",
338
+ whatToDo: "Run the map sync again to restore the map, then retry. Contact Parrel support with the trace id if it keeps happening.",
339
+ },
340
+ LE02000014: {
341
+ name: "RESOURCE_EXISTING_CONTENT_UNREADABLE",
342
+ status: 400,
343
+ message: "The stored resource is not valid JSON.",
344
+ whatToDo: "Write the whole resource again without the `path` parameter to replace the stored content.",
345
+ },
346
+ LE02000015: {
347
+ name: "CONTENT_PATH_INVALID",
348
+ status: 400,
349
+ message: "The content path is not valid.",
350
+ whatToDo: "Use a path such as `hero.title` or `images[0].alt`.",
351
+ },
352
+ LE02000016: {
353
+ name: "CONTENT_PATH_INDEX_INVALID",
354
+ status: 400,
355
+ message: "An array index in the content path is not valid.",
356
+ whatToDo: "Use a whole number between the brackets, for example `images[0]`.",
357
+ },
358
+ LE02000017: {
359
+ name: "CONTENT_PATH_REQUIRED",
360
+ status: 400,
361
+ message: "A content path is required.",
362
+ whatToDo: "Send the `path` of the value to write.",
363
+ },
364
+ LE02000018: {
365
+ name: "CONTENT_PATH_NOT_FOUND",
366
+ status: 404,
367
+ message: "Not found.",
368
+ whatToDo: "Check the path against the content of the resource.",
369
+ },
370
+ LE02000019: {
371
+ name: "CONTENT_PATH_PARENT_NOT_FOUND",
372
+ status: 404,
373
+ message: "Not found.",
374
+ whatToDo: "Create the parent object or array first, or write the whole resource.",
375
+ },
376
+ LE02000020: {
377
+ name: "CONTENT_PATH_TARGET_INVALID",
378
+ status: 400,
379
+ message: "The content path does not match the structure of the resource.",
380
+ whatToDo: "Check the path against the content of the resource. Use names for objects and `[index]` for arrays.",
381
+ },
382
+ LE02000021: {
383
+ name: "CONTENT_PATH_INDEX_OUT_OF_BOUNDS",
384
+ status: 400,
385
+ message: "An array index in the content path is out of bounds.",
386
+ whatToDo: "Use an index that exists in the array. Negative indexes count from the end.",
387
+ },
388
+ LE02000022: {
389
+ name: "CONTENT_PATH_NOT_MEDIA_OBJECT",
390
+ status: 400,
391
+ message: "The content path does not point to a media value.",
392
+ whatToDo: "Point the path to a media field, or remove the `url` or `alt` part.",
393
+ },
394
+ LE02000023: {
395
+ name: "CONTENT_PATH_RESOLVE_FAILED",
396
+ status: 400,
397
+ message: "The content path could not be resolved.",
398
+ whatToDo: "Check the path and the resource. Write the whole resource again if its content is broken.",
399
+ },
400
+ LE02000024: {
401
+ name: "CONTENT_HASH_UNAVAILABLE",
402
+ status: 500,
403
+ message: "Something went wrong. Try again later.",
404
+ whatToDo: "Contact Parrel support with the trace id.",
405
+ },
406
+ LE02500001: {
407
+ name: "MEDIA_NOT_FOUND",
408
+ status: 404,
409
+ message: "Not found.",
410
+ whatToDo: "Check the media name against the manifest of the service.",
411
+ },
412
+ LE02500002: {
413
+ name: "MEDIA_READ_FAILED",
414
+ status: 500,
415
+ message: "The media file could not be read. Try again later.",
416
+ whatToDo: "Try again later. Contact Parrel support with the trace id if it keeps happening.",
417
+ },
418
+ LE02500003: {
419
+ name: "MEDIA_SAVE_FAILED",
420
+ status: 500,
421
+ message: "The media file could not be saved. Try again later.",
422
+ whatToDo: "Try again later. Contact Parrel support with the trace id if it keeps happening.",
423
+ },
424
+ LE02500004: {
425
+ name: "MEDIA_DELETE_FAILED",
426
+ status: 500,
427
+ message: "The media file could not be deleted. Try again later.",
428
+ whatToDo: "Try again later. Contact Parrel support with the trace id if it keeps happening.",
429
+ },
430
+ LE02500005: {
431
+ name: "MEDIA_NAME_INVALID",
432
+ status: 400,
433
+ message: "The media name is not valid.",
434
+ whatToDo: "Use a media name that only contains letters, digits, dots, hyphens and underscores.",
435
+ },
436
+ LE02500006: {
437
+ name: "MEDIA_NAME_REQUIRED",
438
+ status: 400,
439
+ message: "The media name is required.",
440
+ whatToDo: "This should not happen. Contact Parrel support with the trace id.",
441
+ },
442
+ LE02500007: {
443
+ name: "MEDIA_FILE_EXTENSION_NOT_ALLOWED",
444
+ status: 400,
445
+ message: "This file extension is not allowed.",
446
+ whatToDo: "Upload a file with one of the allowed extensions.",
447
+ },
448
+ LE02500008: {
449
+ name: "MEDIA_FILE_TYPE_NOT_ALLOWED",
450
+ status: 400,
451
+ message: "This file type is not allowed.",
452
+ whatToDo: "Upload a file of an allowed type and send it with the matching content type.",
453
+ },
454
+ LE02500009: {
455
+ name: "MEDIA_FILE_EMPTY",
456
+ status: 400,
457
+ message: "The file is empty.",
458
+ whatToDo: "Upload a file that has content.",
459
+ },
460
+ LE02500010: {
461
+ name: "MEDIA_FILE_TOO_LARGE",
462
+ status: 400,
463
+ message: "The file is too large.",
464
+ whatToDo: "Upload a smaller file, for example by compressing the image.",
465
+ },
466
+ LE02500011: {
467
+ name: "MEDIA_UPLOAD_TOO_LARGE",
468
+ status: 413,
469
+ message: "The upload is too large.",
470
+ whatToDo: "Upload a smaller file, for example by compressing the image.",
471
+ },
472
+ LE02500012: {
473
+ name: "MEDIA_UPLOAD_UNREADABLE",
474
+ status: 400,
475
+ message: "The uploaded file could not be read.",
476
+ whatToDo: "Upload the file again. Check that the connection was not interrupted.",
477
+ },
478
+ LE02500013: {
479
+ name: "MEDIA_RESOURCE_UPDATE_FAILED",
480
+ status: 400,
481
+ message: "The resource could not be updated with the uploaded file.",
482
+ whatToDo: "Check the content of the resource and upload the file again.",
483
+ },
484
+ LE02500014: {
485
+ name: "MEDIA_SECURITY_JPEG_SIGNATURE_MISMATCH",
486
+ status: 400,
487
+ message: "The file was rejected because its content does not match its type.",
488
+ whatToDo: "Upload a real JPEG file, or send the file with the content type that matches it.",
489
+ },
490
+ LE02500015: {
491
+ name: "MEDIA_SECURITY_PNG_SIGNATURE_MISMATCH",
492
+ status: 400,
493
+ message: "The file was rejected because its content does not match its type.",
494
+ whatToDo: "Upload a real PNG file, or send the file with the content type that matches it.",
495
+ },
496
+ LE02500016: {
497
+ name: "MEDIA_SECURITY_GIF_SIGNATURE_MISMATCH",
498
+ status: 400,
499
+ message: "The file was rejected because its content does not match its type.",
500
+ whatToDo: "Upload a real GIF file, or send the file with the content type that matches it.",
501
+ },
502
+ LE02500017: {
503
+ name: "MEDIA_SECURITY_WEBP_SIGNATURE_MISMATCH",
504
+ status: 400,
505
+ message: "The file was rejected because its content does not match its type.",
506
+ whatToDo: "Upload a real WEBP file, or send the file with the content type that matches it.",
507
+ },
508
+ LE02500018: {
509
+ name: "MEDIA_SECURITY_PDF_SIGNATURE_MISMATCH",
510
+ status: 400,
511
+ message: "The file was rejected because its content does not match its type.",
512
+ whatToDo: "Upload a real PDF file, or send the file with the content type that matches it.",
513
+ },
514
+ LE02500019: {
515
+ name: "MEDIA_SECURITY_PDF_EMBEDDED_CODE",
516
+ status: 400,
517
+ message: "The file was rejected because it contains potentially harmful content.",
518
+ whatToDo: "Remove the embedded code or upload a clean copy of the file.",
519
+ },
520
+ LE02500020: {
521
+ name: "MEDIA_SECURITY_PDF_SCRIPT",
522
+ status: 400,
523
+ message: "The file was rejected because it contains potentially harmful content.",
524
+ whatToDo: "Remove the script from the PDF or upload a clean copy of the file.",
525
+ },
526
+ LE02500021: {
527
+ name: "MEDIA_SECURITY_IMAGE_EMBEDDED_CODE",
528
+ status: 400,
529
+ message: "The file was rejected because it contains potentially harmful content.",
530
+ whatToDo: "Upload a clean copy of the image, for example by exporting it again from your image editor.",
531
+ },
532
+ LE02500022: {
533
+ name: "MEDIA_SECURITY_TEXT_EMBEDDED_CODE",
534
+ status: 400,
535
+ message: "The file was rejected because it contains potentially harmful content.",
536
+ whatToDo: "Remove the scripts from the file or upload a clean copy.",
537
+ },
538
+ LE03000001: {
539
+ name: "QUOTA_EXCEEDED",
540
+ status: 409,
541
+ message: "The storage limit of this Ledger service has been reached.",
542
+ whatToDo: "Delete content you no longer need, or ask the owner of the service to upgrade the plan in the portal.",
543
+ },
544
+ LE04000015: {
545
+ name: "ORIGIN_HEADER_MISSING",
546
+ status: 403,
547
+ message: "The origin is not allowed.",
548
+ whatToDo: "Send the request from your site, so the browser adds the `Origin` header.",
549
+ },
550
+ LE04000016: {
551
+ name: "NO_ALLOWED_ORIGINS_FOR_SLUG",
552
+ status: 403,
553
+ message: "The origin is not allowed.",
554
+ whatToDo: "Add your site to the allowed origins of the service in the portal, and check the slug in your configuration.",
555
+ },
556
+ LE04000017: {
557
+ name: "ORIGIN_NOT_ALLOWED",
558
+ status: 403,
559
+ message: "The origin is not allowed.",
560
+ whatToDo: "Add the origin to the allowed origins of the service in the portal, or call Ledger from an allowed site.",
561
+ },
562
+ LE04000018: {
563
+ name: "ACCESS_TOKEN_MISSING",
564
+ status: 401,
565
+ message: "A bearer token is required.",
566
+ whatToDo: "Send the access token in the `Authorization` header as a bearer token.",
567
+ },
568
+ LE04000019: {
569
+ name: "ACCESS_TOKEN_INVALID",
570
+ status: 401,
571
+ message: "The access token is not valid or has expired.",
572
+ whatToDo: "Sign in again to get a new access token.",
573
+ },
574
+ LE04000021: {
575
+ name: "DEPLOYMENT_TOKEN_MISSING",
576
+ status: 401,
577
+ message: "A deployment token is required.",
578
+ whatToDo: "Generate a deployment token in the portal and send it in the `X-Deployment-Token` header.",
579
+ },
580
+ LE04000022: {
581
+ name: "DEPLOYMENT_TOKEN_EXPIRED",
582
+ status: 401,
583
+ message: "The deployment token has expired.",
584
+ whatToDo: "Generate a new deployment token in the portal and run the map sync again.",
585
+ },
586
+ LE04000023: {
587
+ name: "DEPLOYMENT_TOKEN_INVALID",
588
+ status: 401,
589
+ message: "The deployment token is not valid.",
590
+ whatToDo: "Generate a new deployment token in the portal and check that you copied it completely.",
591
+ },
592
+ LE04000024: {
593
+ name: "DEPLOYMENT_TOKEN_SERVICE_MISMATCH",
594
+ status: 403,
595
+ message: "The deployment token does not belong to this Ledger service.",
596
+ whatToDo: "Generate a deployment token for this service, or use the slug of the service the token belongs to.",
597
+ },
598
+ LE04000026: {
599
+ name: "IP_ADDRESS_BLOCKED",
600
+ status: 403,
601
+ message: "Your IP address has been blocked.",
602
+ whatToDo: "Contact Parrel support if you think the block is a mistake.",
603
+ },
604
+ LE04000027: {
605
+ name: "RATE_LIMIT_EXCEEDED",
606
+ status: 429,
607
+ message: "Too many requests. Wait a moment and try again.",
608
+ whatToDo: "Wait for a minute, or for the seconds in `Retry-After` when it is present, then try again. Do not retry in a tight loop. A server that reads Ledger should cache what it reads.",
609
+ },
610
+ LE04000028: {
611
+ name: "CONNECTION_NOT_FROM_CLOUDFLARE",
612
+ status: 403,
613
+ message: "Direct connections are not allowed.",
614
+ whatToDo: "Call Ledger on its web address, which is proxied by Cloudflare, never on the address of the server. A caller cannot fix this by sending a header itself.",
615
+ },
616
+ LE04000029: {
617
+ name: "DEPLOYMENT_TOKEN_SUPERSEDED",
618
+ status: 401,
619
+ message: "A newer deployment token was made. Use the newest token.",
620
+ whatToDo: "Make a new deployment token in the portal, or use the newest one, and run the sync again. A token is valid for 5 minutes and works for the preview and the sync after it.",
621
+ },
622
+ LE09000023: {
623
+ name: "SENTINEL_SESSION_VALIDATION_FAILED",
624
+ status: 503,
625
+ message: "Sentinel could not verify the session. Try again later.",
626
+ whatToDo: "Try again later. Contact Parrel support with the trace id if it keeps happening.",
627
+ },
628
+ LE09900001: {
629
+ name: "VALIDATION_FAILED",
630
+ status: 400,
631
+ message: "The request is not valid.",
632
+ whatToDo: "Fix the fields listed in `fieldErrors` and send the request again.",
633
+ },
634
+ LE09900002: {
635
+ name: "FIELD_INVALID",
636
+ status: 400,
637
+ message: "This field is not valid.",
638
+ whatToDo: "Check the value of the field named in `field`.",
639
+ },
640
+ LE09900003: {
641
+ name: "REQUEST_BODY_UNREADABLE",
642
+ status: 400,
643
+ message: "The request body could not be read.",
644
+ whatToDo: "Send a valid JSON body as described in the API documentation.",
645
+ },
646
+ LE09900004: {
647
+ name: "REQUEST_PARAMETER_MISSING",
648
+ status: 400,
649
+ message: "A required request parameter is missing.",
650
+ whatToDo: "Send all required parameters as described in the API documentation.",
651
+ },
652
+ LE09900005: {
653
+ name: "REQUEST_PARAMETER_INVALID",
654
+ status: 400,
655
+ message: "A request parameter has an invalid value.",
656
+ whatToDo: "Send the parameter with the type described in the API documentation.",
657
+ },
658
+ LE09900006: {
659
+ name: "METHOD_NOT_SUPPORTED",
660
+ status: 405,
661
+ message: "This method is not supported for this endpoint.",
662
+ whatToDo: "Use the HTTP method described in the API documentation.",
663
+ },
664
+ LE09900007: {
665
+ name: "MEDIA_TYPE_NOT_SUPPORTED",
666
+ status: 415,
667
+ message: "This content type is not supported.",
668
+ whatToDo: "Send the body as `application/json`, or as `multipart/form-data` for an upload.",
669
+ },
670
+ LE09900008: {
671
+ name: "ROUTE_NOT_FOUND",
672
+ status: 404,
673
+ message: "The requested resource was not found.",
674
+ whatToDo: "Check the URL against the API documentation.",
675
+ },
676
+ LE09900011: {
677
+ name: "DATABASE_ERROR",
678
+ status: 500,
679
+ message: "Something went wrong. Try again later.",
680
+ whatToDo: "Try again later. Contact Parrel support with the trace id if it keeps happening.",
681
+ },
682
+ LE09900012: {
683
+ name: "INTERNAL_ERROR",
684
+ status: 500,
685
+ message: "Something went wrong. Try again later.",
686
+ whatToDo: "Try again later. Contact Parrel support with the trace id if it keeps happening.",
687
+ },
688
+ SD00100001: {
689
+ name: "LEDGER_SDK_NOT_CONFIGURED",
690
+ status: null,
691
+ message: "Ledger is not configured. Define the Ledger configuration, including your slug, before you call a Ledger function.",
692
+ whatToDo: "Define the Ledger configuration once, when the app starts and before any code reads or writes content or media. Pass your `slug` and the other options. The Ledger SDK README shows the exact call.",
693
+ },
694
+ SD00100002: {
695
+ name: "LEDGER_CONFIGURATION_REQUIRED",
696
+ status: null,
697
+ message: "The Ledger configuration is required. Pass a configuration object that includes your slug.",
698
+ whatToDo: "Pass a configuration object, for example one that sets `slug`. The Ledger SDK README shows a complete example.",
699
+ },
700
+ SD00100003: {
701
+ name: "LEDGER_SLUG_REQUIRED",
702
+ status: null,
703
+ message: "The Ledger slug must be a non-empty string. Copy the slug from the Parrel portal.",
704
+ whatToDo: "Set `slug` to the slug of your Ledger service. You can copy it from the Ledger service page in the Parrel portal.",
705
+ },
706
+ SD00100008: {
707
+ name: "LEDGER_API_ORIGIN_INVALID",
708
+ status: null,
709
+ message: "Ledger cannot use this API origin. Set apiOrigin or PARREL_API_ORIGIN to an https:// origin without a path or query, such as https://api.parrel.dev, or to an http:// origin on localhost, 127.0.0.1 or [::1] for local development.",
710
+ whatToDo: "Set `apiOrigin` or `PARREL_API_ORIGIN` to the origin of the Parrel API: `https://`, a host and an optional port, with nothing after it. For a local test backend, use `http://localhost` with the port of the backend, for example `http://localhost:18700`. Leave both unset to use the production API, `https://api.parrel.dev`. The Ledger README explains the override.",
711
+ },
712
+ SD00100018: {
713
+ name: "LEDGER_SITE_ORIGIN_INVALID",
714
+ status: null,
715
+ message: "Ledger cannot use this site origin. Set siteOrigin or PARREL_SITE_ORIGIN to the origin of your site, such as https://shop.be, or to localhost for local development.",
716
+ whatToDo: "Set the origin of your site, exactly as it is on the list of your Ledger service in the Parrel portal, for example `siteOrigin: \"https://shop.be\"` or `PARREL_SITE_ORIGIN=https://shop.be`. Use `http://localhost:3000` for local development. A domain and its `www.` version are one origin in the portal (rulebook MOD-8), but the package sends exactly what you set.",
717
+ },
718
+ SD00100019: {
719
+ name: "LEDGER_SITE_ORIGIN_REQUIRED",
720
+ status: null,
721
+ message: "Ledger needs the origin of your site for calls from a server. Set siteOrigin in defineParrelLedger or the environment variable PARREL_SITE_ORIGIN to an origin you added to your Ledger service in the Parrel portal.",
722
+ whatToDo: "Set `siteOrigin` in `defineParrelLedger`, or the environment variable `PARREL_SITE_ORIGIN`, to an origin that is on the list of your Ledger service in the Parrel portal, for example `https://shop.be`. Set it in the environment of your server and of the CI job that builds the site.",
723
+ },
724
+ SD01000001: {
725
+ name: "LEDGER_CONTENT_READ_UNREACHABLE",
726
+ status: null,
727
+ message: "Ledger could not be reached to read content. Check your internet connection and try again. In a browser, a request from an origin that is not allowed fails the same way: check the allowed origins of your Ledger service in the Parrel portal.",
728
+ whatToDo: "Check the internet connection of the device or server that runs the app. In a browser, check that the Ledger origin allows your site. Try again once the connection works.",
729
+ },
730
+ SD01000002: {
731
+ name: "LEDGER_CONTENT_WRITE_UNREACHABLE",
732
+ status: null,
733
+ message: "Ledger could not be reached to save content. Check your internet connection and try again. In a browser, a request from an origin that is not allowed fails the same way: check the allowed origins of your Ledger service in the Parrel portal.",
734
+ whatToDo: "Check the internet connection and try again. Nothing was saved, so it is safe to send the same content again.",
735
+ },
736
+ SD01000003: {
737
+ name: "LEDGER_MEDIA_READ_UNREACHABLE",
738
+ status: null,
739
+ message: "Ledger could not be reached to read media. Check your internet connection and try again. In a browser, a request from an origin that is not allowed fails the same way: check the allowed origins of your Ledger service in the Parrel portal.",
740
+ whatToDo: "Check the internet connection of the device or server that runs the app and try again.",
741
+ },
742
+ SD01000004: {
743
+ name: "LEDGER_MEDIA_WRITE_UNREACHABLE",
744
+ status: null,
745
+ message: "Ledger could not be reached to upload media. Check your internet connection and try again. In a browser, a request from an origin that is not allowed fails the same way: check the allowed origins of your Ledger service in the Parrel portal.",
746
+ whatToDo: "Check the internet connection and upload the file again. Nothing was stored, so it is safe to send the same file again.",
747
+ },
748
+ SD01000005: {
749
+ name: "LEDGER_MANIFEST_READ_UNREACHABLE",
750
+ status: null,
751
+ message: "Ledger could not be reached to read the content manifest. Check your internet connection and try again. In a browser, a request from an origin that is not allowed fails the same way: check the allowed origins of your Ledger service in the Parrel portal.",
752
+ whatToDo: "Check the internet connection of the device or server that runs the app and try again.",
753
+ },
754
+ SD01000012: {
755
+ name: "LEDGER_ERROR_RESPONSE_NOT_RECOGNISED",
756
+ status: null,
757
+ message: "Ledger returned an error that this version of @parrel/ledger does not recognise. Update @parrel/ledger and try again.",
758
+ whatToDo: "Look at the HTTP status of the error. A 5xx status usually means a temporary problem, so try again later. Check whether a proxy or firewall sits between the app and Parrel. Update `@parrel/ledger` to the latest version. If the problem continues, contact Parrel support.",
759
+ },
760
+ SD01000014: {
761
+ name: "LEDGER_MAP_SYNC_UNREACHABLE",
762
+ status: null,
763
+ message: "Ledger could not be reached to sync the maps. Check your internet connection and try again. In a browser, a request from an origin that is not allowed fails the same way: check the allowed origins of your Ledger service in the Parrel portal.",
764
+ whatToDo: "Check the internet connection of the machine that runs the command and the `PARREL_API_ORIGIN` setting, if you use it. Run the command again once the connection works.",
765
+ },
766
+ SD02000001: {
767
+ name: "LEDGER_ADAPTER_GET_CONTENT_UNSUPPORTED",
768
+ status: null,
769
+ message: "The Ledger adapter you configured cannot read content. Use an adapter that supports reading content.",
770
+ whatToDo: "Add the content-reading function to your adapter, or remove the custom adapter so the SDK uses the default one.",
771
+ },
772
+ SD02000002: {
773
+ name: "LEDGER_ADAPTER_UPLOAD_CONTENT_UNSUPPORTED",
774
+ status: null,
775
+ message: "The Ledger adapter you configured cannot save content. Use an adapter that supports saving content.",
776
+ whatToDo: "Add the content-saving function to your adapter, or remove the custom adapter so the SDK uses the default one.",
777
+ },
778
+ SD02000003: {
779
+ name: "LEDGER_ADAPTER_GET_MEDIA_UNSUPPORTED",
780
+ status: null,
781
+ message: "The Ledger adapter you configured cannot read media. Use an adapter that supports reading media.",
782
+ whatToDo: "Add the media-reading function to your adapter, or remove the custom adapter so the SDK uses the default one.",
783
+ },
784
+ SD02000004: {
785
+ name: "LEDGER_ADAPTER_UPLOAD_MEDIA_UNSUPPORTED",
786
+ status: null,
787
+ message: "The Ledger adapter you configured cannot upload media. Use an adapter that supports uploading media.",
788
+ whatToDo: "Add the media-uploading function to your adapter, or remove the custom adapter so the SDK uses the default one.",
789
+ },
790
+ SD02000005: {
791
+ name: "LEDGER_ADAPTER_MEDIA_URL_INVALID",
792
+ status: null,
793
+ message: "The Ledger adapter returned a media URL that is not valid. Return a full URL as text.",
794
+ whatToDo: "Fix your adapter so it returns the full URL of the media file as a string.",
795
+ },
796
+ SD02000006: {
797
+ name: "LEDGER_MEDIA_URL_RESPONSE_INVALID",
798
+ status: null,
799
+ message: "Ledger answered the media request without a usable URL. Try again later.",
800
+ whatToDo: "Try again later. If the problem continues, contact Parrel support and mention this code.",
801
+ },
802
+ SD02000008: {
803
+ name: "LEDGER_WRITE_NEEDS_BROWSER_SESSION",
804
+ status: null,
805
+ message: "Writes need a signed-in session in the browser. Sign in with Sentinel, then call this from client code.",
806
+ whatToDo: "Move the call to client code that runs in the visitor's browser, after the visitor has signed in with Sentinel. Server-side reads (`getContent`, `getMedia`) keep working on a server.",
807
+ },
808
+ SD05000002: {
809
+ name: "CLI_SCHEMAS_LOAD_FAILED",
810
+ status: null,
811
+ message: "The command-line tool could not load the Ledger maps. Check the files in your map folder.",
812
+ whatToDo: "Fix the syntax error in the map file named in the cause, or remove the file, and run the command again.",
813
+ },
814
+ SD05000003: {
815
+ name: "CLI_SCHEMA_LOAD_FAILED",
816
+ status: null,
817
+ message: "The command-line tool could not load a Ledger map. Check that the file exists and is valid.",
818
+ whatToDo: "Check that the path is right and that the file is valid. Run the command again.",
819
+ },
820
+ SD05000007: {
821
+ name: "CLI_LEDGER_MAP_FIELD_RESERVED",
822
+ status: null,
823
+ message: "A Ledger map uses a reserved key as the name of a field. Rename the field, or move the fields into a fields object.",
824
+ whatToDo: "Open the map file named in the message. Either rename the field, or put all the fields of the map in a `fields` object next to `mediaDir`, for example `{ \"mediaDir\": \"homepage\", \"fields\": { \"name\": { \"type\": \"string\" } } }`. Then run the command again.",
825
+ },
826
+ SD05000008: {
827
+ name: "CLI_LEDGER_DEPLOYMENT_TOKEN_MISSING",
828
+ status: null,
829
+ message: "The command-line tool needs a Ledger deployment token, but none was given. Set the PARREL_LEDGER_DEPLOYMENT_TOKEN environment variable, or run the command in a terminal to paste the token.",
830
+ whatToDo: "Create a new deployment token in the Parrel portal for each sync. It is valid for 5 minutes, and only the newest token of the service works. In a job without a terminal, pass the token to that one run in the `PARREL_LEDGER_DEPLOYMENT_TOKEN` environment variable and run `npx parrel ledger sync` again. Never store the token as a secret of your CI system: it stops working after 5 minutes. On your own computer, run the command in a terminal and paste the token when it asks. Never put the token in a file in your project or on the command line, where it stays in your shell history.",
831
+ },
832
+ SD05000010: {
833
+ name: "LEDGER_SYNC_BODY_TOO_LARGE",
834
+ status: null,
835
+ message: "The maps are larger than 10 MB. Split them into smaller maps or remove unused fields.",
836
+ whatToDo: "Remove fields you no longer use, or split a large map into smaller maps. Then run `npx parrel ledger sync` again.",
837
+ },
838
+ SD05000011: {
839
+ name: "LEDGER_SYNC_TOO_MANY_MAPS",
840
+ status: null,
841
+ message: "There are more than 200 maps. Remove the maps you no longer use.",
842
+ whatToDo: "Delete the map files you no longer use from `parrel/ledger/maps/`, or merge small maps. Then run `npx parrel ledger sync` again.",
843
+ },
844
+ SD05000012: {
845
+ name: "LEDGER_SYNC_TOO_MANY_FIELDS",
846
+ status: null,
847
+ message: "The map `{map}` has more than 500 fields, nested fields included. Split it into smaller maps.",
848
+ whatToDo: "Split the map named in the message into smaller maps, or remove fields you no longer use. Then run `npx parrel ledger sync` again.",
849
+ },
850
+ SD05000013: {
851
+ name: "LEDGER_SYNC_TOO_DEEP",
852
+ status: null,
853
+ message: "The map `{map}` is nested deeper than 8 levels. Flatten it.",
854
+ whatToDo: "Flatten the map named in the message: move deeply nested fields up, or split them into their own map. Then run `npx parrel ledger sync` again.",
855
+ },
856
+ SD05000015: {
857
+ name: "LEDGER_SYNC_NOT_CONFIRMED",
858
+ status: null,
859
+ message: "The sync was not confirmed, so nothing was sent. Run it again and confirm, or use --force in CI.",
860
+ whatToDo: "Read the list of what the sync deletes or retypes. If it is right, run `npx parrel ledger sync` again and answer `y`, or in a CI job without a terminal pass `--force` (or `-y`). If it is not right, fix the map files first.",
861
+ },
862
+ SD05000023: {
863
+ name: "CLI_LEDGER_MAP_FIELD_TYPE_UNKNOWN",
864
+ status: null,
865
+ message: "A Ledger map has a field with a type that Ledger does not know. Use string, number, boolean, media, media-reference, array or object.",
866
+ whatToDo: "Open the map file named in the message and change the type of the field to one of `string`, `number`, `boolean`, `media`, `media-reference`, `array` or `object`. Then run the command again.",
867
+ },
868
+ SD05000024: {
869
+ name: "LEDGER_SEED_FILE_NOT_FOUND",
870
+ status: null,
871
+ message: "The backup file does not exist or is not a file. Download the backup of your Ledger service in the Parrel portal and pass its path: npx parrel ledger seed <file.parrel>.",
872
+ whatToDo: "Download the backup of the Ledger service in the Parrel portal (a `.parrel` file) and run `npx parrel ledger seed <path of the file>` again. A relative path is read from the folder you run the command in.",
873
+ },
874
+ SD05000025: {
875
+ name: "LEDGER_SEED_NOT_A_BUNDLE",
876
+ status: null,
877
+ message: "The file is not a readable .parrel backup. Download the backup again in the Parrel portal and run the command again.",
878
+ whatToDo: "Download the backup again in the Parrel portal: a download that was cut off or changed by another tool gives this error. Do not unpack and pack the file again. If a fresh backup still fails, contact support with the error code.",
879
+ },
880
+ SD05000026: {
881
+ name: "LEDGER_SEED_FORMAT_UNSUPPORTED",
882
+ status: null,
883
+ message: "The file is not a Ledger backup that this version of @parrel/ledger can read. Use a .parrel backup of a Ledger service, downloaded in the Parrel portal.",
884
+ whatToDo: "Use the backup of a Ledger service. A Docket backup cannot be used as local Ledger content. When the version is newer than 1, update `@parrel/ledger` and run the command again.",
885
+ },
886
+ SD05000027: {
887
+ name: "LEDGER_SEED_ENTRY_UNSAFE",
888
+ status: null,
889
+ message: "The backup has an entry that cannot be unpacked safely. Use a .parrel backup made by Ledger, without changes.",
890
+ whatToDo: "Ledger never writes such a name, so the file was made or changed by another tool. Download the backup again in the Parrel portal and use it as it is.",
891
+ },
892
+ SD05000028: {
893
+ name: "LEDGER_SEED_BUNDLE_TOO_LARGE",
894
+ status: null,
895
+ message: "The backup is too large to seed. A backup can hold at most 100000 entries, 16 MiB per map or resource and 2 GiB in total.",
896
+ whatToDo: "A backup made by Ledger stays within these limits. Download the backup again in the Parrel portal. For a service above 2 GB, contact support.",
897
+ },
898
+ SD05000029: {
899
+ name: "LEDGER_SEED_TARGET_NOT_EMPTY",
900
+ status: null,
901
+ message: "The folder parrel/ledger already has maps or content. Run again with --force to replace it.",
902
+ whatToDo: "Run `npx parrel ledger seed <file.parrel> --force` to replace them. The seed replaces, it does not merge: it deletes `maps/*.json` and the files in the mock media folder, and writes a new `mock.json`. Commit or copy your local content first if you want to keep it.",
903
+ },
904
+ SD06000001: {
905
+ name: "MOCK_LEDGER_STORE_INIT_FAILED",
906
+ status: null,
907
+ message: "The Ledger mock store could not be prepared. Check that the mock data folder can be created and written.",
908
+ whatToDo: "Check that the folder exists or can be created, that you have write permission and that the disk is not full. The original error is in the `cause`.",
909
+ },
910
+ SD06000002: {
911
+ name: "MOCK_LEDGER_STORE_READ_FAILED",
912
+ status: null,
913
+ message: "The Ledger mock data could not be read. Check that the mock file exists and contains valid JSON.",
914
+ whatToDo: "Open the mock file and fix the JSON, or delete the file so the adapter creates a new one. The original error is in the `cause`.",
915
+ },
916
+ SD06000003: {
917
+ name: "MOCK_LEDGER_STORE_WRITE_FAILED",
918
+ status: null,
919
+ message: "The Ledger mock data could not be saved. Check that you can write to the mock data folder.",
920
+ whatToDo: "Close programs that may lock the file, check write permission and free disk space, and try again. The original error is in the `cause`.",
921
+ },
922
+ SD06000004: {
923
+ name: "MOCK_LEDGER_MEDIA_READ_FAILED",
924
+ status: null,
925
+ message: "A Ledger mock media file could not be read. Check that the file exists in the mock data folder.",
926
+ whatToDo: "Check that the file is in the media folder of the mock data folder. The original error is in the `cause`.",
927
+ },
928
+ SD06000005: {
929
+ name: "MOCK_LEDGER_MEDIA_WRITE_FAILED",
930
+ status: null,
931
+ message: "A Ledger mock media file could not be saved. Check that you can write to the mock data folder.",
932
+ whatToDo: "Check write permission and free disk space. The original error is in the `cause`.",
933
+ },
934
+ SD06000006: {
935
+ name: "MOCK_LEDGER_MEDIA_DELETE_FAILED",
936
+ status: null,
937
+ message: "A Ledger mock media file could not be deleted. Check that you can write to the mock data folder.",
938
+ whatToDo: "Check write permission and that no other program has the file open. The original error is in the `cause`.",
939
+ },
940
+ SD06000007: {
941
+ name: "MOCK_LEDGER_RUNTIME_NOT_NODE",
942
+ status: null,
943
+ message: "The Ledger mock has no content to show in a browser, because a browser cannot read parrel/ledger/mock.json. Pass the content to defineParrelLedger, for example `import mockData from \"../parrel/ledger/mock.json\"` and `defineParrelLedger({ slug, mockData })` (`npx parrel ledger init --framework react` writes this), or use `mode: \"live\"` to talk to the Ledger service.",
944
+ whatToDo: "Import the mock content and pass it as `mockData`: `import mockData from \"../parrel/ledger/mock.json\"` and `defineParrelLedger({ slug, mockData })`. `npx parrel ledger init --framework react` (or `vue`, `angular`) writes this config. To use the Ledger service in development, set `mode: \"live\"` instead.",
945
+ },
946
+ SD06000009: {
947
+ name: "MOCK_LEDGER_FILE_PATH_EMPTY",
948
+ status: null,
949
+ message: "The Ledger mock adapter needs a file path, and the path is empty. Pass the path of your mock file.",
950
+ whatToDo: "Set the `file` option to the path of your mock JSON file, or remove the option.",
951
+ },
952
+ SD06000010: {
953
+ name: "MOCK_LEDGER_SEED_FILE_READ_FAILED",
954
+ status: null,
955
+ message: "The Ledger seed file could not be read. Check that the file exists and contains valid JSON.",
956
+ whatToDo: "Check the path of the seed file and fix its JSON. The original error is in the `cause`.",
957
+ },
958
+ SD06000011: {
959
+ name: "MOCK_LEDGER_SEED_FROM_FILE_FAILED",
960
+ status: null,
961
+ message: "The Ledger mock store could not be seeded from the file. Check the seed file and the target folder.",
962
+ whatToDo: "Check that the target folder can be written and that the media files named in the seed file exist. The original error is in the `cause`.",
963
+ },
964
+ SD06000012: {
965
+ name: "MOCK_LEDGER_SEED_FROM_DATA_FAILED",
966
+ status: null,
967
+ message: "The Ledger mock store could not be seeded with the data. Check the data and the target folder.",
968
+ whatToDo: "Check that the target folder can be written and that the data is valid. The original error is in the `cause`.",
969
+ },
970
+ };
971
+ //# sourceMappingURL=error-messages.generated.js.map