@wix/astro 2.13.1 → 2.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # @wix/astro
2
2
 
3
+ ## 2.14.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#438](https://github.com/wix-incubator/headless-integrations/pull/438) [`4213c9c`](https://github.com/wix-incubator/headless-integrations/commit/4213c9c5600ff0c20ec8e8234b9eb1539c3ba8f9) Thanks [@antonpodolsky](https://github.com/antonpodolsky)! - Use waitUntil when reporting logs to make sure the requests are finished before the worker is terminated
8
+
9
+ ### Patch Changes
10
+
11
+ - [#442](https://github.com/wix-incubator/headless-integrations/pull/442) [`38278ac`](https://github.com/wix-incubator/headless-integrations/commit/38278acd05913ef51961bd3af4135119aef6308d) Thanks [@BrooklynKing](https://github.com/BrooklynKing)! - Changes in config for SiteComponents to have 100% compatibility with proto
12
+
3
13
  ## 2.13.1
4
14
 
5
15
  ### Patch Changes
@@ -1,13 +1,13 @@
1
- import { WixIntegration } from '@wix/astro-core';
2
- import { DevCenterCustomElementBehaviors, DevCenterCustomElementSize, DevCenterCustomElementPresets } from '@wix/dev-center-schemas';
1
+ import { WixIntegration, BaseExtension } from '@wix/astro-core';
2
+ import { DevCenterCustomElementBehaviors, DevCenterCustomElementSize, DevCenterCustomElementPresets, DevCenterSitePluginMarketData, DevCenterSitePluginPlacements } from '@wix/dev-center-schemas';
3
3
 
4
4
  declare const createIntegration: () => WixIntegration;
5
5
 
6
6
  interface CustomElement {
7
7
  type: 'CustomElement';
8
- options: Options;
8
+ options: Options$1;
9
9
  }
10
- interface Options {
10
+ interface Options$1 {
11
11
  id: string;
12
12
  name: string;
13
13
  behaviors?: DevCenterCustomElementBehaviors;
@@ -22,6 +22,24 @@ interface Options {
22
22
  tagName: string;
23
23
  width: DevCenterCustomElementSize['width'];
24
24
  }
25
- declare function customElement(options: Options): CustomElement;
25
+ declare function customElement(options: Options$1): CustomElement;
26
+
27
+ interface SitePlugin extends BaseExtension {
28
+ type: 'SitePlugin';
29
+ options: Options;
30
+ }
31
+ interface Options {
32
+ id: string;
33
+ name: string;
34
+ element: string;
35
+ installation: {
36
+ autoAdd: boolean;
37
+ };
38
+ marketData?: DevCenterSitePluginMarketData;
39
+ placements: DevCenterSitePluginPlacements[];
40
+ settings: string;
41
+ tagName: string;
42
+ }
43
+ declare function sitePlugin(options: Options): SitePlugin;
26
44
 
27
- export { customElement, createIntegration as default };
45
+ export { customElement, createIntegration as default, sitePlugin };
@@ -0,0 +1,5 @@
1
+ import { APIRoute } from 'astro';
2
+
3
+ declare const GET: APIRoute;
4
+
5
+ export { GET };
@@ -0,0 +1,24 @@
1
+ import {
2
+ elevate
3
+ } from "./chunk-656BVIJ3.js";
4
+
5
+ // src/routes/proposal.ts
6
+ import { ok } from "assert";
7
+ import { oAuthApps } from "@wix/auth-management";
8
+ import { WIX_CLIENT_ID } from "astro:env/client";
9
+ var GET = async ({ url }) => {
10
+ const { redirectUrlWixPages } = await elevate(oAuthApps.getOAuthApp)(
11
+ WIX_CLIENT_ID
12
+ );
13
+ ok(redirectUrlWixPages != null);
14
+ const baseUrl = redirectUrlWixPages.endsWith("/") ? redirectUrlWixPages : `${redirectUrlWixPages}/`;
15
+ const newProposalUrl = new URL(url.pathname.replace("/", ""), baseUrl);
16
+ newProposalUrl.search = url.search;
17
+ return new Response(null, {
18
+ headers: { Location: newProposalUrl.toString() },
19
+ status: 302
20
+ });
21
+ };
22
+ export {
23
+ GET
24
+ };
@@ -3,8 +3,9 @@ import { WixIntegration, BaseExtension } from '@wix/astro-core';
3
3
  declare const createIntegration: () => WixIntegration;
4
4
 
5
5
  interface PresetOptions {
6
+ [key: string]: unknown;
6
7
  displayName: string;
7
- source: string;
8
+ presetCssUrl: string;
8
9
  thumbnailUrl?: string;
9
10
  }
10
11
  interface SiteComponent extends BaseExtension {
@@ -22,13 +23,19 @@ interface Options {
22
23
  selector: string;
23
24
  };
24
25
  resources: {
26
+ [key: string]: unknown;
25
27
  client: {
26
- component: string;
28
+ [key: string]: unknown;
29
+ componentUrl: string;
27
30
  };
28
31
  editor?: {
29
- component: string;
32
+ [key: string]: unknown;
33
+ componentUrl: string;
34
+ };
35
+ sdk?: {
36
+ [key: string]: unknown;
37
+ url: string;
30
38
  };
31
- sdk?: string;
32
39
  };
33
40
  }
34
41
  declare function siteComponent(options: Options): SiteComponent;
@@ -29,7 +29,7 @@ interface DevCenterCustomElementSize {
29
29
  };
30
30
  }
31
31
  interface DevCenterSitePluginMarketData {
32
- name: string;
32
+ name?: string;
33
33
  description?: string;
34
34
  logoUrl?: string;
35
35
  }
@@ -90,15 +90,15 @@ declare function ecomGiftCards(options: Options$4$1): EcomGiftCardsProvider;
90
90
 
91
91
  interface EcomPaymentSettings {
92
92
  type: 'EcomPaymentSettings';
93
- options: Options$3$2;
93
+ options: Options$3$1;
94
94
  }
95
- interface Options$3$2 {
95
+ interface Options$3$1 {
96
96
  id: string;
97
97
  name: string;
98
98
  fallbackValueForRequires3dSecure?: boolean;
99
99
  source: string;
100
100
  }
101
- declare function ecomPaymentSettings(options: Options$3$2): EcomPaymentSettings;
101
+ declare function ecomPaymentSettings(options: Options$3$1): EcomPaymentSettings;
102
102
 
103
103
  interface EcomShippingRates {
104
104
  type: 'EcomShippingRates';
@@ -118,15 +118,15 @@ declare function ecomShippingRates(options: Options$2$2): EcomShippingRates;
118
118
 
119
119
  interface EcomValidations {
120
120
  type: 'EcomValidations';
121
- options: Options$1$2;
121
+ options: Options$1$3;
122
122
  }
123
- interface Options$1$2 {
123
+ interface Options$1$3 {
124
124
  id: string;
125
125
  name: string;
126
126
  source: string;
127
127
  validateInCart?: boolean;
128
128
  }
129
- declare function ecomValidations(options: Options$1$2): EcomValidations;
129
+ declare function ecomValidations(options: Options$1$3): EcomValidations;
130
130
 
131
131
  interface Webhook {
132
132
  type: 'Webhook';
@@ -140,9 +140,9 @@ declare function webhook(options: Options$7): Webhook;
140
140
 
141
141
  interface BackofficeExtensionMenuPlugin {
142
142
  type: 'BackofficeExtensionMenuPlugin';
143
- options: Options$3$1;
143
+ options: Options$3;
144
144
  }
145
- interface Options$3$1 {
145
+ interface Options$3 {
146
146
  id: string;
147
147
  action: {
148
148
  navigateToPage: {
@@ -159,7 +159,7 @@ interface Options$3$1 {
159
159
  subtitle?: string;
160
160
  title: string;
161
161
  }
162
- declare function backofficeExtensionMenuPlugin(options: Options$3$1): BackofficeExtensionMenuPlugin;
162
+ declare function backofficeExtensionMenuPlugin(options: Options$3): BackofficeExtensionMenuPlugin;
163
163
 
164
164
  interface BackofficeExtensionWidget {
165
165
  type: 'BackofficeExtensionWidget';
@@ -177,9 +177,9 @@ declare function backofficeExtensionWidget(options: Options$2$1): BackofficeExte
177
177
 
178
178
  interface BackofficeModal {
179
179
  type: 'BackofficeModal';
180
- options: Options$1$1;
180
+ options: Options$1$2;
181
181
  }
182
- interface Options$1$1 {
182
+ interface Options$1$2 {
183
183
  id: string;
184
184
  component: string;
185
185
  height?: number;
@@ -187,7 +187,7 @@ interface Options$1$1 {
187
187
  title: string;
188
188
  width?: number;
189
189
  }
190
- declare function backofficeModal(options: Options$1$1): BackofficeModal;
190
+ declare function backofficeModal(options: Options$1$2): BackofficeModal;
191
191
 
192
192
  interface BackofficePage {
193
193
  type: 'BackofficePage';
@@ -203,9 +203,9 @@ declare function backofficePage(options: Options$4): BackofficePage;
203
203
 
204
204
  interface CustomElement {
205
205
  type: 'CustomElement';
206
- options: Options$3;
206
+ options: Options$1$1;
207
207
  }
208
- interface Options$3 {
208
+ interface Options$1$1 {
209
209
  id: string;
210
210
  name: string;
211
211
  behaviors?: DevCenterCustomElementBehaviors;
@@ -220,20 +220,38 @@ interface Options$3 {
220
220
  tagName: string;
221
221
  width: DevCenterCustomElementSize['width'];
222
222
  }
223
- declare function customElement(options: Options$3): CustomElement;
223
+ declare function customElement(options: Options$1$1): CustomElement;
224
224
 
225
- interface EmbeddedScript extends BaseExtension {
226
- type: 'EmbeddedScript';
225
+ interface SitePlugin extends BaseExtension {
226
+ type: 'SitePlugin';
227
227
  options: Options$2;
228
228
  }
229
229
  interface Options$2 {
230
+ id: string;
231
+ name: string;
232
+ element: string;
233
+ installation: {
234
+ autoAdd: boolean;
235
+ };
236
+ marketData?: DevCenterSitePluginMarketData;
237
+ placements: DevCenterSitePluginPlacements[];
238
+ settings: string;
239
+ tagName: string;
240
+ }
241
+ declare function sitePlugin(options: Options$2): SitePlugin;
242
+
243
+ interface EmbeddedScript extends BaseExtension {
244
+ type: 'EmbeddedScript';
245
+ options: Options$1;
246
+ }
247
+ interface Options$1 {
230
248
  id: string;
231
249
  name: string;
232
250
  placement: 'BODY_END' | 'BODY_START' | 'HEAD';
233
251
  scriptType: 'ADVERTISING' | 'ANALYTICS' | 'ESSENTIAL' | 'FUNCTIONAL';
234
252
  source: string;
235
253
  }
236
- declare function embeddedScript(options: Options$2): EmbeddedScript;
254
+ declare function embeddedScript(options: Options$1): EmbeddedScript;
237
255
 
238
256
  interface SiteComponentPanel extends BaseExtension {
239
257
  type: 'SiteComponentPanel';
@@ -252,15 +270,16 @@ interface PanelOptions {
252
270
  declare function siteComponentPanel(options: PanelOptions): SiteComponentPanel;
253
271
 
254
272
  interface PresetOptions {
273
+ [key: string]: unknown;
255
274
  displayName: string;
256
- source: string;
275
+ presetCssUrl: string;
257
276
  thumbnailUrl?: string;
258
277
  }
259
278
  interface SiteComponent extends BaseExtension {
260
279
  type: 'SiteComponent';
261
- options: Options$1;
280
+ options: Options;
262
281
  }
263
- interface Options$1 {
282
+ interface Options {
264
283
  id: string;
265
284
  type: string;
266
285
  description: string;
@@ -271,32 +290,22 @@ interface Options$1 {
271
290
  selector: string;
272
291
  };
273
292
  resources: {
293
+ [key: string]: unknown;
274
294
  client: {
275
- component: string;
295
+ [key: string]: unknown;
296
+ componentUrl: string;
276
297
  };
277
298
  editor?: {
278
- component: string;
299
+ [key: string]: unknown;
300
+ componentUrl: string;
301
+ };
302
+ sdk?: {
303
+ [key: string]: unknown;
304
+ url: string;
279
305
  };
280
- sdk?: string;
281
- };
282
- }
283
- declare function siteComponent(options: Options$1): SiteComponent;
284
-
285
- interface SitePlugin extends BaseExtension {
286
- type: 'SitePlugin';
287
- options: Options;
288
- }
289
- interface Options {
290
- id: string;
291
- name: string;
292
- installation: {
293
- autoAdd: boolean;
294
306
  };
295
- marketData: DevCenterSitePluginMarketData;
296
- placements: DevCenterSitePluginPlacements[];
297
- referenceComponentId: string;
298
307
  }
299
- declare function sitePlugin(options: Options): SitePlugin;
308
+ declare function siteComponent(options: Options): SiteComponent;
300
309
 
301
310
  declare const extensions: {
302
311
  customElement: typeof customElement;
@@ -20,7 +20,7 @@ import {
20
20
  siteComponentPanel,
21
21
  sitePlugin,
22
22
  webhook
23
- } from "./chunk-XH4FRXRS.js";
23
+ } from "./chunk-IOVROVEX.js";
24
24
 
25
25
  // src/builders.ts
26
26
  init_esm_shims();
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/builders.ts"],"sourcesContent":["import {\n ecomAdditionalFees,\n ecomDiscountTriggers,\n ecomGiftCards,\n ecomPaymentSettings,\n ecomShippingRates,\n ecomValidations,\n webhook as event,\n} from '@wix/astro-backend-extensions';\nimport {\n backofficeExtensionMenuPlugin as dashboardMenuPlugin,\n backofficeModal as dashboardModal,\n backofficePage as dashboardPage,\n backofficeExtensionWidget as dashboardPlugin,\n} from '@wix/astro-backoffice-extensions';\nimport { genericExtension } from '@wix/astro-core';\nimport { customElement } from '@wix/astro-custom-elements-extensions';\nimport { embeddedScript } from '@wix/astro-embedded-scripts-extensions';\nimport { siteComponentPanel } from '@wix/astro-site-component-panels-extensions';\nimport { siteComponent } from '@wix/astro-site-components-extensions';\nimport { sitePlugin } from '@wix/astro-site-plugins-extensions';\n\nexport { app } from '@wix/astro-core';\nexport const extensions = {\n customElement,\n dashboardMenuPlugin,\n dashboardModal,\n dashboardPage,\n dashboardPlugin,\n ecomAdditionalFees,\n ecomDiscountTriggers,\n ecomGiftCards,\n ecomPaymentSettings,\n ecomShippingRates,\n ecomValidations,\n embeddedScript,\n event,\n genericExtension,\n siteComponent,\n siteComponentPanel,\n sitePlugin,\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAuBO,IAAM,aAAa;AAAA,EACxB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;","names":[]}
1
+ {"version":3,"sources":["../../src/builders.ts"],"sourcesContent":["import {\n ecomAdditionalFees,\n ecomDiscountTriggers,\n ecomGiftCards,\n ecomPaymentSettings,\n ecomShippingRates,\n ecomValidations,\n webhook as event,\n} from '@wix/astro-backend-extensions';\nimport {\n backofficeExtensionMenuPlugin as dashboardMenuPlugin,\n backofficeModal as dashboardModal,\n backofficePage as dashboardPage,\n backofficeExtensionWidget as dashboardPlugin,\n} from '@wix/astro-backoffice-extensions';\nimport { genericExtension } from '@wix/astro-core';\nimport {\n customElement,\n sitePlugin,\n} from '@wix/astro-custom-elements-extensions';\nimport { embeddedScript } from '@wix/astro-embedded-scripts-extensions';\nimport { siteComponentPanel } from '@wix/astro-site-component-panels-extensions';\nimport { siteComponent } from '@wix/astro-site-components-extensions';\n\nexport { app } from '@wix/astro-core';\nexport const extensions = {\n customElement,\n dashboardMenuPlugin,\n dashboardModal,\n dashboardPage,\n dashboardPlugin,\n ecomAdditionalFees,\n ecomDiscountTriggers,\n ecomGiftCards,\n ecomPaymentSettings,\n ecomShippingRates,\n ecomValidations,\n embeddedScript,\n event,\n genericExtension,\n siteComponent,\n siteComponentPanel,\n sitePlugin,\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAyBO,IAAM,aAAa;AAAA,EACxB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;","names":[]}