@wix/sdk 1.14.2 → 1.14.4

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.
@@ -32,10 +32,16 @@ export type EventHandlersClient = Emitter<{
32
32
  parseRequest(request: Request): Promise<ProcessedEvent>;
33
33
  executeHandlers(event: ProcessedEvent): Promise<void>;
34
34
  apps: {
35
+ /**
36
+ * @deprecated Use [onAppInstanceInstalled](https://dev.wix.com/docs/sdk/backend-modules/app-management/app-instances/on-app-instance-installed) instead
37
+ */
35
38
  AppInstalled: EventDefinition<{
36
39
  appId: string;
37
40
  originInstanceId: string;
38
41
  }, 'AppInstalled'>;
42
+ /**
43
+ * @deprecated Use [onAppInstanceRemoved](https://dev.wix.com/docs/sdk/backend-modules/app-management/app-instances/on-app-instance-removed) instead
44
+ */
39
45
  AppRemoved: EventDefinition<{
40
46
  appId: string;
41
47
  }, 'AppRemoved'>;
@@ -36,8 +36,16 @@ export function servicePluginsModules(authStrategy) {
36
36
  async processRequest(request) {
37
37
  const url = request.url;
38
38
  const body = await request.text();
39
- const implMethodResult = await this.process({ url, body });
40
- return Response.json(implMethodResult);
39
+ try {
40
+ const implMethodResult = await this.process({ url, body });
41
+ return Response.json(implMethodResult);
42
+ }
43
+ catch (err) {
44
+ if (err.errorType === 'SPI' && err.applicationCode && err.httpCode) {
45
+ return Response.json({ applicationError: { code: err.applicationCode, data: err.data } }, { status: err.httpCode });
46
+ }
47
+ throw err;
48
+ }
41
49
  },
42
50
  async executeHandler(servicePluginRequest, url) {
43
51
  const componentType = servicePluginRequest.metadata.appExtensionType.toLowerCase();
@@ -32,10 +32,16 @@ export type EventHandlersClient = Emitter<{
32
32
  parseRequest(request: Request): Promise<ProcessedEvent>;
33
33
  executeHandlers(event: ProcessedEvent): Promise<void>;
34
34
  apps: {
35
+ /**
36
+ * @deprecated Use [onAppInstanceInstalled](https://dev.wix.com/docs/sdk/backend-modules/app-management/app-instances/on-app-instance-installed) instead
37
+ */
35
38
  AppInstalled: EventDefinition<{
36
39
  appId: string;
37
40
  originInstanceId: string;
38
41
  }, 'AppInstalled'>;
42
+ /**
43
+ * @deprecated Use [onAppInstanceRemoved](https://dev.wix.com/docs/sdk/backend-modules/app-management/app-instances/on-app-instance-removed) instead
44
+ */
39
45
  AppRemoved: EventDefinition<{
40
46
  appId: string;
41
47
  }, 'AppRemoved'>;
@@ -41,8 +41,16 @@ function servicePluginsModules(authStrategy) {
41
41
  async processRequest(request) {
42
42
  const url = request.url;
43
43
  const body = await request.text();
44
- const implMethodResult = await this.process({ url, body });
45
- return Response.json(implMethodResult);
44
+ try {
45
+ const implMethodResult = await this.process({ url, body });
46
+ return Response.json(implMethodResult);
47
+ }
48
+ catch (err) {
49
+ if (err.errorType === 'SPI' && err.applicationCode && err.httpCode) {
50
+ return Response.json({ applicationError: { code: err.applicationCode, data: err.data } }, { status: err.httpCode });
51
+ }
52
+ throw err;
53
+ }
46
54
  },
47
55
  async executeHandler(servicePluginRequest, url) {
48
56
  const componentType = servicePluginRequest.metadata.appExtensionType.toLowerCase();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/sdk",
3
- "version": "1.14.2",
3
+ "version": "1.14.4",
4
4
  "license": "UNLICENSED",
5
5
  "author": {
6
6
  "name": "Ronny Ringel",
@@ -63,33 +63,33 @@
63
63
  "*.{js,ts}": "yarn lint"
64
64
  },
65
65
  "dependencies": {
66
- "@wix/identity": "^1.0.83",
67
- "@wix/image-kit": "^1.92.0",
68
- "@wix/redirects": "^1.0.58",
66
+ "@wix/identity": "^1.0.86",
67
+ "@wix/image-kit": "^1.93.0",
68
+ "@wix/redirects": "^1.0.61",
69
69
  "@wix/sdk-context": "^0.0.1",
70
- "@wix/sdk-runtime": "0.3.22",
70
+ "@wix/sdk-runtime": "0.3.23",
71
71
  "@wix/sdk-types": "^1.12.4",
72
72
  "jose": "^5.9.6",
73
- "type-fest": "^4.26.1"
73
+ "type-fest": "^4.27.0"
74
74
  },
75
75
  "optionalDependencies": {
76
76
  "graphql": "^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0"
77
77
  },
78
78
  "devDependencies": {
79
79
  "@types/is-ci": "^3.0.4",
80
- "@types/node": "^20.17.1",
80
+ "@types/node": "^20.17.6",
81
81
  "@vitest/ui": "^1.6.0",
82
- "@wix/ecom": "^1.0.785",
83
- "@wix/events": "^1.0.322",
84
- "@wix/metro": "^1.0.87",
85
- "@wix/metro-runtime": "^1.1836.0",
86
- "@wix/sdk-runtime": "0.3.22",
82
+ "@wix/ecom": "^1.0.829",
83
+ "@wix/events": "^1.0.338",
84
+ "@wix/metro": "^1.0.89",
85
+ "@wix/metro-runtime": "^1.1854.0",
86
+ "@wix/sdk-runtime": "0.3.23",
87
87
  "eslint": "^8.57.1",
88
88
  "eslint-config-sdk": "0.0.0",
89
89
  "graphql": "^16.8.0",
90
90
  "is-ci": "^3.0.1",
91
91
  "jsdom": "^22.1.0",
92
- "msw": "^2.5.1",
92
+ "msw": "^2.6.5",
93
93
  "typescript": "^5.6.3",
94
94
  "vitest": "^1.6.0",
95
95
  "vitest-teamcity-reporter": "^0.3.1"
@@ -117,5 +117,5 @@
117
117
  "wallaby": {
118
118
  "autoDetect": true
119
119
  },
120
- "falconPackageHash": "013206f49fbedd4b9e408a91fb3ae082db4f1e9d317ccb8cb4a7bc60"
120
+ "falconPackageHash": "94303cb167edda6e2a316a0d1cbbc1262c00a356ac99dd3f186349ed"
121
121
  }