@lowdefy/build 4.5.2 → 4.7.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 (163) hide show
  1. package/dist/build/addDefaultPages/404.js +1 -1
  2. package/dist/build/addDefaultPages/addDefaultPages.js +10 -4
  3. package/dist/build/addKeys.js +85 -29
  4. package/dist/build/buildApi/buildApi.js +27 -8
  5. package/dist/build/buildApi/buildEndpoint.js +7 -1
  6. package/dist/build/buildApi/buildRoutine/buildControl.js +1 -1
  7. package/dist/build/buildApi/buildRoutine/buildRoutine.js +1 -1
  8. package/dist/build/buildApi/buildRoutine/buildStep.js +1 -1
  9. package/dist/build/buildApi/buildRoutine/controlTypes.js +34 -11
  10. package/dist/build/buildApi/buildRoutine/countControl.js +1 -1
  11. package/dist/build/buildApi/buildRoutine/countStepTypes.js +2 -2
  12. package/dist/build/buildApi/buildRoutine/setStepId.js +1 -1
  13. package/dist/build/buildApi/buildRoutine/validateStep.js +30 -9
  14. package/dist/build/buildApi/validateEndpoint.js +36 -7
  15. package/dist/build/buildApi/validateStepReferences.js +65 -0
  16. package/dist/build/buildApp.js +1 -1
  17. package/dist/build/buildAuth/buildApiAuth.js +7 -3
  18. package/dist/build/buildAuth/buildAuth.js +7 -4
  19. package/dist/build/buildAuth/buildAuthPlugins.js +42 -13
  20. package/dist/build/buildAuth/buildPageAuth.js +14 -3
  21. package/dist/build/buildAuth/getApiRoles.js +1 -1
  22. package/dist/build/buildAuth/getPageRoles.js +1 -1
  23. package/dist/build/buildAuth/getProtectedApi.js +1 -1
  24. package/dist/build/buildAuth/getProtectedPages.js +1 -1
  25. package/dist/build/buildAuth/validateAuthConfig.js +39 -5
  26. package/dist/build/buildAuth/validateMutualExclusivity.js +13 -5
  27. package/dist/build/buildConnections.js +23 -24
  28. package/dist/build/buildImports/buildIconImports.js +1 -1
  29. package/dist/build/buildImports/buildImports.js +1 -1
  30. package/dist/build/buildImports/buildImportsDev.js +1 -1
  31. package/dist/build/buildImports/buildImportsProd.js +1 -1
  32. package/dist/build/buildImports/buildStyleImports.js +1 -1
  33. package/dist/build/buildImports/defaultIconsDev.js +1 -1
  34. package/dist/build/buildImports/defaultIconsProd.js +1 -1
  35. package/dist/build/buildJs/generateJsFile.js +1 -1
  36. package/dist/build/buildJs/jsMapParser.js +1 -1
  37. package/dist/build/buildJs/writeJs.js +1 -1
  38. package/dist/build/buildLogger.js +41 -0
  39. package/dist/build/buildMenu.js +36 -12
  40. package/dist/build/buildPages/buildBlock/buildBlock.js +1 -1
  41. package/dist/build/buildPages/buildBlock/buildEvents.js +79 -9
  42. package/dist/build/buildPages/buildBlock/buildRequests.js +38 -8
  43. package/dist/build/buildPages/buildBlock/buildSubBlocks.js +6 -2
  44. package/dist/build/buildPages/buildBlock/countBlockOperators.js +1 -1
  45. package/dist/build/buildPages/buildBlock/countBlockTypes.js +2 -2
  46. package/dist/build/buildPages/buildBlock/moveSkeletonBlocksToArea.js +6 -2
  47. package/dist/build/buildPages/buildBlock/moveSubBlocksToArea.js +6 -2
  48. package/dist/build/buildPages/buildBlock/setBlockId.js +1 -1
  49. package/dist/build/buildPages/buildBlock/validateBlock.js +25 -7
  50. package/dist/build/buildPages/buildPage.js +35 -6
  51. package/dist/build/buildPages/validateLinkReferences.js +33 -0
  52. package/dist/build/buildPages/validatePayloadReferences.js +59 -0
  53. package/dist/build/buildPages/validateRequestReferences.js +33 -0
  54. package/dist/build/buildPages/validateServerStateReferences.js +41 -0
  55. package/dist/build/buildPages/validateStateReferences.js +79 -0
  56. package/dist/build/buildRefs/buildRefs.js +40 -7
  57. package/dist/build/buildRefs/evaluateStaticOperators.js +52 -0
  58. package/dist/build/buildRefs/getConfigFile.js +25 -6
  59. package/dist/build/buildRefs/getKey.js +1 -1
  60. package/dist/build/buildRefs/getRefContent.js +1 -1
  61. package/dist/build/buildRefs/getRefPath.js +1 -1
  62. package/dist/build/buildRefs/getUserJavascriptFunction.js +18 -4
  63. package/dist/build/buildRefs/makeRefDefinition.js +10 -5
  64. package/dist/build/buildRefs/parseNunjucks.js +1 -1
  65. package/dist/build/buildRefs/parseRefContent.js +108 -7
  66. package/dist/build/buildRefs/runRefResolver.js +11 -3
  67. package/dist/build/buildRefs/runTransformer.js +7 -3
  68. package/dist/build/buildRefs/walker.js +340 -0
  69. package/dist/build/buildTypes.js +22 -7
  70. package/dist/build/cleanBuildDirectory.js +1 -1
  71. package/dist/build/collectDynamicIdentifiers.js +35 -0
  72. package/dist/build/collectTypeNames.js +36 -0
  73. package/dist/build/copyPublicFolder.js +1 -1
  74. package/dist/build/{buildJs → full}/buildJs.js +3 -3
  75. package/dist/build/full/buildPages.js +87 -0
  76. package/dist/build/{buildPages → full}/buildTestPage.js +15 -3
  77. package/dist/build/{updateServerPackageJson.js → full/updateServerPackageJson.js} +1 -1
  78. package/dist/build/{writePages.js → full/writePages.js} +1 -1
  79. package/dist/build/{writeRequests.js → full/writeRequests.js} +11 -3
  80. package/dist/build/{writeTypes.js → full/writeTypes.js} +1 -1
  81. package/dist/build/jit/addInstalledTypes.js +51 -0
  82. package/dist/build/jit/buildJsShallow.js +41 -0
  83. package/dist/build/jit/buildPageJit.js +271 -0
  84. package/dist/build/jit/buildShallowPages.js +90 -0
  85. package/dist/build/jit/createPageRegistry.js +85 -0
  86. package/dist/build/jit/detectMissingPluginPackages.js +62 -0
  87. package/dist/build/jit/isPageContentPath.js +24 -0
  88. package/dist/build/jit/pageContentKeys.js +26 -0
  89. package/dist/build/jit/shallowBuild.js +242 -0
  90. package/dist/build/jit/updateServerPackageJsonJit.js +33 -0
  91. package/dist/build/jit/validatePageTypes.js +73 -0
  92. package/dist/build/jit/writePageJit.js +44 -0
  93. package/dist/build/jit/writePageRegistry.js +23 -0
  94. package/dist/build/jit/writeSourcelessPages.js +23 -0
  95. package/dist/build/testSchema.js +45 -7
  96. package/dist/build/validateConfig.js +2 -2
  97. package/dist/build/validateOperatorsDynamic.js +28 -0
  98. package/dist/build/writeApi.js +1 -1
  99. package/dist/build/writeApp.js +1 -1
  100. package/dist/build/writeAuth.js +1 -1
  101. package/dist/build/writeConfig.js +1 -1
  102. package/dist/build/writeConnections.js +1 -1
  103. package/dist/build/writeGlobal.js +1 -1
  104. package/dist/build/writeLogger.js +19 -0
  105. package/dist/build/writeMaps.js +1 -1
  106. package/dist/build/writeMenus.js +1 -1
  107. package/dist/build/writePluginImports/generateImportFile.js +1 -1
  108. package/dist/build/writePluginImports/writeActionImports.js +1 -1
  109. package/dist/build/writePluginImports/writeActionSchemaMap.js +42 -0
  110. package/dist/build/writePluginImports/writeAuthImports.js +1 -1
  111. package/dist/build/writePluginImports/writeBlockImports.js +1 -1
  112. package/dist/build/writePluginImports/writeBlockSchemaMap.js +42 -0
  113. package/dist/build/writePluginImports/writeConnectionImports.js +1 -1
  114. package/dist/build/writePluginImports/writeIconImports.js +1 -1
  115. package/dist/build/writePluginImports/writeOperatorImports.js +1 -1
  116. package/dist/build/writePluginImports/writeOperatorSchemaMap.js +49 -0
  117. package/dist/build/writePluginImports/writePluginImports.js +16 -1
  118. package/dist/build/writePluginImports/writeStyleImports.js +1 -1
  119. package/dist/createContext.js +16 -4
  120. package/dist/defaultTypesMap.js +479 -457
  121. package/dist/index.js +190 -127
  122. package/dist/indexDev.js +19 -0
  123. package/dist/lowdefySchema.js +588 -0
  124. package/dist/scripts/generateDefaultTypes.js +2 -1
  125. package/dist/scripts/run.js +1 -1
  126. package/dist/{test → test-utils}/buildRefs/testBuildRefsAsyncFunction.js +1 -1
  127. package/dist/{test → test-utils}/buildRefs/testBuildRefsErrorResolver.js +1 -1
  128. package/dist/{test → test-utils}/buildRefs/testBuildRefsNullResolver.js +1 -1
  129. package/dist/{test → test-utils}/buildRefs/testBuildRefsParsingResolver.js +1 -1
  130. package/dist/{test → test-utils}/buildRefs/testBuildRefsResolver.js +1 -1
  131. package/dist/{test → test-utils}/buildRefs/testBuildRefsTransform.js +1 -1
  132. package/dist/{test → test-utils}/buildRefs/testBuildRefsTransformIdentity.js +1 -1
  133. package/dist/test-utils/buildRefs/testJitPageResolver.js +24 -0
  134. package/dist/test-utils/createTestLogger.js +36 -0
  135. package/dist/test-utils/parseTestYaml.js +126 -0
  136. package/dist/test-utils/runBuild.js +228 -0
  137. package/dist/test-utils/runBuildForSnapshots.js +704 -0
  138. package/dist/{test → test-utils}/testContext.js +12 -2
  139. package/dist/utils/collectExceptions.js +34 -0
  140. package/dist/utils/countOperators.js +31 -12
  141. package/dist/utils/createBuildHandleError.js +38 -0
  142. package/dist/utils/createCheckDuplicateId.js +15 -9
  143. package/dist/utils/createCounter.js +16 -3
  144. package/dist/utils/createHandleWarning.js +41 -0
  145. package/dist/utils/createPluginTypesMap.js +1 -1
  146. package/dist/utils/extractOperatorKey.js +36 -0
  147. package/dist/utils/findConfigKey.js +37 -0
  148. package/dist/utils/findSimilarString.js +53 -0
  149. package/dist/utils/logCollectedErrors.js +30 -0
  150. package/dist/utils/makeId.js +16 -8
  151. package/dist/utils/preserveMetaProperties.js +27 -0
  152. package/dist/utils/readConfigFile.js +1 -1
  153. package/dist/utils/setNonEnumerableProperty.js +23 -0
  154. package/dist/utils/traverseConfig.js +43 -0
  155. package/dist/utils/tryBuildStep.js +46 -0
  156. package/dist/utils/writeBuildArtifact.js +1 -1
  157. package/package.json +46 -41
  158. package/dist/build/buildPages/buildPages.js +0 -31
  159. package/dist/build/buildRefs/evaluateBuildOperators.js +0 -34
  160. package/dist/build/buildRefs/getRefsFromFile.js +0 -37
  161. package/dist/build/buildRefs/populateRefs.js +0 -43
  162. package/dist/build/buildRefs/recursiveBuild.js +0 -85
  163. package/dist/utils/formatErrorMessage.js +0 -56
