@wix/workspace 1.1.0 → 1.3.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 (39) hide show
  1. package/dist/cjs/index.js +11 -0
  2. package/dist/cjs/index.js.map +1 -1
  3. package/dist/cjs/namespaces/apps/apps.js +27 -0
  4. package/dist/cjs/namespaces/apps/apps.js.map +1 -0
  5. package/dist/cjs/namespaces/apps/index.js +16 -0
  6. package/dist/cjs/namespaces/apps/index.js.map +1 -0
  7. package/dist/cjs/namespaces/{apps.js → apps/types.js} +1 -1
  8. package/dist/cjs/namespaces/apps/types.js.map +1 -0
  9. package/dist/cjs/namespaces/index.js +10 -0
  10. package/dist/cjs/namespaces/index.js.map +1 -0
  11. package/dist/cjs/types.js.map +1 -1
  12. package/dist/esm/index.js +1 -0
  13. package/dist/esm/index.js.map +1 -1
  14. package/dist/esm/namespaces/apps/apps.js +23 -0
  15. package/dist/esm/namespaces/apps/apps.js.map +1 -0
  16. package/dist/esm/namespaces/apps/index.js +3 -0
  17. package/dist/esm/namespaces/apps/index.js.map +1 -0
  18. package/dist/esm/namespaces/apps/types.js +2 -0
  19. package/dist/esm/namespaces/apps/types.js.map +1 -0
  20. package/dist/esm/namespaces/index.js +2 -0
  21. package/dist/esm/namespaces/index.js.map +1 -0
  22. package/dist/esm/types.js.map +1 -1
  23. package/dist/types/index.d.ts +1 -0
  24. package/dist/types/index.d.ts.map +1 -1
  25. package/dist/types/namespaces/apps/apps.d.ts +4 -0
  26. package/dist/types/namespaces/apps/apps.d.ts.map +1 -0
  27. package/dist/types/namespaces/apps/index.d.ts +3 -0
  28. package/dist/types/namespaces/apps/index.d.ts.map +1 -0
  29. package/dist/types/namespaces/{apps.d.ts → apps/types.d.ts} +7 -7
  30. package/dist/types/namespaces/apps/types.d.ts.map +1 -0
  31. package/dist/types/namespaces/index.d.ts +2 -0
  32. package/dist/types/namespaces/index.d.ts.map +1 -0
  33. package/dist/types/types.d.ts +1 -1
  34. package/dist/types/types.d.ts.map +1 -1
  35. package/package.json +2 -2
  36. package/dist/cjs/namespaces/apps.js.map +0 -1
  37. package/dist/esm/namespaces/apps.js +0 -2
  38. package/dist/esm/namespaces/apps.js.map +0 -1
  39. package/dist/types/namespaces/apps.d.ts.map +0 -1
package/dist/cjs/index.js CHANGED
@@ -1,9 +1,20 @@
1
1
  "use strict";
2
2
 
3
3
  exports.__esModule = true;
4
+ var _exportNames = {
5
+ itemSelector: true,
6
+ legacy: true
7
+ };
4
8
  exports.legacy = exports.itemSelector = void 0;
5
9
  var _legacy2 = require("./legacy.js");
6
10
  var _itemSelector2 = require("./items-selection/itemSelector.js");
11
+ var _namespaces = require("./namespaces");
12
+ Object.keys(_namespaces).forEach(function (key) {
13
+ if (key === "default" || key === "__esModule") return;
14
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
15
+ if (key in exports && exports[key] === _namespaces[key]) return;
16
+ exports[key] = _namespaces[key];
17
+ });
7
18
  const itemSelector = exports.itemSelector = _itemSelector2.itemSelector;
8
19
  const legacy = exports.legacy = _legacy2.legacy;
