@hubspot/ui-extensions-dev-server 1.0.2 → 1.1.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 (95) hide show
  1. package/package.json +1 -1
  2. package/dist/index.d.ts +0 -4
  3. package/dist/index.js +0 -4
  4. package/dist/lib/DevModeInterface.d.ts +0 -9
  5. package/dist/lib/DevModeInterface.js +0 -36
  6. package/dist/lib/DevModeParentInterface.d.ts +0 -19
  7. package/dist/lib/DevModeParentInterface.js +0 -181
  8. package/dist/lib/DevModeUnifiedInterface.d.ts +0 -9
  9. package/dist/lib/DevModeUnifiedInterface.js +0 -118
  10. package/dist/lib/DevServerState.d.ts +0 -44
  11. package/dist/lib/DevServerState.js +0 -95
  12. package/dist/lib/ExtensionsWebSocket.d.ts +0 -25
  13. package/dist/lib/ExtensionsWebSocket.js +0 -110
  14. package/dist/lib/__mocks__/config.d.ts +0 -2
  15. package/dist/lib/__mocks__/config.js +0 -5
  16. package/dist/lib/__mocks__/isExtensionFile.d.ts +0 -5
  17. package/dist/lib/__mocks__/isExtensionFile.js +0 -11
  18. package/dist/lib/__tests__/DevModeInterface.spec.d.ts +0 -1
  19. package/dist/lib/__tests__/DevModeInterface.spec.js +0 -155
  20. package/dist/lib/__tests__/DevModeParentInterface.spec.d.ts +0 -1
  21. package/dist/lib/__tests__/DevModeParentInterface.spec.js +0 -179
  22. package/dist/lib/__tests__/DevModeUnifiedInterface.spec.d.ts +0 -1
  23. package/dist/lib/__tests__/DevModeUnifiedInterface.spec.js +0 -236
  24. package/dist/lib/__tests__/ExtensionsWebSocket.spec.d.ts +0 -1
  25. package/dist/lib/__tests__/ExtensionsWebSocket.spec.js +0 -304
  26. package/dist/lib/__tests__/ast.spec.d.ts +0 -1
  27. package/dist/lib/__tests__/ast.spec.js +0 -737
  28. package/dist/lib/__tests__/build.spec.d.ts +0 -1
  29. package/dist/lib/__tests__/build.spec.js +0 -159
  30. package/dist/lib/__tests__/config.spec.d.ts +0 -1
  31. package/dist/lib/__tests__/config.spec.js +0 -291
  32. package/dist/lib/__tests__/dev.spec.d.ts +0 -1
  33. package/dist/lib/__tests__/dev.spec.js +0 -80
  34. package/dist/lib/__tests__/extensionsService.spec.d.ts +0 -1
  35. package/dist/lib/__tests__/extensionsService.spec.js +0 -150
  36. package/dist/lib/__tests__/factories.d.ts +0 -48
  37. package/dist/lib/__tests__/factories.js +0 -32
  38. package/dist/lib/__tests__/fixtures/extensionConfig.d.ts +0 -182
  39. package/dist/lib/__tests__/fixtures/extensionConfig.js +0 -304
  40. package/dist/lib/__tests__/fixtures/urls.d.ts +0 -4
  41. package/dist/lib/__tests__/fixtures/urls.js +0 -4
  42. package/dist/lib/__tests__/parsing-utils.spec.d.ts +0 -1
  43. package/dist/lib/__tests__/parsing-utils.spec.js +0 -467
  44. package/dist/lib/__tests__/plugins/codeBlockingPlugin.spec.d.ts +0 -1
  45. package/dist/lib/__tests__/plugins/codeBlockingPlugin.spec.js +0 -112
  46. package/dist/lib/__tests__/plugins/codeCheckingPlugin.spec.d.ts +0 -1
  47. package/dist/lib/__tests__/plugins/codeCheckingPlugin.spec.js +0 -111
  48. package/dist/lib/__tests__/plugins/devBuildPlugin.spec.d.ts +0 -1
  49. package/dist/lib/__tests__/plugins/devBuildPlugin.spec.js +0 -256
  50. package/dist/lib/__tests__/plugins/friendlyLoggingPlugin.spec.d.ts +0 -1
  51. package/dist/lib/__tests__/plugins/friendlyLoggingPlugin.spec.js +0 -65
  52. package/dist/lib/__tests__/plugins/manifestPlugin.spec.d.ts +0 -1
  53. package/dist/lib/__tests__/plugins/manifestPlugin.spec.js +0 -455
  54. package/dist/lib/__tests__/plugins/relevantModulesPlugin.spec.d.ts +0 -1
  55. package/dist/lib/__tests__/plugins/relevantModulesPlugin.spec.js +0 -81
  56. package/dist/lib/__tests__/server.spec.d.ts +0 -1
  57. package/dist/lib/__tests__/server.spec.js +0 -152
  58. package/dist/lib/__tests__/test-utils/ast.d.ts +0 -1
  59. package/dist/lib/__tests__/test-utils/ast.js +0 -4
  60. package/dist/lib/__tests__/utils.spec.d.ts +0 -1
  61. package/dist/lib/__tests__/utils.spec.js +0 -176
  62. package/dist/lib/ast.d.ts +0 -16
  63. package/dist/lib/ast.js +0 -281
  64. package/dist/lib/bin/cli.d.ts +0 -2
  65. package/dist/lib/bin/cli.js +0 -143
  66. package/dist/lib/build.d.ts +0 -24
  67. package/dist/lib/build.js +0 -73
  68. package/dist/lib/config.d.ts +0 -7
  69. package/dist/lib/config.js +0 -124
  70. package/dist/lib/constants.d.ts +0 -32
  71. package/dist/lib/constants.js +0 -43
  72. package/dist/lib/dev.d.ts +0 -2
  73. package/dist/lib/dev.js +0 -58
  74. package/dist/lib/extensionsService.d.ts +0 -10
  75. package/dist/lib/extensionsService.js +0 -45
  76. package/dist/lib/parsing-utils.d.ts +0 -31
  77. package/dist/lib/parsing-utils.js +0 -289
  78. package/dist/lib/plugins/codeBlockingPlugin.d.ts +0 -8
  79. package/dist/lib/plugins/codeBlockingPlugin.js +0 -45
  80. package/dist/lib/plugins/codeCheckingPlugin.d.ts +0 -8
  81. package/dist/lib/plugins/codeCheckingPlugin.js +0 -89
  82. package/dist/lib/plugins/devBuildPlugin.d.ts +0 -8
  83. package/dist/lib/plugins/devBuildPlugin.js +0 -201
  84. package/dist/lib/plugins/friendlyLoggingPlugin.d.ts +0 -14
  85. package/dist/lib/plugins/friendlyLoggingPlugin.js +0 -36
  86. package/dist/lib/plugins/manifestPlugin.d.ts +0 -12
  87. package/dist/lib/plugins/manifestPlugin.js +0 -158
  88. package/dist/lib/plugins/relevantModulesPlugin.d.ts +0 -13
  89. package/dist/lib/plugins/relevantModulesPlugin.js +0 -25
  90. package/dist/lib/server.d.ts +0 -13
  91. package/dist/lib/server.js +0 -99
  92. package/dist/lib/types.d.ts +0 -290
  93. package/dist/lib/types.js +0 -12
  94. package/dist/lib/utils.d.ts +0 -25
  95. package/dist/lib/utils.js +0 -113