@@ -0,0 +1,704 @@
1
+ /*
2
+ Copyright 2020-2026 Lowdefy, Inc
3
+
4
+ Licensed under the Apache License, Version 2.0 (the "License");
5
+ you may not use this file except in compliance with the License.
6
+ You may obtain a copy of the License at
7
+
8
+ http://www.apache.org/licenses/LICENSE-2.0
9
+
10
+ Unless required by applicable law or agreed to in writing, software
11
+ distributed under the License is distributed on an "AS IS" BASIS,
12
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ See the License for the specific language governing permissions and
14
+ limitations under the License.
15
+ */ import { jest } from '@jest/globals';
16
+ import path from 'path';
17
+ /**
18
+ * Extended types map for success tests - includes more types for comprehensive coverage.
19
+ */ const snapshotTypesMap = {
20
+ actions: {
21
+ CallMethod: {
22
+ package: '@lowdefy/actions-core'
23
+ },
24
+ CopyToClipboard: {
25
+ package: '@lowdefy/actions-core'
26
+ },
27
+ DisplayMessage: {
28
+ package: '@lowdefy/actions-core'
29
+ },
30
+ Link: {
31
+ package: '@lowdefy/actions-core'
32
+ },
33
+ Login: {
34
+ package: '@lowdefy/actions-core'
35
+ },
36
+ Logout: {
37
+ package: '@lowdefy/actions-core'
38
+ },
39
+ Request: {
40
+ package: '@lowdefy/actions-core'
41
+ },
42
+ Reset: {
43
+ package: '@lowdefy/actions-core'
44
+ },
45
+ ResetValidation: {
46
+ package: '@lowdefy/actions-core'
47
+ },
48
+ ScrollTo: {
49
+ package: '@lowdefy/actions-core'
50
+ },
51
+ SetFocus: {
52
+ package: '@lowdefy/actions-core'
53
+ },
54
+ SetGlobal: {
55
+ package: '@lowdefy/actions-core'
56
+ },
57
+ SetState: {
58
+ package: '@lowdefy/actions-core'
59
+ },
60
+ Throw: {
61
+ package: '@lowdefy/actions-core'
62
+ },
63
+ Validate: {
64
+ package: '@lowdefy/actions-core'
65
+ },
66
+ Wait: {
67
+ package: '@lowdefy/actions-core'
68
+ },
69
+ Return: {
70
+ package: '@lowdefy/api'
71
+ },
72
+ Log: {
73
+ package: '@lowdefy/actions-core'
74
+ }
75
+ },
76
+ blocks: {
77
+ // Basic blocks
78
+ Anchor: {
79
+ package: '@lowdefy/blocks-basic'
80
+ },
81
+ Box: {
82
+ package: '@lowdefy/blocks-basic'
83
+ },
84
+ Button: {
85
+ package: '@lowdefy/blocks-basic'
86
+ },
87
+ DangerousHtml: {
88
+ package: '@lowdefy/blocks-basic'
89
+ },
90
+ Html: {
91
+ package: '@lowdefy/blocks-basic'
92
+ },
93
+ Icon: {
94
+ package: '@lowdefy/blocks-basic'
95
+ },
96
+ Img: {
97
+ package: '@lowdefy/blocks-basic'
98
+ },
99
+ List: {
100
+ package: '@lowdefy/blocks-basic'
101
+ },
102
+ Paragraph: {
103
+ package: '@lowdefy/blocks-basic'
104
+ },
105
+ Span: {
106
+ package: '@lowdefy/blocks-basic'
107
+ },
108
+ Throw: {
109
+ package: '@lowdefy/blocks-basic'
110
+ },
111
+ Title: {
112
+ package: '@lowdefy/blocks-basic'
113
+ },
114
+ // Loaders
115
+ ProgressBar: {
116
+ package: '@lowdefy/blocks-loaders'
117
+ },
118
+ Skeleton: {
119
+ package: '@lowdefy/blocks-loaders'
120
+ },
121
+ SkeletonAvatar: {
122
+ package: '@lowdefy/blocks-loaders'
123
+ },
124
+ SkeletonButton: {
125
+ package: '@lowdefy/blocks-loaders'
126
+ },
127
+ SkeletonInput: {
128
+ package: '@lowdefy/blocks-loaders'
129
+ },
130
+ SkeletonParagraph: {
131
+ package: '@lowdefy/blocks-loaders'
132
+ },
133
+ Spinner: {
134
+ package: '@lowdefy/blocks-loaders'
135
+ },
136
+ // Antd blocks
137
+ Alert: {
138
+ package: '@lowdefy/blocks-antd'
139
+ },
140
+ AutoComplete: {
141
+ package: '@lowdefy/blocks-antd'
142
+ },
143
+ Avatar: {
144
+ package: '@lowdefy/blocks-antd'
145
+ },
146
+ Badge: {
147
+ package: '@lowdefy/blocks-antd'
148
+ },
149
+ Breadcrumb: {
150
+ package: '@lowdefy/blocks-antd'
151
+ },
152
+ Card: {
153
+ package: '@lowdefy/blocks-antd'
154
+ },
155
+ Carousel: {
156
+ package: '@lowdefy/blocks-antd'
157
+ },
158
+ CheckboxSelector: {
159
+ package: '@lowdefy/blocks-antd'
160
+ },
161
+ Collapse: {
162
+ package: '@lowdefy/blocks-antd'
163
+ },
164
+ Comment: {
165
+ package: '@lowdefy/blocks-antd'
166
+ },
167
+ ConfirmModal: {
168
+ package: '@lowdefy/blocks-antd'
169
+ },
170
+ Content: {
171
+ package: '@lowdefy/blocks-antd'
172
+ },
173
+ DateSelector: {
174
+ package: '@lowdefy/blocks-antd'
175
+ },
176
+ Descriptions: {
177
+ package: '@lowdefy/blocks-antd'
178
+ },
179
+ Divider: {
180
+ package: '@lowdefy/blocks-antd'
181
+ },
182
+ Drawer: {
183
+ package: '@lowdefy/blocks-antd'
184
+ },
185
+ Footer: {
186
+ package: '@lowdefy/blocks-antd'
187
+ },
188
+ Header: {
189
+ package: '@lowdefy/blocks-antd'
190
+ },
191
+ Label: {
192
+ package: '@lowdefy/blocks-antd'
193
+ },
194
+ Layout: {
195
+ package: '@lowdefy/blocks-antd'
196
+ },
197
+ Menu: {
198
+ package: '@lowdefy/blocks-antd'
199
+ },
200
+ Message: {
201
+ package: '@lowdefy/blocks-antd'
202
+ },
203
+ MobileMenu: {
204
+ package: '@lowdefy/blocks-antd'
205
+ },
206
+ Modal: {
207
+ package: '@lowdefy/blocks-antd'
208
+ },
209
+ MultipleSelector: {
210
+ package: '@lowdefy/blocks-antd'
211
+ },
212
+ NumberInput: {
213
+ package: '@lowdefy/blocks-antd'
214
+ },
215
+ PageHeaderMenu: {
216
+ package: '@lowdefy/blocks-antd'
217
+ },
218
+ PageSiderMenu: {
219
+ package: '@lowdefy/blocks-antd'
220
+ },
221
+ Pagination: {
222
+ package: '@lowdefy/blocks-antd'
223
+ },
224
+ ParagraphInput: {
225
+ package: '@lowdefy/blocks-antd'
226
+ },
227
+ PasswordInput: {
228
+ package: '@lowdefy/blocks-antd'
229
+ },
230
+ Popover: {
231
+ package: '@lowdefy/blocks-antd'
232
+ },
233
+ Progress: {
234
+ package: '@lowdefy/blocks-antd'
235
+ },
236
+ RadioSelector: {
237
+ package: '@lowdefy/blocks-antd'
238
+ },
239
+ RatingSlider: {
240
+ package: '@lowdefy/blocks-antd'
241
+ },
242
+ Result: {
243
+ package: '@lowdefy/blocks-antd'
244
+ },
245
+ Selector: {
246
+ package: '@lowdefy/blocks-antd'
247
+ },
248
+ Sider: {
249
+ package: '@lowdefy/blocks-antd'
250
+ },
251
+ Statistic: {
252
+ package: '@lowdefy/blocks-antd'
253
+ },
254
+ Switch: {
255
+ package: '@lowdefy/blocks-antd'
256
+ },
257
+ Tabs: {
258
+ package: '@lowdefy/blocks-antd'
259
+ },
260
+ Tag: {
261
+ package: '@lowdefy/blocks-antd'
262
+ },
263
+ TextArea: {
264
+ package: '@lowdefy/blocks-antd'
265
+ },
266
+ TextInput: {
267
+ package: '@lowdefy/blocks-antd'
268
+ },
269
+ TitleInput: {
270
+ package: '@lowdefy/blocks-antd'
271
+ },
272
+ Tooltip: {
273
+ package: '@lowdefy/blocks-antd'
274
+ },
275
+ TreeSelector: {
276
+ package: '@lowdefy/blocks-antd'
277
+ }
278
+ },
279
+ connections: {
280
+ AxiosHttp: {
281
+ package: '@lowdefy/connection-axios-http'
282
+ },
283
+ MongoDBCollection: {
284
+ package: '@lowdefy/connection-mongodb'
285
+ },
286
+ Knex: {
287
+ package: '@lowdefy/connection-knex'
288
+ },
289
+ Redis: {
290
+ package: '@lowdefy/connection-redis'
291
+ },
292
+ SendGridMail: {
293
+ package: '@lowdefy/connection-sendgrid'
294
+ },
295
+ Stripe: {
296
+ package: '@lowdefy/connection-stripe'
297
+ },
298
+ GoogleSheet: {
299
+ package: '@lowdefy/connection-google-sheets'
300
+ },
301
+ Elasticsearch: {
302
+ package: '@lowdefy/connection-elasticsearch'
303
+ },
304
+ AWSS3: {
305
+ package: '@lowdefy/plugin-aws'
306
+ }
307
+ },
308
+ requests: {
309
+ AxiosHttp: {
310
+ package: '@lowdefy/connection-axios-http'
311
+ },
312
+ MongoDBFind: {
313
+ package: '@lowdefy/connection-mongodb'
314
+ },
315
+ MongoDBFindOne: {
316
+ package: '@lowdefy/connection-mongodb'
317
+ },
318
+ MongoDBInsertOne: {
319
+ package: '@lowdefy/connection-mongodb'
320
+ },
321
+ MongoDBInsertMany: {
322
+ package: '@lowdefy/connection-mongodb'
323
+ },
324
+ MongoDBUpdateOne: {
325
+ package: '@lowdefy/connection-mongodb'
326
+ },
327
+ MongoDBUpdateMany: {
328
+ package: '@lowdefy/connection-mongodb'
329
+ },
330
+ MongoDBDeleteOne: {
331
+ package: '@lowdefy/connection-mongodb'
332
+ },
333
+ MongoDBDeleteMany: {
334
+ package: '@lowdefy/connection-mongodb'
335
+ },
336
+ MongoDBAggregate: {
337
+ package: '@lowdefy/connection-mongodb'
338
+ },
339
+ KnexRaw: {
340
+ package: '@lowdefy/connection-knex'
341
+ },
342
+ RedisGet: {
343
+ package: '@lowdefy/connection-redis'
344
+ },
345
+ RedisSet: {
346
+ package: '@lowdefy/connection-redis'
347
+ },
348
+ SendGridMailSend: {
349
+ package: '@lowdefy/connection-sendgrid'
350
+ },
351
+ StripePaymentIntents: {
352
+ package: '@lowdefy/connection-stripe'
353
+ },
354
+ GoogleSheetGetMany: {
355
+ package: '@lowdefy/connection-google-sheets'
356
+ },
357
+ GoogleSheetAppendOne: {
358
+ package: '@lowdefy/connection-google-sheets'
359
+ },
360
+ ElasticsearchSearch: {
361
+ package: '@lowdefy/connection-elasticsearch'
362
+ },
363
+ AWSS3GetObject: {
364
+ package: '@lowdefy/plugin-aws'
365
+ },
366
+ AWSS3PutObject: {
367
+ package: '@lowdefy/plugin-aws'
368
+ }
369
+ },
370
+ auth: {
371
+ adapters: {
372
+ MongoDBAdapter: {
373
+ package: '@lowdefy/plugin-next-auth'
374
+ }
375
+ },
376
+ callbacks: {
377
+ JwtCallback: {
378
+ package: '@lowdefy/plugin-next-auth'
379
+ },
380
+ SessionCallback: {
381
+ package: '@lowdefy/plugin-next-auth'
382
+ },
383
+ SignInCallback: {
384
+ package: '@lowdefy/plugin-next-auth'
385
+ },
386
+ RedirectCallback: {
387
+ package: '@lowdefy/plugin-next-auth'
388
+ }
389
+ },
390
+ events: {
391
+ SignIn: {
392
+ package: '@lowdefy/plugin-next-auth'
393
+ },
394
+ SignOut: {
395
+ package: '@lowdefy/plugin-next-auth'
396
+ },
397
+ CreateUser: {
398
+ package: '@lowdefy/plugin-next-auth'
399
+ },
400
+ UpdateUser: {
401
+ package: '@lowdefy/plugin-next-auth'
402
+ },
403
+ LinkAccount: {
404
+ package: '@lowdefy/plugin-next-auth'
405
+ },
406
+ Session: {
407
+ package: '@lowdefy/plugin-next-auth'
408
+ }
409
+ },
410
+ providers: {
411
+ Auth0Provider: {
412
+ package: '@lowdefy/plugin-auth0'
413
+ },
414
+ GoogleProvider: {
415
+ package: 'next-auth'
416
+ },
417
+ GitHubProvider: {
418
+ package: 'next-auth'
419
+ },
420
+ CredentialsProvider: {
421
+ package: 'next-auth'
422
+ },
423
+ EmailProvider: {
424
+ package: 'next-auth'
425
+ }
426
+ }
427
+ },
428
+ operators: {
429
+ client: {
430
+ _state: {
431
+ package: '@lowdefy/operators-js'
432
+ },
433
+ _input: {
434
+ package: '@lowdefy/operators-js'
435
+ },
436
+ _global: {
437
+ package: '@lowdefy/operators-js'
438
+ },
439
+ _request: {
440
+ package: '@lowdefy/operators-js'
441
+ },
442
+ _user: {
443
+ package: '@lowdefy/operators-js'
444
+ },
445
+ _event: {
446
+ package: '@lowdefy/operators-js'
447
+ },
448
+ _actions: {
449
+ package: '@lowdefy/operators-js'
450
+ },
451
+ _location: {
452
+ package: '@lowdefy/operators-js'
453
+ },
454
+ _media: {
455
+ package: '@lowdefy/operators-js'
456
+ },
457
+ _menu: {
458
+ package: '@lowdefy/operators-js'
459
+ },
460
+ _if: {
461
+ package: '@lowdefy/operators-js'
462
+ },
463
+ _eq: {
464
+ package: '@lowdefy/operators-js'
465
+ },
466
+ _ne: {
467
+ package: '@lowdefy/operators-js'
468
+ },
469
+ _lt: {
470
+ package: '@lowdefy/operators-js'
471
+ },
472
+ _lte: {
473
+ package: '@lowdefy/operators-js'
474
+ },
475
+ _gt: {
476
+ package: '@lowdefy/operators-js'
477
+ },
478
+ _gte: {
479
+ package: '@lowdefy/operators-js'
480
+ },
481
+ _and: {
482
+ package: '@lowdefy/operators-js'
483
+ },
484
+ _or: {
485
+ package: '@lowdefy/operators-js'
486
+ },
487
+ _not: {
488
+ package: '@lowdefy/operators-js'
489
+ },
490
+ _type: {
491
+ package: '@lowdefy/operators-js'
492
+ },
493
+ _get: {
494
+ package: '@lowdefy/operators-js'
495
+ },
496
+ _array: {
497
+ package: '@lowdefy/operators-js'
498
+ },
499
+ _object: {
500
+ package: '@lowdefy/operators-js'
501
+ },
502
+ _string: {
503
+ package: '@lowdefy/operators-js'
504
+ },
505
+ _sum: {
506
+ package: '@lowdefy/operators-js'
507
+ },
508
+ _subtract: {
509
+ package: '@lowdefy/operators-js'
510
+ },
511
+ _product: {
512
+ package: '@lowdefy/operators-js'
513
+ },
514
+ _divide: {
515
+ package: '@lowdefy/operators-js'
516
+ },
517
+ _json: {
518
+ package: '@lowdefy/operators-js'
519
+ },
520
+ _yaml: {
521
+ package: '@lowdefy/operators-js'
522
+ },
523
+ _date: {
524
+ package: '@lowdefy/operators-js'
525
+ },
526
+ _payload: {
527
+ package: '@lowdefy/operators-js'
528
+ },
529
+ _args: {
530
+ package: '@lowdefy/operators-js'
531
+ },
532
+ _function: {
533
+ package: '@lowdefy/operators-js'
534
+ },
535
+ _random: {
536
+ package: '@lowdefy/operators-js'
537
+ },
538
+ _uuid: {
539
+ package: '@lowdefy/operators-uuid'
540
+ },
541
+ _moment: {
542
+ package: '@lowdefy/operators-moment'
543
+ },
544
+ _regex: {
545
+ package: '@lowdefy/operators-js'
546
+ },
547
+ _hash: {
548
+ package: '@lowdefy/operators-js'
549
+ },
550
+ _base64: {
551
+ package: '@lowdefy/operators-js'
552
+ },
553
+ _uri: {
554
+ package: '@lowdefy/operators-js'
555
+ },
556
+ _url_query: {
557
+ package: '@lowdefy/operators-js'
558
+ },
559
+ _switch: {
560
+ package: '@lowdefy/operators-js'
561
+ },
562
+ _if_none: {
563
+ package: '@lowdefy/operators-js'
564
+ },
565
+ _intl: {
566
+ package: '@lowdefy/operators-js'
567
+ },
568
+ _change_case: {
569
+ package: '@lowdefy/operators-change-case'
570
+ },
571
+ _diff: {
572
+ package: '@lowdefy/operators-diff'
573
+ },
574
+ _mql: {
575
+ package: '@lowdefy/operators-mql'
576
+ },
577
+ _nunjucks: {
578
+ package: '@lowdefy/operators-nunjucks'
579
+ },
580
+ _js: {
581
+ package: '@lowdefy/operators-js'
582
+ }
583
+ },
584
+ server: {
585
+ _payload: {
586
+ package: '@lowdefy/operators-js'
587
+ },
588
+ _step: {
589
+ package: '@lowdefy/operators-js'
590
+ },
591
+ _secret: {
592
+ package: '@lowdefy/operators-js'
593
+ },
594
+ _request: {
595
+ package: '@lowdefy/operators-js'
596
+ },
597
+ _user: {
598
+ package: '@lowdefy/operators-js'
599
+ },
600
+ _if: {
601
+ package: '@lowdefy/operators-js'
602
+ },
603
+ _eq: {
604
+ package: '@lowdefy/operators-js'
605
+ },
606
+ _get: {
607
+ package: '@lowdefy/operators-js'
608
+ },
609
+ _array: {
610
+ package: '@lowdefy/operators-js'
611
+ },
612
+ _object: {
613
+ package: '@lowdefy/operators-js'
614
+ },
615
+ _string: {
616
+ package: '@lowdefy/operators-js'
617
+ },
618
+ _json: {
619
+ package: '@lowdefy/operators-js'
620
+ },
621
+ _yaml: {
622
+ package: '@lowdefy/operators-js'
623
+ },
624
+ _date: {
625
+ package: '@lowdefy/operators-js'
626
+ },
627
+ _mql: {
628
+ package: '@lowdefy/operators-mql'
629
+ },
630
+ _js: {
631
+ package: '@lowdefy/operators-js'
632
+ }
633
+ }
634
+ },
635
+ controls: {
636
+ Endpoint: {
637
+ package: '@lowdefy/api'
638
+ },
639
+ Log: {
640
+ package: '@lowdefy/api'
641
+ },
642
+ Return: {
643
+ package: '@lowdefy/api'
644
+ },
645
+ Throw: {
646
+ package: '@lowdefy/api'
647
+ },
648
+ SetState: {
649
+ package: '@lowdefy/api'
650
+ }
651
+ }
652
+ };
653
+ /**
654
+ * Creates a runBuild helper function for snapshot testing build artifacts.
655
+ *
656
+ * @param {Function} build - The build function
657
+ * @param {string} fixturesDir - Absolute path to the fixtures directory
658
+ * @param {Function} mockWriteBuildArtifact - Mock function to capture artifacts
659
+ * @returns {Function} runBuild helper function
660
+ */ function createRunBuildForSnapshots(build, fixturesDir, mockWriteBuildArtifact) {
661
+ return async function runBuild(fixtureDir, stage = 'prod') {
662
+ const configDir = path.join(fixturesDir, fixtureDir);
663
+ const artifacts = {};
664
+ // Create a mock that captures written artifacts
665
+ mockWriteBuildArtifact.mockImplementation((filePath, content)=>{
666
+ artifacts[filePath] = content;
667
+ });
668
+ const logger = {
669
+ info: jest.fn(),
670
+ log: jest.fn(),
671
+ warn: jest.fn(),
672
+ error: jest.fn(),
673
+ succeed: jest.fn()
674
+ };
675
+ await build({
676
+ customTypesMap: snapshotTypesMap,
677
+ directories: {
678
+ config: configDir,
679
+ build: path.join(configDir, '.lowdefy'),
680
+ server: path.join(configDir, '.lowdefy', 'server')
681
+ },
682
+ logger,
683
+ stage
684
+ });
685
+ // Parse JSON artifacts for snapshot comparison
686
+ const parsedArtifacts = {};
687
+ for (const [filePath, content] of Object.entries(artifacts)){
688
+ if (filePath.endsWith('.json')) {
689
+ try {
690
+ parsedArtifacts[filePath] = JSON.parse(content);
691
+ } catch {
692
+ parsedArtifacts[filePath] = content;
693
+ }
694
+ } else {
695
+ parsedArtifacts[filePath] = content;
696
+ }
697
+ }
698
+ return {
699
+ artifacts: parsedArtifacts,
700
+ logger
701
+ };
702
+ };
703
+ }
704
+ export { snapshotTypesMap, createRunBuildForSnapshots };