9
20
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_legacy2","require","_itemSelector2","itemSelector","exports","_itemSelector","legacy","_legacy"],"sources":["../../src/index.ts"],"sourcesContent":["import { legacy as _legacy } from './legacy.js';\nimport { itemSelector as _itemSelector } from './items-selection/itemSelector.js';\nimport type { ExposeFieldsBasedOnToggle } from '@wix/sdk-types';\n\nexport const itemSelector = _itemSelector;\n\nexport const legacy: ExposeFieldsBasedOnToggle<\n typeof _legacy,\n { getContextIds: 'alpha' }\n> = _legacy;\n\nexport type { WorkspaceHost } from './types.js';\n\nexport type {\n ItemSelection,\n ItemSelectionOptions,\n ItemSelectionResult,\n Item,\n} from './items-selection/types.js';\n"],"mappings":";;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,cAAA,GAAAD,OAAA;AAGO,MAAME,YAAY,GAAAC,OAAA,CAAAD,YAAA,GAAGE,2BAAa;AAElC,MAAMC,MAGZ,GAAAF,OAAA,CAAAE,MAAA,GAAGC,eAAO","ignoreList":[]}
1
+ {"version":3,"names":["_legacy2","require","_itemSelector2","_namespaces","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","itemSelector","_itemSelector","legacy","_legacy"],"sources":["../../src/index.ts"],"sourcesContent":["import { legacy as _legacy } from './legacy.js';\nimport { itemSelector as _itemSelector } from './items-selection/itemSelector.js';\nimport type { ExposeFieldsBasedOnToggle } from '@wix/sdk-types';\n\nexport const itemSelector = _itemSelector;\n\nexport const legacy: ExposeFieldsBasedOnToggle<\n typeof _legacy,\n { getContextIds: 'alpha' }\n> = _legacy;\n\nexport type { WorkspaceHost } from './types.js';\n\nexport * from './namespaces';\n\nexport type {\n ItemSelection,\n ItemSelectionOptions,\n ItemSelectionResult,\n Item,\n} from './items-selection/types.js';\n"],"mappings":";;;;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,cAAA,GAAAD,OAAA;AAYA,IAAAE,WAAA,GAAAF,OAAA;AAAAG,MAAA,CAAAC,IAAA,CAAAF,WAAA,EAAAG,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAJ,WAAA,CAAAI,GAAA;EAAAK,OAAA,CAAAL,GAAA,IAAAJ,WAAA,CAAAI,GAAA;AAAA;AATO,MAAMM,YAAY,GAAAD,OAAA,CAAAC,YAAA,GAAGC,2BAAa;AAElC,MAAMC,MAGZ,GAAAH,OAAA,CAAAG,MAAA,GAAGC,eAAO","ignoreList":[]}
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+
3
+ exports.__esModule = true;
4
+ exports.apps = void 0;
5
+ var _hostModules = require("@wix/sdk-runtime/host-modules");
6
+ function createAppsMethod(methodName) {
7
+ return host => {
8
+ if (!host.workspace) {
9
+ throw new Error('workspace is not available on the current host. Make sure to use an updated version of the host initialization package.');
10
+ }
11
+ if (!host.workspace.apps) {
12
+ throw new Error('apps is not available on the current host. Make sure to use an updated version of the host initialization package.');
13
+ }
14
+ const method = host.workspace.apps[methodName];
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;
19
+ };
20
+ }
21
+ const apps = exports.apps = (0, _hostModules.createHostModule)({
22
+ startInstallFlow: createAppsMethod('startInstallFlow'),
23
+ startPurchasePlanFlow: createAppsMethod('startPurchasePlanFlow'),
24
+ startUpdateFlow: createAppsMethod('startUpdateFlow'),
25
+ openContactSupport: createAppsMethod('openContactSupport')
26
+ });
27
+ //# sourceMappingURL=apps.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_hostModules","require","createAppsMethod","methodName","host","workspace","Error","apps","method","String","exports","createHostModule","startInstallFlow","startPurchasePlanFlow","startUpdateFlow","openContactSupport"],"sources":["../../../../src/namespaces/apps/apps.ts"],"sourcesContent":["import { createHostModule } from '@wix/sdk-runtime/host-modules';\nimport { WorkspaceHost } from '../../types.js';\nimport type { AppsNamespace } from './types.js';\n\nfunction createAppsMethod<K extends keyof AppsNamespace>(\n methodName: K,\n): (host: WorkspaceHost) => AppsNamespace[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.apps) {\n throw new Error(\n 'apps is not available on the current host. Make sure to use an updated version of the host initialization package.',\n );\n }\n\n const method = host.workspace.apps[methodName];\n if (!method) {\n throw new Error(\n `${String(\n methodName,\n )} is not available on the current host. Make sure to use an updated version of the host initialization package.`,\n );\n }\n\n return method as AppsNamespace[K];\n };\n}\n\nexport const apps = createHostModule<WorkspaceHost, AppsNamespace>({\n startInstallFlow: createAppsMethod('startInstallFlow'),\n startPurchasePlanFlow: createAppsMethod('startPurchasePlanFlow'),\n startUpdateFlow: createAppsMethod('startUpdateFlow'),\n openContactSupport: createAppsMethod('openContactSupport'),\n});\n"],"mappings":";;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAIA,SAASC,gBAAgBA,CACvBC,UAAa,EAC8B;EAC3C,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,IAAI,EAAE;MACxB,MAAM,IAAID,KAAK,CACb,oHACF,CAAC;IACH;IAEA,MAAME,MAAM,GAAGJ,IAAI,CAACC,SAAS,CAACE,IAAI,CAACJ,UAAU,CAAC;IAC9C,IAAI,CAACK,MAAM,EAAE;MACX,MAAM,IAAIF,KAAK,CACb,GAAGG,MAAM,CACPN,UACF,CAAC,gHACH,CAAC;IACH;IAEA,OAAOK,MAAM;EACf,CAAC;AACH;AAEO,MAAMD,IAAI,GAAAG,OAAA,CAAAH,IAAA,GAAG,IAAAI,6BAAgB,EAA+B;EACjEC,gBAAgB,EAAEV,gBAAgB,CAAC,kBAAkB,CAAC;EACtDW,qBAAqB,EAAEX,gBAAgB,CAAC,uBAAuB,CAAC;EAChEY,eAAe,EAAEZ,gBAAgB,CAAC,iBAAiB,CAAC;EACpDa,kBAAkB,EAAEb,gBAAgB,CAAC,oBAAoB;AAC3D,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+
3
+ exports.__esModule = true;
4
+ var _apps = require("./apps.js");
5
+ Object.keys(_apps).forEach(function (key) {
6
+ if (key === "default" || key === "__esModule") return;
7
+ if (key in exports && exports[key] === _apps[key]) return;
8
+ exports[key] = _apps[key];
9
+ });
10
+ var _types = require("./types.js");
11
+ Object.keys(_types).forEach(function (key) {
12
+ if (key === "default" || key === "__esModule") return;
13
+ if (key in exports && exports[key] === _types[key]) return;
14
+ exports[key] = _types[key];
15
+ });
16
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_apps","require","Object","keys","forEach","key","exports","_types"],"sources":["../../../../src/namespaces/apps/index.ts"],"sourcesContent":["export * from './apps.js';\nexport * from './types.js';\n"],"mappings":";;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,KAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,KAAA,CAAAK,GAAA;EAAAC,OAAA,CAAAD,GAAA,IAAAL,KAAA,CAAAK,GAAA;AAAA;AACA,IAAAE,MAAA,GAAAN,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAI,MAAA,EAAAH,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAE,MAAA,CAAAF,GAAA;EAAAC,OAAA,CAAAD,GAAA,IAAAE,MAAA,CAAAF,GAAA;AAAA","ignoreList":[]}
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
 