@@ -1,304 +0,0 @@
1
- import { UnifiedAppAuthTypes, UnifiedComponentTypes, } from "../../types.js";
2
- const addCard = (component, cardFile) => ({
3
- ...component,
4
- config: {
5
- ...component.config,
6
- extensions: {
7
- ...component.config.extensions,
8
- crm: {
9
- ...component.config.extensions.crm,
10
- cards: [...component.config.extensions.crm.cards, { file: cardFile }],
11
- },
12
- },
13
- },
14
- });
15
- const addUnifiedCard = (component, cardFile) => ({
16
- ...component,
17
- extensions: {
18
- ...component.extensions,
19
- crm: {
20
- ...component.extensions.crm,
21
- cards: [...component.extensions.crm.cards, { file: cardFile }],
22
- },
23
- },
24
- });
25
- export const appComponent = {
26
- config: {
27
- name: 'Meme generator',
28
- public: false,
29
- scopes: [],
30
- description: 'make some dope memes',
31
- extensions: {
32
- crm: {
33
- cards: [
34
- {
35
- file: 'extensions/meme-card.json',
36
- },
37
- ],
38
- },
39
- },
40
- },
41
- type: 'private-app',
42
- path: 'path/to/my/application',
43
- };
44
- export const appComponentTwoCards = addCard(appComponent, 'extensions/another-meme-card.json');
45
- export const appConfig = {
46
- name: 'Meme generator',
47
- description: 'make some dope memes',
48
- uid: 'meme_generator',
49
- scopes: ['crm.objects.contacts.read'],
50
- public: false,
51
- extensions: {
52
- crm: {
53
- cards: [
54
- {
55
- file: 'extensions/meme-card.json',
56
- },
57
- ],
58
- },
59
- },
60
- };
61
- export const unifiedAppConfig = {
62
- uid: 'application-uid',
63
- config: {
64
- description: 'Generate dope memes',
65
- name: 'Meme generator',
66
- auth: {
67
- type: UnifiedAppAuthTypes.OAUTH,
68
- redirectUrls: ['http://localhost:3000/oauth-callback'],
69
- requiredScopes: [
70
- 'crm.objects.contacts.read',
71
- 'crm.objects.contacts.write',
72
- 'media_bridge.read',
73
- 'media_bridge.write',
74
- ],
75
- optionalScopes: [],
76
- conditionallyRequiredScopes: [],
77
- },
78
- permittedUrls: {
79
- fetch: ['https://api.hubapi.com'],
80
- iframe: [],
81
- img: [],
82
- },
83
- },
84
- componentType: UnifiedComponentTypes.APPLICATION,
85
- componentDeps: {},
86
- metaFilePath: 'app/app-hsmeta.json',
87
- files: {},
88
- localDev: {
89
- componentRoot: '/some/path/to/app',
90
- componentConfigPath: '/some/path/to/app/app-hsmeta.json',
91
- },
92
- };
93
- export const transformedUnifiedAppConfig = {
94
- name: unifiedAppConfig.config.name,
95
- description: unifiedAppConfig.config.description,
96
- uid: unifiedAppConfig.uid,
97
- extensions: {
98
- crm: {
99
- cards: [
100
- {
101
- file: './CardOne.jsx',
102
- },
103
- ],
104
- },
105
- },
106
- auth: unifiedAppConfig.config.auth,
107
- support: undefined,
108
- isPublicApp: true,
109
- allowedUrls: ['https://api.hubapi.com'],
110
- variables: {},
111
- };
112
- export const transformedUnifiedAppConfigTwoCards = addUnifiedCard(transformedUnifiedAppConfig, './CardTwo.jsx');
113
- export const cardConfig = {
114
- type: 'crm-card',
115
- data: {
116
- title: 'Meme Card',
117
- uid: 'meme_card',
118
- location: 'crm.record.sidebar',
119
- module: { file: 'MemeCard.jsx' },
120
- objectTypes: [{ name: 'CONTACT' }],
121
- appName: appConfig.name,
122
- sourceId: `${appConfig.uid}::meme_card`,
123
- },
124
- output: 'MemeCard.js',
125
- path: 'path/to/my/application',
126
- extensionPath: 'path/to/my/application/extensions',
127
- extensionConfigPath: 'path/to/my/application/extensions/meme-card.json',
128
- appConfig,
129
- };
130
- export const cardConfigTwo = {
131
- type: 'crm-card',
132
- data: {
133
- title: 'Another Meme Card',
134
- uid: 'another_meme_card',
135
- location: 'crm.record.sidebar',
136
- module: { file: 'AnotherMemeCard.jsx' },
137
- objectTypes: [{ name: 'CONTACT' }],
138
- appName: appConfig.name,
139
- sourceId: `${appConfig.uid}::another_meme_card`,
140
- },
141
- output: 'AnotherMemeCard.js',
142
- path: 'path/to/my/application',
143
- extensionPath: 'path/to/my/application/extensions',
144
- extensionConfigPath: 'path/to/my/application/extensions/another-meme-card.json',
145
- appConfig,
146
- };
147
- export const unifiedCardOneConfig = {
148
- uid: 'card-one',
149
- config: {
150
- name: 'Card One',
151
- description: 'This is card one',
152
- location: 'crm.record.tab',
153
- entrypoint: '/app/cards/CardOne.jsx',
154
- objectTypes: ['CONTACT'],
155
- },
156
- componentType: UnifiedComponentTypes.CARD,
157
- componentDeps: {
158
- app: 'application-uid',
159
- },
160
- metaFilePath: 'app/cards/card-hsmeta.json',
161
- files: {},
162
- localDev: {
163
- componentRoot: '/some/path/to/app/cards',
164
- componentConfigPath: '/some/path/to/app/cards/card-hsmeta.json',
165
- },
166
- };
167
- export const transformedUnifiedCardOneConfig = {
168
- type: 'card',
169
- data: {
170
- title: 'Card One',
171
- uid: 'card-one',
172
- location: 'crm.record.tab',
173
- module: {
174
- file: '/some/path/to/app/cards/CardOne.jsx',
175
- },
176
- objectTypes: [
177
- {
178
- name: 'CONTACT',
179
- },
180
- ],
181
- appName: 'Meme generator',
182
- sourceId: 'application-uid::card-one',
183
- },
184
- output: 'CardOne.js',
185
- path: '/some/path/to/app',
186
- extensionPath: '/some/path/to/app/cards',
187
- extensionConfigPath: '/some/path/to/app/cards/card-hsmeta.json',
188
- };
189
- export const unifiedCardTwoConfig = {
190
- uid: 'card-two',
191
- config: {
192
- name: 'Card Two',
193
- description: 'This is card two',
194
- location: 'crm.record.tab',
195
- entrypoint: '/app/cards/CardTwo.jsx',
196
- objectTypes: ['CONTACT'],
197
- },
198
- componentType: UnifiedComponentTypes.CARD,
199
- componentDeps: {
200
- app: 'application-uid',
201
- },
202
- metaFilePath: 'app/cards/card-two-hsmeta.json',
203
- files: {},
204
- localDev: {
205
- componentRoot: '/some/path/to/app/cards',
206
- componentConfigPath: '/some/path/to/app/cards/card-two-hsmeta.json',
207
- },
208
- };
209
- export const transformedUnifiedCardTwoConfig = {
210
- type: 'card',
211
- data: {
212
- title: 'Card Two',
213
- uid: 'card-two',
214
- location: 'crm.record.tab',
215
- module: {
216
- file: '/some/path/to/app/cards/CardTwo.jsx',
217
- },
218
- objectTypes: [
219
- {
220
- name: 'CONTACT',
221
- },
222
- ],
223
- appName: 'Meme generator',
224
- sourceId: 'application-uid::card-two',
225
- },
226
- output: 'CardTwo.js',
227
- path: '/some/path/to/app',
228
- extensionPath: '/some/path/to/app/cards',
229
- extensionConfigPath: '/some/path/to/app/cards/card-two-hsmeta.json',
230
- };
231
- export const settingsExtensionConfig = {
232
- uid: 'card-settings',
233
- config: {
234
- // @ts-expect-error The developer does not provide a name for App Settings
235
- name: undefined,
236
- description: 'This is the card for settings',
237
- location: 'settings',
238
- entrypoint: '/app/cards/CardSettings.jsx',
239
- },
240
- componentType: UnifiedComponentTypes.SETTINGS,
241
- componentDeps: {
242
- app: 'application-uid',
243
- },
244
- metaFilePath: 'app/cards/card-settings-hsmeta.json',
245
- files: {},
246
- localDev: {
247
- componentRoot: '/some/path/to/app/cards',
248
- componentConfigPath: '/some/path/to/app/cards/card-settings-hsmeta.json',
249
- },
250
- };
251
- export const settingsExtensionTransformedData = {
252
- type: 'card',
253
- data: {
254
- title: 'Settings',
255
- uid: 'card-settings',
256
- location: 'settings',
257
- module: {
258
- file: '/some/path/to/app/cards/CardSettings.jsx',
259
- },
260
- appName: 'Meme generator',
261
- sourceId: 'application-uid::card-settings',
262
- },
263
- output: 'CardSettings.js',
264
- path: '/some/path/to/app',
265
- extensionPath: '/some/path/to/app/cards',
266
- extensionConfigPath: '/some/path/to/app/cards/card-settings-hsmeta.json',
267
- };
268
- export const appHomesConfig = {
269
- uid: 'app-home-pages',
270
- config: {
271
- // @ts-expect-error The developer does not provide a name for App Homes
272
- name: undefined,
273
- description: 'This is the page for app homes',
274
- location: 'home',
275
- entrypoint: '/app/pages/AppHome.jsx',
276
- },
277
- componentType: UnifiedComponentTypes.PAGE,
278
- componentDeps: {
279
- app: 'application-uid',
280
- },
281
- metaFilePath: 'app/pages/app-home-hsmeta.json',
282
- files: {},
283
- localDev: {
284
- componentRoot: '/some/path/to/app/pages',
285
- componentConfigPath: '/some/path/to/app/pages/app-home-hsmeta.json',
286
- },
287
- };
288
- export const appHomesTransformedData = {
289
- type: 'page',
290
- data: {
291
- title: 'App Home',
292
- uid: 'app-home-pages',
293
- location: 'home',
294
- module: {
295
- file: '/some/path/to/app/pages/AppHome.jsx',
296
- },
297
- appName: 'Meme generator',
298
- sourceId: 'application-uid::app-home-pages',
299
- },
300
- output: 'AppHome.js',
301
- path: '/some/path/to/app',
302
- extensionPath: '/some/path/to/app/pages',
303
- extensionConfigPath: '/some/path/to/app/pages/app-home-hsmeta.json',
304
- };
@@ -1,4 +0,0 @@
1
- export declare const urls: {
2
- api: string;
3
- web: string;
4
- };
@@ -1,4 +0,0 @@
1
- export const urls = {
2
- api: 'https://api.inbound.com',
3
- web: 'https://app.inbound.com',
4
- };
@@ -1 +0,0 @@
1
- export {};