@wix/auto_sdk_apps-installer_apps-installer 1.0.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/build/cjs/index.d.ts +110 -0
- package/build/cjs/index.js +589 -0
- package/build/cjs/index.js.map +1 -0
- package/build/cjs/index.typings.d.ts +837 -0
- package/build/cjs/index.typings.js +508 -0
- package/build/cjs/index.typings.js.map +1 -0
- package/build/cjs/meta.d.ts +226 -0
- package/build/cjs/meta.js +400 -0
- package/build/cjs/meta.js.map +1 -0
- package/build/es/index.d.mts +110 -0
- package/build/es/index.mjs +554 -0
- package/build/es/index.mjs.map +1 -0
- package/build/es/index.typings.d.mts +837 -0
- package/build/es/index.typings.mjs +474 -0
- package/build/es/index.typings.mjs.map +1 -0
- package/build/es/meta.d.mts +226 -0
- package/build/es/meta.mjs +368 -0
- package/build/es/meta.mjs.map +1 -0
- package/build/es/package.json +3 -0
- package/build/internal/cjs/index.d.ts +110 -0
- package/build/internal/cjs/index.js +589 -0
- package/build/internal/cjs/index.js.map +1 -0
- package/build/internal/cjs/index.typings.d.ts +837 -0
- package/build/internal/cjs/index.typings.js +508 -0
- package/build/internal/cjs/index.typings.js.map +1 -0
- package/build/internal/cjs/meta.d.ts +226 -0
- package/build/internal/cjs/meta.js +400 -0
- package/build/internal/cjs/meta.js.map +1 -0
- package/build/internal/es/index.d.mts +110 -0
- package/build/internal/es/index.mjs +554 -0
- package/build/internal/es/index.mjs.map +1 -0
- package/build/internal/es/index.typings.d.mts +837 -0
- package/build/internal/es/index.typings.mjs +474 -0
- package/build/internal/es/index.typings.mjs.map +1 -0
- package/build/internal/es/meta.d.mts +226 -0
- package/build/internal/es/meta.mjs +368 -0
- package/build/internal/es/meta.mjs.map +1 -0
- package/meta/package.json +3 -0
- package/package.json +53 -0
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { HttpClient, NonNullablePaths, EventDefinition, MaybeContext, BuildRESTFunction, BuildEventDefinition } from '@wix/sdk-types';
|
|
2
|
+
import { Tenant, InstallAppOptions, InstallAppResponse, InstallAppApplicationErrors, UninstallAppOptions, BulkUninstallAppOptions, BulkUninstallAppResponse, InstallAppFromShareUrlOptions, InstallAppFromShareUrlResponse, InstallAppFromShareUrlApplicationErrors, InstallTypeWithLiterals, IsPermittedToInstallAppsOptions, IsPermittedToInstallAppsResponse, IsPermittedToInstallAppsApplicationErrors, GetInstalledAppsResponse, AppInstanceAppInstalledOnTenantEnvelope } from './index.typings.js';
|
|
3
|
+
export { ActionEvent, AppInstalledOnTenant, AppInstance, ApplicationError, AppsInstallOptions, BaseEventMetadata, BulkActionMetadata, BulkInstallAppRequest, BulkInstallAppResponse, BulkInstallAppResult, BulkUninstallAppRequest, BulkUninstallAppResult, ClientSpec, ClientSpecMap, DevVersionInstallation, DomainEvent, DomainEventBodyOneOf, Empty, EntityCreatedEvent, EntityDeletedEvent, EntityUpdatedEvent, EventMetadata, GetInstalledAppsRequest, GluedOptions, GluedWidget, IdentificationData, IdentificationDataIdOneOf, InstallAppFromShareUrlRequest, InstallAppRequest, InstallDefaultAppsEvent, InstallType, IsPermittedToInstallAppsOptionsOptionsOneOf, IsPermittedToInstallAppsRequest, IsPermittedToInstallAppsRequestOptionsOneOf, ItemMetadata, LegacyParams, ListAppInstancesRequest, ListAppInstancesResponse, MessageEnvelope, RequestedFields, RestoreInfo, ShareUrlInstallOptions, Status, TPAAppPage, TPAAppRequirements, TPAPermissions, TPASettingsClientSpec, TPAWidgetPosition, TenantType, UninstallAppRequest, UninstallAppResponse, WebhookIdentityType, Widget } from './index.typings.js';
|
|
4
|
+
|
|
5
|
+
type AppInstanceNonNullablePaths = `_id` | `appDefId` | `enabled`;
|
|
6
|
+
declare function installApp$1(httpClient: HttpClient): InstallAppSignature;
|
|
7
|
+
interface InstallAppSignature {
|
|
8
|
+
/**
|
|
9
|
+
* <blockquote class="warning">
|
|
10
|
+
*
|
|
11
|
+
* __Warning:__
|
|
12
|
+
* By using this API to install 3rd-party apps, you acknowledge and agree that:
|
|
13
|
+
*
|
|
14
|
+
* - Some 3rd-party apps installed with this API may access, use, copy, change, or delete all your website's data, including your and your website visitors' and members' financial and personal information.
|
|
15
|
+
* - Wix may not have reviewed the app, and can't guarantee their operation or that it will continue to function as described by the app developers.
|
|
16
|
+
* - You may be sharing sensitive information with the app. Review the terms of use and privacy policies of any app you choose to install to understand how your data will be handled.
|
|
17
|
+
* - You agree to the Wix App Market [terms of use](https://www.wix.com/about/app-market-terms).
|
|
18
|
+
*
|
|
19
|
+
* By installing any 3rd-party app through this API, you confirm your acceptance of all the above conditions.
|
|
20
|
+
*
|
|
21
|
+
* </blockquote>
|
|
22
|
+
*
|
|
23
|
+
* Installs an app on a tenant, specifying the details of the app instance to create.
|
|
24
|
+
*
|
|
25
|
+
* The ID of this app instance is automatically generated and included in the `appInstance` object in the response.
|
|
26
|
+
* @param - Tenant details.
|
|
27
|
+
*/
|
|
28
|
+
(tenant: NonNullablePaths<Tenant, `_id`>, options: NonNullablePaths<InstallAppOptions, `appInstance` | `appInstance.appDefId`>): Promise<NonNullablePaths<InstallAppResponse, {
|
|
29
|
+
[P in AppInstanceNonNullablePaths]: `appInstance.${P}`;
|
|
30
|
+
}[AppInstanceNonNullablePaths]> & {
|
|
31
|
+
__applicationErrorsType?: InstallAppApplicationErrors;
|
|
32
|
+
}>;
|
|
33
|
+
}
|
|
34
|
+
declare function uninstallApp$1(httpClient: HttpClient): UninstallAppSignature;
|
|
35
|
+
interface UninstallAppSignature {
|
|
36
|
+
/**
|
|
37
|
+
* Uninstalls an app from a tenant.
|
|
38
|
+
*
|
|
39
|
+
* This removes the instance of a specified app from the tenant.
|
|
40
|
+
*/
|
|
41
|
+
(options?: NonNullablePaths<UninstallAppOptions, `appDefId`>): Promise<void>;
|
|
42
|
+
}
|
|
43
|
+
declare function bulkUninstallApp$1(httpClient: HttpClient): BulkUninstallAppSignature;
|
|
44
|
+
interface BulkUninstallAppSignature {
|
|
45
|
+
/**
|
|
46
|
+
* Uninstalls apps from a tenant.
|
|
47
|
+
*
|
|
48
|
+
* This removes the instances of the specified apps from the tenant.
|
|
49
|
+
*/
|
|
50
|
+
(options?: NonNullablePaths<BulkUninstallAppOptions, `appDefIds`>): Promise<NonNullablePaths<BulkUninstallAppResponse, `results` | `results.${number}.itemMetadata.originalIndex` | `results.${number}.itemMetadata.success` | `results.${number}.itemMetadata.error.code` | `results.${number}.itemMetadata.error.description` | `results.${number}.appDefId` | {
|
|
51
|
+
[P in AppInstanceNonNullablePaths]: `results.${number}.appInstance.${P}`;
|
|
52
|
+
}[AppInstanceNonNullablePaths] | `bulkActionMetadata.totalSuccesses` | `bulkActionMetadata.totalFailures` | `bulkActionMetadata.undetailedFailures`>>;
|
|
53
|
+
}
|
|
54
|
+
declare function installAppFromShareUrl$1(httpClient: HttpClient): InstallAppFromShareUrlSignature;
|
|
55
|
+
interface InstallAppFromShareUrlSignature {
|
|
56
|
+
/**
|
|
57
|
+
* <blockquote class="warning">
|
|
58
|
+
*
|
|
59
|
+
* __Warning:__
|
|
60
|
+
* By using this API to install 3rd-party apps, you acknowledge and agree that:
|
|
61
|
+
*
|
|
62
|
+
* - Some 3rd-party apps installed with this API may access, use, copy, change, or delete all your website's data, including your and your website visitors' and members' financial and personal information.
|
|
63
|
+
* - Wix may not have reviewed the app, and cannot guarantee their operation or that it will continue to function as described by the app developers.
|
|
64
|
+
* - You may be sharing sensitive information with the app. Please review the terms of use and privacy policies of any app you choose to install to understand how your data will be handled.
|
|
65
|
+
* - By utilizing this API, you agree to the Wix App Market [terms of use](https://www.wix.com/about/app-market-terms).
|
|
66
|
+
*
|
|
67
|
+
* By installing any 3rd-party app through this API, I confirm my acceptance of all the above conditions.
|
|
68
|
+
*
|
|
69
|
+
* </blockquote>
|
|
70
|
+
*
|
|
71
|
+
* Installs an app on a site using a share URL.
|
|
72
|
+
* @param - Tenant details.
|
|
73
|
+
*/
|
|
74
|
+
(tenant: NonNullablePaths<Tenant, `_id`>, options?: NonNullablePaths<InstallAppFromShareUrlOptions, `shareUrlId`>): Promise<NonNullablePaths<InstallAppFromShareUrlResponse, {
|
|
75
|
+
[P in AppInstanceNonNullablePaths]: `appInstance.${P}`;
|
|
76
|
+
}[AppInstanceNonNullablePaths]> & {
|
|
77
|
+
__applicationErrorsType?: InstallAppFromShareUrlApplicationErrors;
|
|
78
|
+
}>;
|
|
79
|
+
}
|
|
80
|
+
declare function isPermittedToInstallApps$1(httpClient: HttpClient): IsPermittedToInstallAppsSignature;
|
|
81
|
+
interface IsPermittedToInstallAppsSignature {
|
|
82
|
+
/**
|
|
83
|
+
* Returns whether it's possible to install an app on a tenant, either by providing app instance details or using a share URL.
|
|
84
|
+
* @param - Installation type.
|
|
85
|
+
*/
|
|
86
|
+
(installType: InstallTypeWithLiterals, options: IsPermittedToInstallAppsOptions): Promise<NonNullablePaths<IsPermittedToInstallAppsResponse, `permitted`> & {
|
|
87
|
+
__applicationErrorsType?: IsPermittedToInstallAppsApplicationErrors;
|
|
88
|
+
}>;
|
|
89
|
+
}
|
|
90
|
+
declare function getInstalledApps$1(httpClient: HttpClient): GetInstalledAppsSignature;
|
|
91
|
+
interface GetInstalledAppsSignature {
|
|
92
|
+
/**
|
|
93
|
+
* Returns the apps that are installed on the site in context
|
|
94
|
+
*/
|
|
95
|
+
(): Promise<NonNullablePaths<GetInstalledAppsResponse, {
|
|
96
|
+
[P in AppInstanceNonNullablePaths]: `appInstances.${number}.${P}`;
|
|
97
|
+
}[AppInstanceNonNullablePaths]>>;
|
|
98
|
+
}
|
|
99
|
+
declare const onAppInstanceAppInstalledOnTenant$1: EventDefinition<AppInstanceAppInstalledOnTenantEnvelope, "wix.apps.v1.app_instance_app_installed_on_tenant">;
|
|
100
|
+
|
|
101
|
+
declare const installApp: MaybeContext<BuildRESTFunction<typeof installApp$1> & typeof installApp$1>;
|
|
102
|
+
declare const uninstallApp: MaybeContext<BuildRESTFunction<typeof uninstallApp$1> & typeof uninstallApp$1>;
|
|
103
|
+
declare const bulkUninstallApp: MaybeContext<BuildRESTFunction<typeof bulkUninstallApp$1> & typeof bulkUninstallApp$1>;
|
|
104
|
+
declare const installAppFromShareUrl: MaybeContext<BuildRESTFunction<typeof installAppFromShareUrl$1> & typeof installAppFromShareUrl$1>;
|
|
105
|
+
declare const isPermittedToInstallApps: MaybeContext<BuildRESTFunction<typeof isPermittedToInstallApps$1> & typeof isPermittedToInstallApps$1>;
|
|
106
|
+
declare const getInstalledApps: MaybeContext<BuildRESTFunction<typeof getInstalledApps$1> & typeof getInstalledApps$1>;
|
|
107
|
+
/** */
|
|
108
|
+
declare const onAppInstanceAppInstalledOnTenant: BuildEventDefinition<typeof onAppInstanceAppInstalledOnTenant$1>;
|
|
109
|
+
|
|
110
|
+
export { AppInstanceAppInstalledOnTenantEnvelope, BulkUninstallAppOptions, BulkUninstallAppResponse, GetInstalledAppsResponse, InstallAppFromShareUrlOptions, InstallAppFromShareUrlResponse, InstallAppOptions, InstallAppResponse, IsPermittedToInstallAppsOptions, IsPermittedToInstallAppsResponse, Tenant, UninstallAppOptions, bulkUninstallApp, getInstalledApps, installApp, installAppFromShareUrl, isPermittedToInstallApps, onAppInstanceAppInstalledOnTenant, uninstallApp };
|
|
@@ -0,0 +1,589 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// index.ts
|
|
21
|
+
var index_exports = {};
|
|
22
|
+
__export(index_exports, {
|
|
23
|
+
InstallType: () => InstallType,
|
|
24
|
+
RequestedFields: () => RequestedFields,
|
|
25
|
+
Status: () => Status,
|
|
26
|
+
TenantType: () => TenantType,
|
|
27
|
+
WebhookIdentityType: () => WebhookIdentityType,
|
|
28
|
+
bulkUninstallApp: () => bulkUninstallApp4,
|
|
29
|
+
getInstalledApps: () => getInstalledApps4,
|
|
30
|
+
installApp: () => installApp4,
|
|
31
|
+
installAppFromShareUrl: () => installAppFromShareUrl4,
|
|
32
|
+
isPermittedToInstallApps: () => isPermittedToInstallApps4,
|
|
33
|
+
onAppInstanceAppInstalledOnTenant: () => onAppInstanceAppInstalledOnTenant2,
|
|
34
|
+
uninstallApp: () => uninstallApp4
|
|
35
|
+
});
|
|
36
|
+
module.exports = __toCommonJS(index_exports);
|
|
37
|
+
|
|
38
|
+
// src/apps-v1-app-instance-apps-installer.public.ts
|
|
39
|
+
var import_rename_all_nested_keys2 = require("@wix/sdk-runtime/rename-all-nested-keys");
|
|
40
|
+
var import_timestamp3 = require("@wix/sdk-runtime/transformations/timestamp");
|
|
41
|
+
var import_transform_paths2 = require("@wix/sdk-runtime/transformations/transform-paths");
|
|
42
|
+
var import_sdk_types = require("@wix/sdk-types");
|
|
43
|
+
|
|
44
|
+
// src/apps-v1-app-instance-apps-installer.universal.ts
|
|
45
|
+
var import_transform_error = require("@wix/sdk-runtime/transform-error");
|
|
46
|
+
var import_rename_all_nested_keys = require("@wix/sdk-runtime/rename-all-nested-keys");
|
|
47
|
+
|
|
48
|
+
// src/apps-v1-app-instance-apps-installer.http.ts
|
|
49
|
+
var import_rest_modules = require("@wix/sdk-runtime/rest-modules");
|
|
50
|
+
var import_float = require("@wix/sdk-runtime/transformations/float");
|
|
51
|
+
var import_timestamp = require("@wix/sdk-runtime/transformations/timestamp");
|
|
52
|
+
var import_timestamp2 = require("@wix/sdk-runtime/transformations/timestamp");
|
|
53
|
+
var import_transform_paths = require("@wix/sdk-runtime/transformations/transform-paths");
|
|
54
|
+
var import_rest_modules2 = require("@wix/sdk-runtime/rest-modules");
|
|
55
|
+
function resolveWixDevcenterAppsInstallerV1AppsInstallerServiceUrl(opts) {
|
|
56
|
+
const domainToMappings = {
|
|
57
|
+
"manage._base_domain_": [
|
|
58
|
+
{
|
|
59
|
+
srcPath: "/apps-installer-service",
|
|
60
|
+
destPath: ""
|
|
61
|
+
}
|
|
62
|
+
],
|
|
63
|
+
"editor._base_domain_": [
|
|
64
|
+
{
|
|
65
|
+
srcPath: "/apps-installer-service",
|
|
66
|
+
destPath: ""
|
|
67
|
+
}
|
|
68
|
+
],
|
|
69
|
+
"blocks._base_domain_": [
|
|
70
|
+
{
|
|
71
|
+
srcPath: "/apps-installer-service",
|
|
72
|
+
destPath: ""
|
|
73
|
+
}
|
|
74
|
+
],
|
|
75
|
+
"create.editorx": [
|
|
76
|
+
{
|
|
77
|
+
srcPath: "/apps-installer-service",
|
|
78
|
+
destPath: ""
|
|
79
|
+
}
|
|
80
|
+
],
|
|
81
|
+
"dev._base_domain_": [
|
|
82
|
+
{
|
|
83
|
+
srcPath: "/apps-installer-service",
|
|
84
|
+
destPath: ""
|
|
85
|
+
}
|
|
86
|
+
],
|
|
87
|
+
"www.wixapis.com": [
|
|
88
|
+
{
|
|
89
|
+
srcPath: "/apps-installer-service",
|
|
90
|
+
destPath: ""
|
|
91
|
+
}
|
|
92
|
+
],
|
|
93
|
+
"*.dev.wix-code.com": [
|
|
94
|
+
{
|
|
95
|
+
srcPath: "/apps/v1/app-instances",
|
|
96
|
+
destPath: ""
|
|
97
|
+
}
|
|
98
|
+
],
|
|
99
|
+
_: [
|
|
100
|
+
{
|
|
101
|
+
srcPath: "/apps/v1/app-instances",
|
|
102
|
+
destPath: ""
|
|
103
|
+
}
|
|
104
|
+
]
|
|
105
|
+
};
|
|
106
|
+
return (0, import_rest_modules2.resolveUrl)(Object.assign(opts, { domainToMappings }));
|
|
107
|
+
}
|
|
108
|
+
var PACKAGE_NAME = "@wix/auto_sdk_apps-installer_apps-installer";
|
|
109
|
+
function installApp(payload) {
|
|
110
|
+
function __installApp({ host }) {
|
|
111
|
+
const serializedData = (0, import_transform_paths.transformPaths)(payload, [
|
|
112
|
+
{
|
|
113
|
+
transformFn: import_timestamp.transformSDKTimestampToRESTTimestamp,
|
|
114
|
+
paths: [
|
|
115
|
+
{ path: "appInstance.installedDate" },
|
|
116
|
+
{ path: "appInstance.updatedDate" }
|
|
117
|
+
]
|
|
118
|
+
}
|
|
119
|
+
]);
|
|
120
|
+
const metadata = {
|
|
121
|
+
entityFqdn: "wix.apps.v1.app_instance",
|
|
122
|
+
method: "POST",
|
|
123
|
+
methodFqn: "wix.devcenter.apps.installer.v1.AppsInstallerService.InstallApp",
|
|
124
|
+
packageName: PACKAGE_NAME,
|
|
125
|
+
url: resolveWixDevcenterAppsInstallerV1AppsInstallerServiceUrl({
|
|
126
|
+
protoPath: "/v1/app-instance/install",
|
|
127
|
+
data: serializedData,
|
|
128
|
+
host
|
|
129
|
+
}),
|
|
130
|
+
data: serializedData,
|
|
131
|
+
transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
|
|
132
|
+
{
|
|
133
|
+
transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
|
|
134
|
+
paths: [
|
|
135
|
+
{ path: "appInstance.installedDate" },
|
|
136
|
+
{ path: "appInstance.updatedDate" },
|
|
137
|
+
{ path: "dependenciesInstallation.installedDate" },
|
|
138
|
+
{ path: "dependenciesInstallation.updatedDate" }
|
|
139
|
+
]
|
|
140
|
+
}
|
|
141
|
+
])
|
|
142
|
+
};
|
|
143
|
+
return metadata;
|
|
144
|
+
}
|
|
145
|
+
return __installApp;
|
|
146
|
+
}
|
|
147
|
+
function uninstallApp(payload) {
|
|
148
|
+
function __uninstallApp({ host }) {
|
|
149
|
+
const metadata = {
|
|
150
|
+
entityFqdn: "wix.apps.v1.app_instance",
|
|
151
|
+
method: "POST",
|
|
152
|
+
methodFqn: "wix.devcenter.apps.installer.v1.AppsInstallerService.UninstallApp",
|
|
153
|
+
packageName: PACKAGE_NAME,
|
|
154
|
+
url: resolveWixDevcenterAppsInstallerV1AppsInstallerServiceUrl({
|
|
155
|
+
protoPath: "/v1/app-instance/uninstall",
|
|
156
|
+
data: payload,
|
|
157
|
+
host
|
|
158
|
+
}),
|
|
159
|
+
data: payload
|
|
160
|
+
};
|
|
161
|
+
return metadata;
|
|
162
|
+
}
|
|
163
|
+
return __uninstallApp;
|
|
164
|
+
}
|
|
165
|
+
function bulkUninstallApp(payload) {
|
|
166
|
+
function __bulkUninstallApp({ host }) {
|
|
167
|
+
const metadata = {
|
|
168
|
+
entityFqdn: "wix.apps.v1.app_instance",
|
|
169
|
+
method: "POST",
|
|
170
|
+
methodFqn: "wix.devcenter.apps.installer.v1.AppsInstallerService.BulkUninstallApp",
|
|
171
|
+
packageName: PACKAGE_NAME,
|
|
172
|
+
url: resolveWixDevcenterAppsInstallerV1AppsInstallerServiceUrl({
|
|
173
|
+
protoPath: "/v1/bulk/app-instance/uninstall",
|
|
174
|
+
data: payload,
|
|
175
|
+
host
|
|
176
|
+
}),
|
|
177
|
+
data: payload,
|
|
178
|
+
transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
|
|
179
|
+
{
|
|
180
|
+
transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
|
|
181
|
+
paths: [
|
|
182
|
+
{ path: "results.appInstance.installedDate" },
|
|
183
|
+
{ path: "results.appInstance.updatedDate" }
|
|
184
|
+
]
|
|
185
|
+
},
|
|
186
|
+
{
|
|
187
|
+
transformFn: import_float.transformRESTFloatToSDKFloat,
|
|
188
|
+
paths: [
|
|
189
|
+
{
|
|
190
|
+
path: "clientSpecMap.data.widgets.*.gluedOptions.verticalMargin"
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
path: "clientSpecMap.data.widgets.*.gluedOptions.horizontalMargin"
|
|
194
|
+
}
|
|
195
|
+
]
|
|
196
|
+
}
|
|
197
|
+
])
|
|
198
|
+
};
|
|
199
|
+
return metadata;
|
|
200
|
+
}
|
|
201
|
+
return __bulkUninstallApp;
|
|
202
|
+
}
|
|
203
|
+
function installAppFromShareUrl(payload) {
|
|
204
|
+
function __installAppFromShareUrl({ host }) {
|
|
205
|
+
const metadata = {
|
|
206
|
+
entityFqdn: "wix.apps.v1.app_instance",
|
|
207
|
+
method: "POST",
|
|
208
|
+
methodFqn: "wix.devcenter.apps.installer.v1.AppsInstallerService.InstallAppFromShareUrl",
|
|
209
|
+
packageName: PACKAGE_NAME,
|
|
210
|
+
url: resolveWixDevcenterAppsInstallerV1AppsInstallerServiceUrl({
|
|
211
|
+
protoPath: "/v1/app-share-url/install",
|
|
212
|
+
data: payload,
|
|
213
|
+
host
|
|
214
|
+
}),
|
|
215
|
+
data: payload,
|
|
216
|
+
transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
|
|
217
|
+
{
|
|
218
|
+
transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
|
|
219
|
+
paths: [
|
|
220
|
+
{ path: "appInstance.installedDate" },
|
|
221
|
+
{ path: "appInstance.updatedDate" },
|
|
222
|
+
{ path: "dependenciesInstallation.installedDate" },
|
|
223
|
+
{ path: "dependenciesInstallation.updatedDate" }
|
|
224
|
+
]
|
|
225
|
+
}
|
|
226
|
+
])
|
|
227
|
+
};
|
|
228
|
+
return metadata;
|
|
229
|
+
}
|
|
230
|
+
return __installAppFromShareUrl;
|
|
231
|
+
}
|
|
232
|
+
function isPermittedToInstallApps(payload) {
|
|
233
|
+
function __isPermittedToInstallApps({ host }) {
|
|
234
|
+
const serializedData = (0, import_transform_paths.transformPaths)(payload, [
|
|
235
|
+
{
|
|
236
|
+
transformFn: import_timestamp.transformSDKTimestampToRESTTimestamp,
|
|
237
|
+
paths: [
|
|
238
|
+
{ path: "appsInstallOptions.appInstances.installedDate" },
|
|
239
|
+
{ path: "appsInstallOptions.appInstances.updatedDate" }
|
|
240
|
+
]
|
|
241
|
+
}
|
|
242
|
+
]);
|
|
243
|
+
const metadata = {
|
|
244
|
+
entityFqdn: "wix.apps.v1.app_instance",
|
|
245
|
+
method: "POST",
|
|
246
|
+
methodFqn: "wix.devcenter.apps.installer.v1.AppsInstallerService.IsPermittedToInstallApps",
|
|
247
|
+
packageName: PACKAGE_NAME,
|
|
248
|
+
url: resolveWixDevcenterAppsInstallerV1AppsInstallerServiceUrl({
|
|
249
|
+
protoPath: "/v1/app-instance/is-permitted-to-install",
|
|
250
|
+
data: serializedData,
|
|
251
|
+
host
|
|
252
|
+
}),
|
|
253
|
+
data: serializedData
|
|
254
|
+
};
|
|
255
|
+
return metadata;
|
|
256
|
+
}
|
|
257
|
+
return __isPermittedToInstallApps;
|
|
258
|
+
}
|
|
259
|
+
function getInstalledApps(payload) {
|
|
260
|
+
function __getInstalledApps({ host }) {
|
|
261
|
+
const metadata = {
|
|
262
|
+
entityFqdn: "wix.apps.v1.app_instance",
|
|
263
|
+
method: "GET",
|
|
264
|
+
methodFqn: "wix.devcenter.apps.installer.v1.AppsInstallerService.GetInstalledApps",
|
|
265
|
+
packageName: PACKAGE_NAME,
|
|
266
|
+
url: resolveWixDevcenterAppsInstallerV1AppsInstallerServiceUrl({
|
|
267
|
+
protoPath: "/v1/app-instances",
|
|
268
|
+
data: payload,
|
|
269
|
+
host
|
|
270
|
+
}),
|
|
271
|
+
params: (0, import_rest_modules.toURLSearchParams)(payload),
|
|
272
|
+
transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
|
|
273
|
+
{
|
|
274
|
+
transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
|
|
275
|
+
paths: [
|
|
276
|
+
{ path: "appInstances.installedDate" },
|
|
277
|
+
{ path: "appInstances.updatedDate" }
|
|
278
|
+
]
|
|
279
|
+
}
|
|
280
|
+
]),
|
|
281
|
+
fallback: [
|
|
282
|
+
{
|
|
283
|
+
method: "GET",
|
|
284
|
+
url: resolveWixDevcenterAppsInstallerV1AppsInstallerServiceUrl({
|
|
285
|
+
protoPath: "/v1/app-instances",
|
|
286
|
+
data: payload,
|
|
287
|
+
host
|
|
288
|
+
}),
|
|
289
|
+
params: (0, import_rest_modules.toURLSearchParams)(payload)
|
|
290
|
+
}
|
|
291
|
+
]
|
|
292
|
+
};
|
|
293
|
+
return metadata;
|
|
294
|
+
}
|
|
295
|
+
return __getInstalledApps;
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
// src/apps-v1-app-instance-apps-installer.universal.ts
|
|
299
|
+
var Status = /* @__PURE__ */ ((Status2) => {
|
|
300
|
+
Status2["UNKNOWN"] = "UNKNOWN";
|
|
301
|
+
Status2["WAITING_FOR_OAUTH"] = "WAITING_FOR_OAUTH";
|
|
302
|
+
Status2["AUTHENTICATED"] = "AUTHENTICATED";
|
|
303
|
+
Status2["DIDNT_COMPLETE_PAYMENT"] = "DIDNT_COMPLETE_PAYMENT";
|
|
304
|
+
return Status2;
|
|
305
|
+
})(Status || {});
|
|
306
|
+
var TenantType = /* @__PURE__ */ ((TenantType2) => {
|
|
307
|
+
TenantType2["SITE"] = "SITE";
|
|
308
|
+
TenantType2["ACCOUNT"] = "ACCOUNT";
|
|
309
|
+
return TenantType2;
|
|
310
|
+
})(TenantType || {});
|
|
311
|
+
var WebhookIdentityType = /* @__PURE__ */ ((WebhookIdentityType2) => {
|
|
312
|
+
WebhookIdentityType2["UNKNOWN"] = "UNKNOWN";
|
|
313
|
+
WebhookIdentityType2["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
|
|
314
|
+
WebhookIdentityType2["MEMBER"] = "MEMBER";
|
|
315
|
+
WebhookIdentityType2["WIX_USER"] = "WIX_USER";
|
|
316
|
+
WebhookIdentityType2["APP"] = "APP";
|
|
317
|
+
return WebhookIdentityType2;
|
|
318
|
+
})(WebhookIdentityType || {});
|
|
319
|
+
var RequestedFields = /* @__PURE__ */ ((RequestedFields2) => {
|
|
320
|
+
RequestedFields2["UNKNOWN_REQUESTED_FIELD"] = "UNKNOWN_REQUESTED_FIELD";
|
|
321
|
+
RequestedFields2["CLIENT_SPEC_MAP"] = "CLIENT_SPEC_MAP";
|
|
322
|
+
return RequestedFields2;
|
|
323
|
+
})(RequestedFields || {});
|
|
324
|
+
var InstallType = /* @__PURE__ */ ((InstallType2) => {
|
|
325
|
+
InstallType2["UNKNOWN_INSTALL_TYPE"] = "UNKNOWN_INSTALL_TYPE";
|
|
326
|
+
InstallType2["APPS_INSTALL"] = "APPS_INSTALL";
|
|
327
|
+
InstallType2["SHARE_URL_INSTALL"] = "SHARE_URL_INSTALL";
|
|
328
|
+
return InstallType2;
|
|
329
|
+
})(InstallType || {});
|
|
330
|
+
async function installApp2(tenant, options) {
|
|
331
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
332
|
+
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
333
|
+
tenant,
|
|
334
|
+
appInstance: options?.appInstance
|
|
335
|
+
});
|
|
336
|
+
const reqOpts = installApp(payload);
|
|
337
|
+
sideEffects?.onSiteCall?.();
|
|
338
|
+
try {
|
|
339
|
+
const result = await httpClient.request(reqOpts);
|
|
340
|
+
sideEffects?.onSuccess?.(result);
|
|
341
|
+
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
|
|
342
|
+
} catch (err) {
|
|
343
|
+
const transformedError = (0, import_transform_error.transformError)(
|
|
344
|
+
err,
|
|
345
|
+
{
|
|
346
|
+
spreadPathsToArguments: {},
|
|
347
|
+
explicitPathsToArguments: {
|
|
348
|
+
tenant: "$[0]",
|
|
349
|
+
appInstance: "$[1].appInstance"
|
|
350
|
+
},
|
|
351
|
+
singleArgumentUnchanged: false
|
|
352
|
+
},
|
|
353
|
+
["tenant", "options"]
|
|
354
|
+
);
|
|
355
|
+
sideEffects?.onError?.(err);
|
|
356
|
+
throw transformedError;
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
async function uninstallApp2(options) {
|
|
360
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
361
|
+
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
362
|
+
tenant: options?.tenant,
|
|
363
|
+
appDefId: options?.appDefId
|
|
364
|
+
});
|
|
365
|
+
const reqOpts = uninstallApp(payload);
|
|
366
|
+
sideEffects?.onSiteCall?.();
|
|
367
|
+
try {
|
|
368
|
+
const result = await httpClient.request(reqOpts);
|
|
369
|
+
sideEffects?.onSuccess?.(result);
|
|
370
|
+
} catch (err) {
|
|
371
|
+
const transformedError = (0, import_transform_error.transformError)(
|
|
372
|
+
err,
|
|
373
|
+
{
|
|
374
|
+
spreadPathsToArguments: {},
|
|
375
|
+
explicitPathsToArguments: {
|
|
376
|
+
tenant: "$[0].tenant",
|
|
377
|
+
appDefId: "$[0].appDefId"
|
|
378
|
+
},
|
|
379
|
+
singleArgumentUnchanged: false
|
|
380
|
+
},
|
|
381
|
+
["options"]
|
|
382
|
+
);
|
|
383
|
+
sideEffects?.onError?.(err);
|
|
384
|
+
throw transformedError;
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
async function bulkUninstallApp2(options) {
|
|
388
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
389
|
+
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
390
|
+
tenant: options?.tenant,
|
|
391
|
+
appDefIds: options?.appDefIds
|
|
392
|
+
});
|
|
393
|
+
const reqOpts = bulkUninstallApp(payload);
|
|
394
|
+
sideEffects?.onSiteCall?.();
|
|
395
|
+
try {
|
|
396
|
+
const result = await httpClient.request(reqOpts);
|
|
397
|
+
sideEffects?.onSuccess?.(result);
|
|
398
|
+
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
|
|
399
|
+
} catch (err) {
|
|
400
|
+
const transformedError = (0, import_transform_error.transformError)(
|
|
401
|
+
err,
|
|
402
|
+
{
|
|
403
|
+
spreadPathsToArguments: {},
|
|
404
|
+
explicitPathsToArguments: {
|
|
405
|
+
tenant: "$[0].tenant",
|
|
406
|
+
appDefIds: "$[0].appDefIds"
|
|
407
|
+
},
|
|
408
|
+
singleArgumentUnchanged: false
|
|
409
|
+
},
|
|
410
|
+
["options"]
|
|
411
|
+
);
|
|
412
|
+
sideEffects?.onError?.(err);
|
|
413
|
+
throw transformedError;
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
async function installAppFromShareUrl2(tenant, options) {
|
|
417
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
418
|
+
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
419
|
+
tenant,
|
|
420
|
+
shareUrlId: options?.shareUrlId,
|
|
421
|
+
devVersion: options?.devVersion
|
|
422
|
+
});
|
|
423
|
+
const reqOpts = installAppFromShareUrl(payload);
|
|
424
|
+
sideEffects?.onSiteCall?.();
|
|
425
|
+
try {
|
|
426
|
+
const result = await httpClient.request(reqOpts);
|
|
427
|
+
sideEffects?.onSuccess?.(result);
|
|
428
|
+
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
|
|
429
|
+
} catch (err) {
|
|
430
|
+
const transformedError = (0, import_transform_error.transformError)(
|
|
431
|
+
err,
|
|
432
|
+
{
|
|
433
|
+
spreadPathsToArguments: {},
|
|
434
|
+
explicitPathsToArguments: {
|
|
435
|
+
tenant: "$[0]",
|
|
436
|
+
shareUrlId: "$[1].shareUrlId",
|
|
437
|
+
devVersion: "$[1].devVersion"
|
|
438
|
+
},
|
|
439
|
+
singleArgumentUnchanged: false
|
|
440
|
+
},
|
|
441
|
+
["tenant", "options"]
|
|
442
|
+
);
|
|
443
|
+
sideEffects?.onError?.(err);
|
|
444
|
+
throw transformedError;
|
|
445
|
+
}
|
|
446
|
+
}
|
|
447
|
+
async function isPermittedToInstallApps2(installType, options) {
|
|
448
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
449
|
+
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
450
|
+
installType,
|
|
451
|
+
appsInstallOptions: options?.appsInstallOptions,
|
|
452
|
+
shareUrlInstallOptions: options?.shareUrlInstallOptions
|
|
453
|
+
});
|
|
454
|
+
const reqOpts = isPermittedToInstallApps(payload);
|
|
455
|
+
sideEffects?.onSiteCall?.();
|
|
456
|
+
try {
|
|
457
|
+
const result = await httpClient.request(reqOpts);
|
|
458
|
+
sideEffects?.onSuccess?.(result);
|
|
459
|
+
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
|
|
460
|
+
} catch (err) {
|
|
461
|
+
const transformedError = (0, import_transform_error.transformError)(
|
|
462
|
+
err,
|
|
463
|
+
{
|
|
464
|
+
spreadPathsToArguments: {},
|
|
465
|
+
explicitPathsToArguments: {
|
|
466
|
+
installType: "$[0]",
|
|
467
|
+
appsInstallOptions: "$[1].appsInstallOptions",
|
|
468
|
+
shareUrlInstallOptions: "$[1].shareUrlInstallOptions"
|
|
469
|
+
},
|
|
470
|
+
singleArgumentUnchanged: false
|
|
471
|
+
},
|
|
472
|
+
["installType", "options"]
|
|
473
|
+
);
|
|
474
|
+
sideEffects?.onError?.(err);
|
|
475
|
+
throw transformedError;
|
|
476
|
+
}
|
|
477
|
+
}
|
|
478
|
+
async function getInstalledApps2() {
|
|
479
|
+
const { httpClient, sideEffects } = arguments[0];
|
|
480
|
+
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({});
|
|
481
|
+
const reqOpts = getInstalledApps(payload);
|
|
482
|
+
sideEffects?.onSiteCall?.();
|
|
483
|
+
try {
|
|
484
|
+
const result = await httpClient.request(reqOpts);
|
|
485
|
+
sideEffects?.onSuccess?.(result);
|
|
486
|
+
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
|
|
487
|
+
} catch (err) {
|
|
488
|
+
const transformedError = (0, import_transform_error.transformError)(
|
|
489
|
+
err,
|
|
490
|
+
{
|
|
491
|
+
spreadPathsToArguments: {},
|
|
492
|
+
explicitPathsToArguments: {},
|
|
493
|
+
singleArgumentUnchanged: false
|
|
494
|
+
},
|
|
495
|
+
[]
|
|
496
|
+
);
|
|
497
|
+
sideEffects?.onError?.(err);
|
|
498
|
+
throw transformedError;
|
|
499
|
+
}
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
// src/apps-v1-app-instance-apps-installer.public.ts
|
|
503
|
+
function installApp3(httpClient) {
|
|
504
|
+
return (tenant, options) => installApp2(
|
|
505
|
+
tenant,
|
|
506
|
+
options,
|
|
507
|
+
// @ts-ignore
|
|
508
|
+
{ httpClient }
|
|
509
|
+
);
|
|
510
|
+
}
|
|
511
|
+
function uninstallApp3(httpClient) {
|
|
512
|
+
return (options) => uninstallApp2(
|
|
513
|
+
options,
|
|
514
|
+
// @ts-ignore
|
|
515
|
+
{ httpClient }
|
|
516
|
+
);
|
|
517
|
+
}
|
|
518
|
+
function bulkUninstallApp3(httpClient) {
|
|
519
|
+
return (options) => bulkUninstallApp2(
|
|
520
|
+
options,
|
|
521
|
+
// @ts-ignore
|
|
522
|
+
{ httpClient }
|
|
523
|
+
);
|
|
524
|
+
}
|
|
525
|
+
function installAppFromShareUrl3(httpClient) {
|
|
526
|
+
return (tenant, options) => installAppFromShareUrl2(
|
|
527
|
+
tenant,
|
|
528
|
+
options,
|
|
529
|
+
// @ts-ignore
|
|
530
|
+
{ httpClient }
|
|
531
|
+
);
|
|
532
|
+
}
|
|
533
|
+
function isPermittedToInstallApps3(httpClient) {
|
|
534
|
+
return (installType, options) => isPermittedToInstallApps2(
|
|
535
|
+
installType,
|
|
536
|
+
options,
|
|
537
|
+
// @ts-ignore
|
|
538
|
+
{ httpClient }
|
|
539
|
+
);
|
|
540
|
+
}
|
|
541
|
+
function getInstalledApps3(httpClient) {
|
|
542
|
+
return () => getInstalledApps2(
|
|
543
|
+
// @ts-ignore
|
|
544
|
+
{ httpClient }
|
|
545
|
+
);
|
|
546
|
+
}
|
|
547
|
+
var onAppInstanceAppInstalledOnTenant = (0, import_sdk_types.EventDefinition)(
|
|
548
|
+
"wix.apps.v1.app_instance_app_installed_on_tenant",
|
|
549
|
+
true,
|
|
550
|
+
(event) => (0, import_rename_all_nested_keys2.renameKeysFromRESTResponseToSDKResponse)(
|
|
551
|
+
(0, import_transform_paths2.transformPaths)(event, [
|
|
552
|
+
{
|
|
553
|
+
transformFn: import_timestamp3.transformRESTTimestampToSDKTimestamp,
|
|
554
|
+
paths: [
|
|
555
|
+
{ path: "data.appInstance.installedDate" },
|
|
556
|
+
{ path: "data.appInstance.updatedDate" },
|
|
557
|
+
{ path: "metadata.eventTime" }
|
|
558
|
+
]
|
|
559
|
+
}
|
|
560
|
+
])
|
|
561
|
+
)
|
|
562
|
+
)();
|
|
563
|
+
|
|
564
|
+
// src/apps-v1-app-instance-apps-installer.context.ts
|
|
565
|
+
var import_rest_modules3 = require("@wix/sdk-runtime/rest-modules");
|
|
566
|
+
var import_event_definition_modules = require("@wix/sdk-runtime/event-definition-modules");
|
|
567
|
+
var installApp4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(installApp3);
|
|
568
|
+
var uninstallApp4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(uninstallApp3);
|
|
569
|
+
var bulkUninstallApp4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(bulkUninstallApp3);
|
|
570
|
+
var installAppFromShareUrl4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(installAppFromShareUrl3);
|
|
571
|
+
var isPermittedToInstallApps4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(isPermittedToInstallApps3);
|
|
572
|
+
var getInstalledApps4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(getInstalledApps3);
|
|
573
|
+
var onAppInstanceAppInstalledOnTenant2 = (0, import_event_definition_modules.createEventModule)(onAppInstanceAppInstalledOnTenant);
|
|
574
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
575
|
+
0 && (module.exports = {
|
|
576
|
+
InstallType,
|
|
577
|
+
RequestedFields,
|
|
578
|
+
Status,
|
|
579
|
+
TenantType,
|
|
580
|
+
WebhookIdentityType,
|
|
581
|
+
bulkUninstallApp,
|
|
582
|
+
getInstalledApps,
|
|
583
|
+
installApp,
|
|
584
|
+
installAppFromShareUrl,
|
|
585
|
+
isPermittedToInstallApps,
|
|
586
|
+
onAppInstanceAppInstalledOnTenant,
|
|
587
|
+
uninstallApp
|
|
588
|
+
});
|
|
589
|
+
//# sourceMappingURL=index.js.map
|