3
3
  exports.__esModule = true;
4
- //# sourceMappingURL=apps.js.map
4
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sources":["../../../../src/namespaces/apps/types.ts"],"sourcesContent":["type ResponseStatus = 'SUCCESS' | 'CANCELED';\n\nexport type InstallFlowRequest = {\n appId: string;\n enablePostInstallNavigation?: boolean;\n};\n\nexport type InstallFlowResponse = {\n status: ResponseStatus;\n installedApps: {\n appId: string;\n version: string;\n }[];\n};\n\nexport type PurchasePlanFlowRequest = {\n appId: string;\n};\n\nexport type PurchasePlanFlowResponse = {\n appId: string;\n status: 'DISPATCHED' | 'NOT_INSTALLED';\n};\n\nexport type UpdateFlowRequest = {\n appId: string;\n};\n\nexport type UpdateFlowResponse = {\n status: ResponseStatus;\n installedApps: {\n appId: string;\n version: string;\n }[];\n};\n\nexport type ContactSupportRequest = {\n appId: string;\n};\n\nexport type ContactSupportResponse = {\n status: 'DISPATCHED' | 'CANCELED';\n};\n\nexport type AppsNamespace = {\n startInstallFlow: (args: InstallFlowRequest) => Promise<InstallFlowResponse>;\n startPurchasePlanFlow: (\n args: PurchasePlanFlowRequest,\n ) => Promise<PurchasePlanFlowResponse>;\n startUpdateFlow: (args: UpdateFlowRequest) => Promise<UpdateFlowResponse>;\n openContactSupport: (\n args: ContactSupportRequest,\n ) => Promise<ContactSupportResponse>;\n};\n"],"mappings":"","ignoreList":[]}
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+
3
+ exports.__esModule = true;
4
+ var _apps = require("./apps");
5
+ Object.keys(_apps).forEach(function (key) {
6
+ if (key === "default" || key === "__esModule") return;
7
+ if (key in exports && exports[key] === _apps[key]) return;
8
+ exports[key] = _apps[key];
9
+ });
10
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_apps","require","Object","keys","forEach","key","exports"],"sources":["../../../src/namespaces/index.ts"],"sourcesContent":["export * from './apps';\n"],"mappings":";;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,KAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,KAAA,CAAAK,GAAA;EAAAC,OAAA,CAAAD,GAAA,IAAAL,KAAA,CAAAK,GAAA;AAAA","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["../../src/types.ts"],"sourcesContent":["import type { Host } from '@wix/sdk-types';\n\nimport type { AppsNamespace } from './namespaces/apps';\n\ntype ContextIds = {\n accountId: string;\n userId: string;\n siteId?: string;\n appId?: string;\n};\n\nexport type WorkspaceHost = Host & {\n workspace?: {\n getContextIds?: () => ContextIds;\n openItemSelector?: (...args: any[]) => any;\n apps: AppsNamespace;\n };\n};\n\nexport type InternalSDK = {\n getContextIds?: () => ContextIds;\n};\n\nexport type ItemSelectorSDK = {\n openItemSelector?: (...args: any[]) => any;\n};\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"names":[],"sources":["../../src/types.ts"],"sourcesContent":["import type { Host } from '@wix/sdk-types';\n\nimport type { AppsNamespace } from './namespaces/apps/types';\n\ntype ContextIds = {\n accountId: string;\n userId: string;\n siteId?: string;\n appId?: string;\n};\n\nexport type WorkspaceHost = Host & {\n workspace?: {\n getContextIds?: () => ContextIds;\n openItemSelector?: (...args: any[]) => any;\n apps: AppsNamespace;\n };\n};\n\nexport type InternalSDK = {\n getContextIds?: () => ContextIds;\n};\n\nexport type ItemSelectorSDK = {\n openItemSelector?: (...args: any[]) => any;\n};\n"],"mappings":"","ignoreList":[]}
package/dist/esm/index.js CHANGED
@@ -2,4 +2,5 @@ import { legacy as _legacy } from './legacy.js';
2
2
  import { itemSelector as _itemSelector } from './items-selection/itemSelector.js';
3
3
  export const itemSelector = _itemSelector;
4
4
  export const legacy = _legacy;
5
+ export * from './namespaces';
5
6
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["legacy","_legacy","itemSelector","_itemSelector"],"sources":["../../src/index.ts"],"sourcesContent":["import { legacy as _legacy } from './legacy.js';\nimport { itemSelector as _itemSelector } from './items-selection/itemSelector.js';\nimport type { ExposeFieldsBasedOnToggle } from '@wix/sdk-types';\n\nexport const itemSelector = _itemSelector;\n\nexport const legacy: ExposeFieldsBasedOnToggle<\n typeof _legacy,\n { getContextIds: 'alpha' }\n> = _legacy;\n\nexport type { WorkspaceHost } from './types.js';\n\nexport type {\n ItemSelection,\n ItemSelectionOptions,\n ItemSelectionResult,\n Item,\n} from './items-selection/types.js';\n"],"mappings":"AAAA,SAASA,MAAM,IAAIC,OAAO,QAAQ,aAAa;AAC/C,SAASC,YAAY,IAAIC,aAAa,QAAQ,mCAAmC;AAGjF,OAAO,MAAMD,YAAY,GAAGC,aAAa;AAEzC,OAAO,MAAMH,MAGZ,GAAGC,OAAO","ignoreList":[]}
1
+ {"version":3,"names":["legacy","_legacy","itemSelector","_itemSelector"],"sources":["../../src/index.ts"],"sourcesContent":["import { legacy as _legacy } from './legacy.js';\nimport { itemSelector as _itemSelector } from './items-selection/itemSelector.js';\nimport type { ExposeFieldsBasedOnToggle } from '@wix/sdk-types';\n\nexport const itemSelector = _itemSelector;\n\nexport const legacy: ExposeFieldsBasedOnToggle<\n typeof _legacy,\n { getContextIds: 'alpha' }\n> = _legacy;\n\nexport type { WorkspaceHost } from './types.js';\n\nexport * from './namespaces';\n\nexport type {\n ItemSelection,\n ItemSelectionOptions,\n ItemSelectionResult,\n Item,\n} from './items-selection/types.js';\n"],"mappings":"AAAA,SAASA,MAAM,IAAIC,OAAO,QAAQ,aAAa;AAC/C,SAASC,YAAY,IAAIC,aAAa,QAAQ,mCAAmC;AAGjF,OAAO,MAAMD,YAAY,GAAGC,aAAa;AAEzC,OAAO,MAAMH,MAGZ,GAAGC,OAAO;AAIX,cAAc,cAAc","ignoreList":[]}
@@ -0,0 +1,23 @@
1
+ import { createHostModule } from '@wix/sdk-runtime/host-modules';
2
+ function createAppsMethod(methodName) {
3
+ return host => {
4
+ if (!host.workspace) {
5
+ throw new Error('workspace is not available on the current host. Make sure to use an updated version of the host initialization package.');
6
+ }
7
+ if (!host.workspace.apps) {
8
+ throw new Error('apps is not available on the current host. Make sure to use an updated version of the host initialization package.');
9
+ }
10
+ const method = host.workspace.apps[methodName];
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;
15
+ };
16
+ }
17
+ export const apps = createHostModule({
18
+ startInstallFlow: createAppsMethod('startInstallFlow'),
19
+ startPurchasePlanFlow: createAppsMethod('startPurchasePlanFlow'),
20
+ startUpdateFlow: createAppsMethod('startUpdateFlow'),
21
+ openContactSupport: createAppsMethod('openContactSupport')
22
+ });
23
+ //# sourceMappingURL=apps.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["createHostModule","createAppsMethod","methodName","host","workspace","Error","apps","method","String","startInstallFlow","startPurchasePlanFlow","startUpdateFlow","openContactSupport"],"sources":["../../../../src/namespaces/apps/apps.ts"],"sourcesContent":["import { createHostModule } from '@wix/sdk-runtime/host-modules';\nimport { WorkspaceHost } from '../../types.js';\nimport type { AppsNamespace } from './types.js';\n\nfunction createAppsMethod<K extends keyof AppsNamespace>(\n methodName: K,\n): (host: WorkspaceHost) => AppsNamespace[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.apps) {\n throw new Error(\n 'apps is not available on the current host. Make sure to use an updated version of the host initialization package.',\n );\n }\n\n const method = host.workspace.apps[methodName];\n if (!method) {\n throw new Error(\n `${String(\n methodName,\n )} is not available on the current host. Make sure to use an updated version of the host initialization package.`,\n );\n }\n\n return method as AppsNamespace[K];\n };\n}\n\nexport const apps = createHostModule<WorkspaceHost, AppsNamespace>({\n startInstallFlow: createAppsMethod('startInstallFlow'),\n startPurchasePlanFlow: createAppsMethod('startPurchasePlanFlow'),\n startUpdateFlow: createAppsMethod('startUpdateFlow'),\n openContactSupport: createAppsMethod('openContactSupport'),\n});\n"],"mappings":"AAAA,SAASA,gBAAgB,QAAQ,+BAA+B;AAIhE,SAASC,gBAAgBA,CACvBC,UAAa,EAC8B;EAC3C,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,IAAI,EAAE;MACxB,MAAM,IAAID,KAAK,CACb,oHACF,CAAC;IACH;IAEA,MAAME,MAAM,GAAGJ,IAAI,CAACC,SAAS,CAACE,IAAI,CAACJ,UAAU,CAAC;IAC9C,IAAI,CAACK,MAAM,EAAE;MACX,MAAM,IAAIF,KAAK,CACb,GAAGG,MAAM,CACPN,UACF,CAAC,gHACH,CAAC;IACH;IAEA,OAAOK,MAAM;EACf,CAAC;AACH;AAEA,OAAO,MAAMD,IAAI,GAAGN,gBAAgB,CAA+B;EACjES,gBAAgB,EAAER,gBAAgB,CAAC,kBAAkB,CAAC;EACtDS,qBAAqB,EAAET,gBAAgB,CAAC,uBAAuB,CAAC;EAChEU,eAAe,EAAEV,gBAAgB,CAAC,iBAAiB,CAAC;EACpDW,kBAAkB,EAAEX,gBAAgB,CAAC,oBAAoB;AAC3D,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,3 @@
1
+ export * from './apps.js';
2
+ export * from './types.js';
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sources":["../../../../src/namespaces/apps/index.ts"],"sourcesContent":["export * from './apps.js';\nexport * from './types.js';\n"],"mappings":"AAAA,cAAc,WAAW;AACzB,cAAc,YAAY","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sources":["../../../../src/namespaces/apps/types.ts"],"sourcesContent":["type ResponseStatus = 'SUCCESS' | 'CANCELED';\n\nexport type InstallFlowRequest = {\n appId: string;\n enablePostInstallNavigation?: boolean;\n};\n\nexport type InstallFlowResponse = {\n status: ResponseStatus;\n installedApps: {\n appId: string;\n version: string;\n }[];\n};\n\nexport type PurchasePlanFlowRequest = {\n appId: string;\n};\n\nexport type PurchasePlanFlowResponse = {\n appId: string;\n status: 'DISPATCHED' | 'NOT_INSTALLED';\n};\n\nexport type UpdateFlowRequest = {\n appId: string;\n};\n\nexport type UpdateFlowResponse = {\n status: ResponseStatus;\n installedApps: {\n appId: string;\n version: string;\n }[];\n};\n\nexport type ContactSupportRequest = {\n appId: string;\n};\n\nexport type ContactSupportResponse = {\n status: 'DISPATCHED' | 'CANCELED';\n};\n\nexport type AppsNamespace = {\n startInstallFlow: (args: InstallFlowRequest) => Promise<InstallFlowResponse>;\n startPurchasePlanFlow: (\n args: PurchasePlanFlowRequest,\n ) => Promise<PurchasePlanFlowResponse>;\n startUpdateFlow: (args: UpdateFlowRequest) => Promise<UpdateFlowResponse>;\n openContactSupport: (\n args: ContactSupportRequest,\n ) => Promise<ContactSupportResponse>;\n};\n"],"mappings":"","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ export * from './apps';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sources":["../../../src/namespaces/index.ts"],"sourcesContent":["export * from './apps';\n"],"mappings":"AAAA,cAAc,QAAQ","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["../../src/types.ts"],"sourcesContent":["import type { Host } from '@wix/sdk-types';\n\nimport type { AppsNamespace } from './namespaces/apps';\n\ntype ContextIds = {\n accountId: string;\n userId: string;\n siteId?: string;\n appId?: string;\n};\n\nexport type WorkspaceHost = Host & {\n workspace?: {\n getContextIds?: () => ContextIds;\n openItemSelector?: (...args: any[]) => any;\n apps: AppsNamespace;\n };\n};\n\nexport type InternalSDK = {\n getContextIds?: () => ContextIds;\n};\n\nexport type ItemSelectorSDK = {\n openItemSelector?: (...args: any[]) => any;\n};\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"names":[],"sources":["../../src/types.ts"],"sourcesContent":["import type { Host } from '@wix/sdk-types';\n\nimport type { AppsNamespace } from './namespaces/apps/types';\n\ntype ContextIds = {\n accountId: string;\n userId: string;\n siteId?: string;\n appId?: string;\n};\n\nexport type WorkspaceHost = Host & {\n workspace?: {\n getContextIds?: () => ContextIds;\n openItemSelector?: (...args: any[]) => any;\n apps: AppsNamespace;\n };\n};\n\nexport type InternalSDK = {\n getContextIds?: () => ContextIds;\n};\n\nexport type ItemSelectorSDK = {\n openItemSelector?: (...args: any[]) => any;\n};\n"],"mappings":"","ignoreList":[]}
@@ -5,5 +5,6 @@ export declare const legacy: ExposeFieldsBasedOnToggle<typeof _legacy, {
5
5
  getContextIds: 'alpha';
6
6
  }>;
7
7
  export type { WorkspaceHost } from './types.js';
8
+ export * from './namespaces';
8
9
  export type { ItemSelection, ItemSelectionOptions, ItemSelectionResult, Item, } from './items-selection/types.js';
9
10
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,OAAO,EAAE,MAAM,aAAa,CAAC;AAEhD,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,gBAAgB,CAAC;AAEhE,eAAO,MAAM,YAAY,sJAAgB,CAAC;AAE1C,eAAO,MAAM,MAAM,EAAE,yBAAyB,CAC5C,OAAO,OAAO,EACd;IAAE,aAAa,EAAE,OAAO,CAAA;CAAE,CACjB,CAAC;AAEZ,YAAY,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAEhD,YAAY,EACV,aAAa,EACb,oBAAoB,EACpB,mBAAmB,EACnB,IAAI,GACL,MAAM,4BAA4B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,OAAO,EAAE,MAAM,aAAa,CAAC;AAEhD,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,gBAAgB,CAAC;AAEhE,eAAO,MAAM,YAAY,sJAAgB,CAAC;AAE1C,eAAO,MAAM,MAAM,EAAE,yBAAyB,CAC5C,OAAO,OAAO,EACd;IAAE,aAAa,EAAE,OAAO,CAAA;CAAE,CACjB,CAAC;AAEZ,YAAY,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAEhD,cAAc,cAAc,CAAC;AAE7B,YAAY,EACV,aAAa,EACb,oBAAoB,EACpB,mBAAmB,EACnB,IAAI,GACL,MAAM,4BAA4B,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { WorkspaceHost } from '../../types.js';
2
+ import type { AppsNamespace } from './types.js';
3
+ export declare const apps: AppsNamespace & import("@wix/sdk-types").HostModule<AppsNamespace, WorkspaceHost>;
4
+ //# sourceMappingURL=apps.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"apps.d.ts","sourceRoot":"","sources":["../../../../src/namespaces/apps/apps.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AA+BhD,eAAO,MAAM,IAAI,mFAKf,CAAC"}
@@ -0,0 +1,3 @@
1
+ export * from './apps.js';
2
+ export * from './types.js';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/namespaces/apps/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC"}
@@ -27,17 +27,17 @@ export declare type UpdateFlowResponse = {
27
27
  version: string;
28
28
  }[];
29
29
  };
