@wix/workspace 1.3.14 → 1.3.16
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/dist/cjs/namespaces/tools/tools.js +1 -5
- package/dist/cjs/namespaces/tools/tools.js.map +1 -1
- package/dist/cjs/namespaces/tools/types.js.map +1 -1
- package/dist/esm/namespaces/tools/tools.js +1 -5
- package/dist/esm/namespaces/tools/tools.js.map +1 -1
- package/dist/esm/namespaces/tools/types.js.map +1 -1
- package/dist/types/namespaces/tools/tools.d.ts.map +1 -1
- package/dist/types/namespaces/tools/types.d.ts +3 -3
- package/dist/types/namespaces/tools/types.d.ts.map +1 -1
- package/package.json +6 -6
|
@@ -11,11 +11,7 @@ function createToolsMethod(methodName) {
|
|
|
11
11
|
if (!host.workspace.tools) {
|
|
12
12
|
throw new Error('tools is not available on the current host. Make sure to use an updated version of the host initialization package.');
|
|
13
13
|
}
|
|
14
|
-
|
|
15
|
-
if (!method) {
|
|
16
|
-
throw new Error(`${String(methodName)} is not available on the current host. Make sure to use an updated version of the host initialization package.`);
|
|
17
|
-
}
|
|
18
|
-
return method;
|
|
14
|
+
return host.workspace.tools[methodName];
|
|
19
15
|
};
|
|
20
16
|
}
|
|
21
17
|
const _tools = (0, _hostModules.createHostModule)({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_hostModules","require","createToolsMethod","methodName","host","workspace","Error","tools","
|
|
1
|
+
{"version":3,"names":["_hostModules","require","createToolsMethod","methodName","host","workspace","Error","tools","_tools","createHostModule","editWithWixel","startInstallFlow","exploreTools","exports"],"sources":["../../../../src/namespaces/tools/tools.ts"],"sourcesContent":["import { createHostModule } from '@wix/sdk-runtime/host-modules';\nimport type { ExposeFieldsBasedOnToggle } from '@wix/sdk-types';\n\nimport { WorkspaceHost } from '../../types.js';\nimport type { ToolsNamespace } from './types.js';\n\nfunction createToolsMethod<K extends keyof ToolsNamespace>(\n methodName: K,\n): (host: WorkspaceHost) => ToolsNamespace[K] {\n return (host) => {\n if (!host.workspace) {\n throw new Error(\n 'workspace is not available on the current host. Make sure to use an updated version of the host initialization package.',\n );\n }\n\n if (!host.workspace.tools) {\n throw new Error(\n 'tools is not available on the current host. Make sure to use an updated version of the host initialization package.',\n );\n }\n\n return host.workspace.tools[methodName] as ToolsNamespace[K];\n };\n}\n\nconst _tools = createHostModule<WorkspaceHost, ToolsNamespace>({\n editWithWixel: createToolsMethod('editWithWixel'),\n startInstallFlow: createToolsMethod('startInstallFlow'),\n exploreTools: createToolsMethod('exploreTools'),\n});\n\nexport const tools: ExposeFieldsBasedOnToggle<\n typeof _tools,\n { editWithWixel: 'alpha'; startInstallFlow: 'alpha'; exploreTools: 'alpha' }\n> = _tools;\n"],"mappings":";;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAMA,SAASC,iBAAiBA,CACxBC,UAAa,EAC+B;EAC5C,OAAQC,IAAI,IAAK;IACf,IAAI,CAACA,IAAI,CAACC,SAAS,EAAE;MACnB,MAAM,IAAIC,KAAK,CACb,yHACF,CAAC;IACH;IAEA,IAAI,CAACF,IAAI,CAACC,SAAS,CAACE,KAAK,EAAE;MACzB,MAAM,IAAID,KAAK,CACb,qHACF,CAAC;IACH;IAEA,OAAOF,IAAI,CAACC,SAAS,CAACE,KAAK,CAACJ,UAAU,CAAC;EACzC,CAAC;AACH;AAEA,MAAMK,MAAM,GAAG,IAAAC,6BAAgB,EAAgC;EAC7DC,aAAa,EAAER,iBAAiB,CAAC,eAAe,CAAC;EACjDS,gBAAgB,EAAET,iBAAiB,CAAC,kBAAkB,CAAC;EACvDU,YAAY,EAAEV,iBAAiB,CAAC,cAAc;AAChD,CAAC,CAAC;AAEK,MAAMK,KAGZ,GAAAM,OAAA,CAAAN,KAAA,GAAGC,MAAM","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["../../../../src/namespaces/tools/types.ts"],"sourcesContent":["export type EditWithWixelRequest = {\n fileId: string;\n externalId: string;\n};\n\nexport type EditWithWixelResponse = {\n status: 'DISPATCHED';\n};\n\ntype ToolsFlowStatus = 'SUCCESS' | 'CANCELED';\n\nexport type StartInstallFlowRequest = {\n toolId: string;\n};\n\nexport type StartInstallFlowResponse = {\n status: ToolsFlowStatus;\n installedTools: { toolId: string }[];\n};\n\nexport type Keywords =\n | 'marketing'\n | 'customers'\n | 'payment'\n | 'promotions'\n | 'analytics'\n | 'logo'\n | 'development';\n\nexport type ExploreToolsFilter = {\n keyword: Keywords;\n};\n\nexport type ExploreToolsResponse = {\n status: ToolsFlowStatus;\n installedTools: { toolId: string }[];\n};\n\nexport type ToolsNamespace = {\n editWithWixel
|
|
1
|
+
{"version":3,"names":[],"sources":["../../../../src/namespaces/tools/types.ts"],"sourcesContent":["export type EditWithWixelRequest = {\n fileId: string;\n externalId: string;\n};\n\nexport type EditWithWixelResponse = {\n status: 'DISPATCHED';\n};\n\ntype ToolsFlowStatus = 'SUCCESS' | 'CANCELED';\n\nexport type StartInstallFlowRequest = {\n toolId: string;\n};\n\nexport type StartInstallFlowResponse = {\n status: ToolsFlowStatus;\n installedTools: { toolId: string }[];\n};\n\nexport type Keywords =\n | 'marketing'\n | 'customers'\n | 'payment'\n | 'promotions'\n | 'analytics'\n | 'logo'\n | 'development';\n\nexport type ExploreToolsFilter = {\n keyword: Keywords;\n};\n\nexport type ExploreToolsResponse = {\n status: ToolsFlowStatus;\n installedTools: { toolId: string }[];\n};\n\nexport type ToolsNamespace = {\n editWithWixel?: (\n args: EditWithWixelRequest,\n ) => Promise<EditWithWixelResponse>;\n startInstallFlow?: (\n args: StartInstallFlowRequest,\n ) => Promise<StartInstallFlowResponse>;\n exploreTools?: (\n filter?: ExploreToolsFilter,\n ) => Promise<ExploreToolsResponse>;\n};\n"],"mappings":"","ignoreList":[]}
|
|
@@ -7,11 +7,7 @@ function createToolsMethod(methodName) {
|
|
|
7
7
|
if (!host.workspace.tools) {
|
|
8
8
|
throw new Error('tools is not available on the current host. Make sure to use an updated version of the host initialization package.');
|
|
9
9
|
}
|
|
10
|
-
|
|
11
|
-
if (!method) {
|
|
12
|
-
throw new Error(`${String(methodName)} is not available on the current host. Make sure to use an updated version of the host initialization package.`);
|
|
13
|
-
}
|
|
14
|
-
return method;
|
|
10
|
+
return host.workspace.tools[methodName];
|
|
15
11
|
};
|
|
16
12
|
}
|
|
17
13
|
const _tools = createHostModule({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["createHostModule","createToolsMethod","methodName","host","workspace","Error","tools","
|
|
1
|
+
{"version":3,"names":["createHostModule","createToolsMethod","methodName","host","workspace","Error","tools","_tools","editWithWixel","startInstallFlow","exploreTools"],"sources":["../../../../src/namespaces/tools/tools.ts"],"sourcesContent":["import { createHostModule } from '@wix/sdk-runtime/host-modules';\nimport type { ExposeFieldsBasedOnToggle } from '@wix/sdk-types';\n\nimport { WorkspaceHost } from '../../types.js';\nimport type { ToolsNamespace } from './types.js';\n\nfunction createToolsMethod<K extends keyof ToolsNamespace>(\n methodName: K,\n): (host: WorkspaceHost) => ToolsNamespace[K] {\n return (host) => {\n if (!host.workspace) {\n throw new Error(\n 'workspace is not available on the current host. Make sure to use an updated version of the host initialization package.',\n );\n }\n\n if (!host.workspace.tools) {\n throw new Error(\n 'tools is not available on the current host. Make sure to use an updated version of the host initialization package.',\n );\n }\n\n return host.workspace.tools[methodName] as ToolsNamespace[K];\n };\n}\n\nconst _tools = createHostModule<WorkspaceHost, ToolsNamespace>({\n editWithWixel: createToolsMethod('editWithWixel'),\n startInstallFlow: createToolsMethod('startInstallFlow'),\n exploreTools: createToolsMethod('exploreTools'),\n});\n\nexport const tools: ExposeFieldsBasedOnToggle<\n typeof _tools,\n { editWithWixel: 'alpha'; startInstallFlow: 'alpha'; exploreTools: 'alpha' }\n> = _tools;\n"],"mappings":"AAAA,SAASA,gBAAgB,QAAQ,+BAA+B;AAMhE,SAASC,iBAAiBA,CACxBC,UAAa,EAC+B;EAC5C,OAAQC,IAAI,IAAK;IACf,IAAI,CAACA,IAAI,CAACC,SAAS,EAAE;MACnB,MAAM,IAAIC,KAAK,CACb,yHACF,CAAC;IACH;IAEA,IAAI,CAACF,IAAI,CAACC,SAAS,CAACE,KAAK,EAAE;MACzB,MAAM,IAAID,KAAK,CACb,qHACF,CAAC;IACH;IAEA,OAAOF,IAAI,CAACC,SAAS,CAACE,KAAK,CAACJ,UAAU,CAAC;EACzC,CAAC;AACH;AAEA,MAAMK,MAAM,GAAGP,gBAAgB,CAAgC;EAC7DQ,aAAa,EAAEP,iBAAiB,CAAC,eAAe,CAAC;EACjDQ,gBAAgB,EAAER,iBAAiB,CAAC,kBAAkB,CAAC;EACvDS,YAAY,EAAET,iBAAiB,CAAC,cAAc;AAChD,CAAC,CAAC;AAEF,OAAO,MAAMK,KAGZ,GAAGC,MAAM","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["../../../../src/namespaces/tools/types.ts"],"sourcesContent":["export type EditWithWixelRequest = {\n fileId: string;\n externalId: string;\n};\n\nexport type EditWithWixelResponse = {\n status: 'DISPATCHED';\n};\n\ntype ToolsFlowStatus = 'SUCCESS' | 'CANCELED';\n\nexport type StartInstallFlowRequest = {\n toolId: string;\n};\n\nexport type StartInstallFlowResponse = {\n status: ToolsFlowStatus;\n installedTools: { toolId: string }[];\n};\n\nexport type Keywords =\n | 'marketing'\n | 'customers'\n | 'payment'\n | 'promotions'\n | 'analytics'\n | 'logo'\n | 'development';\n\nexport type ExploreToolsFilter = {\n keyword: Keywords;\n};\n\nexport type ExploreToolsResponse = {\n status: ToolsFlowStatus;\n installedTools: { toolId: string }[];\n};\n\nexport type ToolsNamespace = {\n editWithWixel
|
|
1
|
+
{"version":3,"names":[],"sources":["../../../../src/namespaces/tools/types.ts"],"sourcesContent":["export type EditWithWixelRequest = {\n fileId: string;\n externalId: string;\n};\n\nexport type EditWithWixelResponse = {\n status: 'DISPATCHED';\n};\n\ntype ToolsFlowStatus = 'SUCCESS' | 'CANCELED';\n\nexport type StartInstallFlowRequest = {\n toolId: string;\n};\n\nexport type StartInstallFlowResponse = {\n status: ToolsFlowStatus;\n installedTools: { toolId: string }[];\n};\n\nexport type Keywords =\n | 'marketing'\n | 'customers'\n | 'payment'\n | 'promotions'\n | 'analytics'\n | 'logo'\n | 'development';\n\nexport type ExploreToolsFilter = {\n keyword: Keywords;\n};\n\nexport type ExploreToolsResponse = {\n status: ToolsFlowStatus;\n installedTools: { toolId: string }[];\n};\n\nexport type ToolsNamespace = {\n editWithWixel?: (\n args: EditWithWixelRequest,\n ) => Promise<EditWithWixelResponse>;\n startInstallFlow?: (\n args: StartInstallFlowRequest,\n ) => Promise<StartInstallFlowResponse>;\n exploreTools?: (\n filter?: ExploreToolsFilter,\n ) => Promise<ExploreToolsResponse>;\n};\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../../../src/namespaces/tools/tools.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,gBAAgB,CAAC;AAEhE,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../../../src/namespaces/tools/tools.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,gBAAgB,CAAC;AAEhE,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAsBjD,QAAA,MAAM,MAAM,qFAIV,CAAC;AAEH,eAAO,MAAM,KAAK,EAAE,yBAAyB,CAC3C,OAAO,MAAM,EACb;IAAE,aAAa,EAAE,OAAO,CAAC;IAAC,gBAAgB,EAAE,OAAO,CAAC;IAAC,YAAY,EAAE,OAAO,CAAA;CAAE,CACpE,CAAC"}
|
|
@@ -26,9 +26,9 @@ export declare type ExploreToolsResponse = {
|
|
|
26
26
|
}[];
|
|
27
27
|
};
|
|
28
28
|
export declare type ToolsNamespace = {
|
|
29
|
-
editWithWixel
|
|
30
|
-
startInstallFlow
|
|
31
|
-
exploreTools
|
|
29
|
+
editWithWixel?: (args: EditWithWixelRequest) => Promise<EditWithWixelResponse>;
|
|
30
|
+
startInstallFlow?: (args: StartInstallFlowRequest) => Promise<StartInstallFlowResponse>;
|
|
31
|
+
exploreTools?: (filter?: ExploreToolsFilter) => Promise<ExploreToolsResponse>;
|
|
32
32
|
};
|
|
33
33
|
export {};
|
|
34
34
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/namespaces/tools/types.ts"],"names":[],"mappings":"AAAA,oBAAY,oBAAoB,GAAG;IACjC,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,oBAAY,qBAAqB,GAAG;IAClC,MAAM,EAAE,YAAY,CAAC;CACtB,CAAC;AAEF,aAAK,eAAe,GAAG,SAAS,GAAG,UAAU,CAAC;AAE9C,oBAAY,uBAAuB,GAAG;IACpC,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,oBAAY,wBAAwB,GAAG;IACrC,MAAM,EAAE,eAAe,CAAC;IACxB,cAAc,EAAE;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;CACtC,CAAC;AAEF,oBAAY,QAAQ,GAChB,WAAW,GACX,WAAW,GACX,SAAS,GACT,YAAY,GACZ,WAAW,GACX,MAAM,GACN,aAAa,CAAC;AAElB,oBAAY,kBAAkB,GAAG;IAC/B,OAAO,EAAE,QAAQ,CAAC;CACnB,CAAC;AAEF,oBAAY,oBAAoB,GAAG;IACjC,MAAM,EAAE,eAAe,CAA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AoB,CAAC,CAAC;CACpC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wix/workspace",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.16",
|
|
4
4
|
"license": "UNLICENSED",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Aviv Maimon",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"@babel/runtime": "^7.0.0",
|
|
33
33
|
"@wix/credits-types": "^1.0.2",
|
|
34
|
-
"@wix/sdk-runtime": "^1.0.
|
|
34
|
+
"@wix/sdk-runtime": "^1.0.17",
|
|
35
35
|
"@wix/sdk-types": "^1.17.9"
|
|
36
36
|
},
|
|
37
37
|
"peerDependencies": {
|
|
@@ -40,10 +40,10 @@
|
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"@types/jest": "^27.4.0",
|
|
42
42
|
"@types/node": "^16.0.0",
|
|
43
|
-
"@wix/eslint-config-yoshi": "^6.
|
|
44
|
-
"@wix/jest-yoshi-preset": "^6.
|
|
43
|
+
"@wix/eslint-config-yoshi": "^6.190.0",
|
|
44
|
+
"@wix/jest-yoshi-preset": "^6.190.0",
|
|
45
45
|
"@wix/sdk": "^1.21.13",
|
|
46
|
-
"@wix/yoshi-flow-library": "^6.
|
|
46
|
+
"@wix/yoshi-flow-library": "^6.190.0",
|
|
47
47
|
"ts-jest": "^27.1.2",
|
|
48
48
|
"typescript": "~4.7.0",
|
|
49
49
|
"vitest": "^3.2.4"
|
|
@@ -74,5 +74,5 @@
|
|
|
74
74
|
"wallaby": {
|
|
75
75
|
"autoDetect": true
|
|
76
76
|
},
|
|
77
|
-
"falconPackageHash": "
|
|
77
|
+
"falconPackageHash": "86a78b270496f333cddba909fcac858f2ed50b1a8aef96342601156e"
|
|
78
78
|
}
|