30
- export interface ContactSupportRequest {
30
+ export declare type ContactSupportRequest = {
31
31
  appId: string;
32
- }
33
- export interface ContactSupportResponse {
32
+ };
33
+ export declare type ContactSupportResponse = {
34
34
  status: 'DISPATCHED' | 'CANCELED';
35
- }
36
- export interface AppsNamespace {
35
+ };
36
+ export declare type AppsNamespace = {
37
37
  startInstallFlow: (args: InstallFlowRequest) => Promise<InstallFlowResponse>;
38
38
  startPurchasePlanFlow: (args: PurchasePlanFlowRequest) => Promise<PurchasePlanFlowResponse>;
39
39
  startUpdateFlow: (args: UpdateFlowRequest) => Promise<UpdateFlowResponse>;
40
40
  openContactSupport: (args: ContactSupportRequest) => Promise<ContactSupportResponse>;
41
- }
41
+ };
42
42
  export {};
43
- //# sourceMappingURL=apps.d.ts.map
43
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/namespaces/apps/types.ts"],"names":[],"mappings":"AAAA,aAAK,cAAc,GAAG,SAAS,GAAG,UAAU,CAAC;AAE7C,oBAAY,kBAAkB,GAAG;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,2BAA2B,CAAC,EAAE,OAAO,CAAC;CACvC,CAAC;AAEF,oBAAY,mBAAmB,GAAG;IAChC,MAAM,EAAE,cAAc,CAAC;IACvB,aAAa,EAAE;QACb,KAAK,EAAE,MAAM,CAAC;QACd,OAAO,EAAE,MAAM,CAAC;KACjB,EAAE,CAAC;CACL,CAAC;AAEF,oBAAY,uBAAuB,GAAG;IACpC,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,oBAAY,wBAAwB,GAAG;IACrC,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,YAAY,GAAG,eAAe,CAAC;CACxC,CAAC;AAEF,oBAAY,iBAAiB,GAAG;IAC9B,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,oBAAY,kBAAkB,GAAG;IAC/B,MAAM,EAAE,cAAc,CAAC;IACvB,aAAa,EAAE;QACb,KAAK,EAAE,MAAM,CAAC;QACd,OAAO,EAAE,MAAM,CAAC;KACjB,EAAE,CAAC;CACL,CAAC;AAEF,oBAAY,qBAAqB,GAAG;IAClC,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,oBAAY,sBAAsB,GAAG;IACnC,MAAM,EAAE,YAAY,GAAG,UAAU,CAAC;CACnC,CAAC;AAEF,oBAAY,aAAa,GAAG;IAC1B,gBAAgB,EAAE,CAAC,IAAI,EAAE,kBAAkB,KAAK,OAAO,CAAC,mBAAmB,CAAC,CAAC;IAC7E,qBAAqB,EAAE,CACrB,IAAI,EAAE,uBAAuB,KAC1B,OAAO,CAAC,wBAAwB,CAAC,CAAC;IACvC,eAAe,EAAE,CAAC,IAAI,EAAE,iBAAiB,KAAK,OAAO,CAAC,kBAAkB,CAAC,CAAC;IAC1E,kBAAkB,EAAE,CAClB,IAAI,EAAE,qBAAqB,KACxB,OAAO,CAAC,sBAAsB,CAAC,CAAC;CACtC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from './apps';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/namespaces/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import type { Host } from '@wix/sdk-types';
2
- import type { AppsNamespace } from './namespaces/apps';
2
+ import type { AppsNamespace } from './namespaces/apps/types';
3
3
  declare type ContextIds = {
4
4
  accountId: string;
5
5
  userId: string;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAE3C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAEvD,aAAK,UAAU,GAAG;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,oBAAY,aAAa,GAAG,IAAI,GAAG;IACjC,SAAS,CAAC,EAAE;QACV,aAAa,CAAC,EAAE,MAAM,UAAU,CAAC;QACjC,gBAAgB,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAC;QAC3C,IAAI,EAAE,aAAa,CAAC;KACrB,CAAC;CACH,CAAC;AAEF,oBAAY,WAAW,GAAG;IACxB,aAAa,CAAC,EAAE,MAAM,UAAU,CAAC;CAClC,CAAC;AAEF,oBAAY,eAAe,GAAG;IAC5B,gBAAgB,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAC;CAC5C,CAAC"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAE3C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAE7D,aAAK,UAAU,GAAG;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,oBAAY,aAAa,GAAG,IAAI,GAAG;IACjC,SAAS,CAAC,EAAE;QACV,aAAa,CAAC,EAAE,MAAM,UAAU,CAAC;QACjC,gBAAgB,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAC;QAC3C,IAAI,EAAE,aAAa,CAAC;KACrB,CAAC;CACH,CAAC;AAEF,oBAAY,WAAW,GAAG;IACxB,aAAa,CAAC,EAAE,MAAM,UAAU,CAAC;CAClC,CAAC;AAEF,oBAAY,eAAe,GAAG;IAC5B,gBAAgB,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAC;CAC5C,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/workspace",
3
- "version": "1.1.0",
3
+ "version": "1.3.0",
4
4
  "license": "UNLICENSED",
5
5
  "author": {
6
6
  "name": "Aviv Maimon",
@@ -69,5 +69,5 @@
69
69
  "wallaby": {
70
70
  "autoDetect": true
71
71
  },
72
- "falconPackageHash": "72503a1c74fea03e34d64fc453ab09759e646aadc6b527a124383dce"
72
+ "falconPackageHash": "12ac24697cd5a995e5d92628f64780e156ced28f4f6b61cbc53e4395"
73
73
  }
@@ -1 +0,0 @@
1
- {"version":3,"names":[],"sources":["../../../src/namespaces/apps.ts"],"sourcesContent":["type ResponseStatus = 'SUCCESS' | 'CANCELED';\n\nexport type InstallFlowRequest = {\n appId: string;\n enablePostInstallNavigation?: boolean;\n};\n\nexport type InstallFlowResponse = {\n status: ResponseStatus;\n installedApps: {\n appId: string;\n version: string;\n }[];\n};\n\nexport type PurchasePlanFlowRequest = {\n appId: string;\n};\n\nexport type PurchasePlanFlowResponse = {\n appId: string;\n status: 'DISPATCHED' | 'NOT_INSTALLED';\n};\n\nexport type UpdateFlowRequest = {\n appId: string;\n};\n\nexport type UpdateFlowResponse = {\n status: ResponseStatus;\n installedApps: {\n appId: string;\n version: string;\n }[];\n};\n\nexport interface ContactSupportRequest {\n appId: string;\n}\n\nexport interface ContactSupportResponse {\n status: 'DISPATCHED' | 'CANCELED';\n}\n\nexport interface AppsNamespace {\n startInstallFlow: (args: InstallFlowRequest) => Promise<InstallFlowResponse>;\n startPurchasePlanFlow: (\n args: PurchasePlanFlowRequest,\n ) => Promise<PurchasePlanFlowResponse>;\n startUpdateFlow: (args: UpdateFlowRequest) => Promise<UpdateFlowResponse>;\n openContactSupport: (\n args: ContactSupportRequest,\n ) => Promise<ContactSupportResponse>;\n}\n"],"mappings":"","ignoreList":[]}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=apps.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":[],"sources":["../../../src/namespaces/apps.ts"],"sourcesContent":["type ResponseStatus = 'SUCCESS' | 'CANCELED';\n\nexport type InstallFlowRequest = {\n appId: string;\n enablePostInstallNavigation?: boolean;\n};\n\nexport type InstallFlowResponse = {\n status: ResponseStatus;\n installedApps: {\n appId: string;\n version: string;\n }[];\n};\n\nexport type PurchasePlanFlowRequest = {\n appId: string;\n};\n\nexport type PurchasePlanFlowResponse = {\n appId: string;\n status: 'DISPATCHED' | 'NOT_INSTALLED';\n};\n\nexport type UpdateFlowRequest = {\n appId: string;\n};\n\nexport type UpdateFlowResponse = {\n status: ResponseStatus;\n installedApps: {\n appId: string;\n version: string;\n }[];\n};\n\nexport interface ContactSupportRequest {\n appId: string;\n}\n\nexport interface ContactSupportResponse {\n status: 'DISPATCHED' | 'CANCELED';\n}\n\nexport interface AppsNamespace {\n startInstallFlow: (args: InstallFlowRequest) => Promise<InstallFlowResponse>;\n startPurchasePlanFlow: (\n args: PurchasePlanFlowRequest,\n ) => Promise<PurchasePlanFlowResponse>;\n startUpdateFlow: (args: UpdateFlowRequest) => Promise<UpdateFlowResponse>;\n openContactSupport: (\n args: ContactSupportRequest,\n ) => Promise<ContactSupportResponse>;\n}\n"],"mappings":"","ignoreList":[]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"apps.d.ts","sourceRoot":"","sources":["../../../src/namespaces/apps.ts"],"names":[],"mappings":"AAAA,aAAK,cAAc,GAAG,SAAS,GAAG,UAAU,CAAC;AAE7C,oBAAY,kBAAkB,GAAG;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,2BAA2B,CAAC,EAAE,OAAO,CAAC;CACvC,CAAC;AAEF,oBAAY,mBAAmB,GAAG;IAChC,MAAM,EAAE,cAAc,CAAC;IACvB,aAAa,EAAE;QACb,KAAK,EAAE,MAAM,CAAC;QACd,OAAO,EAAE,MAAM,CAAC;KACjB,EAAE,CAAC;CACL,CAAC;AAEF,oBAAY,uBAAuB,GAAG;IACpC,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,oBAAY,wBAAwB,GAAG;IACrC,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,YAAY,GAAG,eAAe,CAAC;CACxC,CAAC;AAEF,oBAAY,iBAAiB,GAAG;IAC9B,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,oBAAY,kBAAkB,GAAG;IAC/B,MAAM,EAAE,cAAc,CAAC;IACvB,aAAa,EAAE;QACb,KAAK,EAAE,MAAM,CAAC;QACd,OAAO,EAAE,MAAM,CAAC;KACjB,EAAE,CAAC;CACL,CAAC;AAEF,MAAM,WAAW,qBAAqB;IACpC,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,sBAAsB;IACrC,MAAM,EAAE,YAAY,GAAG,UAAU,CAAC;CACnC;AAED,MAAM,WAAW,aAAa;IAC5B,gBAAgB,EAAE,CAAC,IAAI,EAAE,kBAAkB,KAAK,OAAO,CAAC,mBAAmB,CAAC,CAAC;IAC7E,qBAAqB,EAAE,CACrB,IAAI,EAAE,uBAAuB,KAC1B,OAAO,CAAC,wBAAwB,CAAC,CAAC;IACvC,eAAe,EAAE,CAAC,IAAI,EAAE,iBAAiB,KAAK,OAAO,CAAC,kBAAkB,CAAC,CAAC;IAC1E,kBAAkB,EAAE,CAClB,IAAI,EAAE,qBAAqB,KACxB,OAAO,CAAC,sBAAsB,CAAC,CAAC;CACtC"}