@wix/auto_sdk_apps-installer_apps-installer 1.0.3 → 1.0.5

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 (37) hide show
  1. package/build/cjs/index.d.ts +30 -3
  2. package/build/cjs/index.js +114 -0
  3. package/build/cjs/index.js.map +1 -1
  4. package/build/cjs/index.typings.d.ts +49 -2
  5. package/build/cjs/index.typings.js +105 -0
  6. package/build/cjs/index.typings.js.map +1 -1
  7. package/build/cjs/meta.d.ts +417 -2
  8. package/build/cjs/meta.js +137 -0
  9. package/build/cjs/meta.js.map +1 -1
  10. package/build/es/index.d.mts +30 -3
  11. package/build/es/index.mjs +113 -0
  12. package/build/es/index.mjs.map +1 -1
  13. package/build/es/index.typings.d.mts +49 -2
  14. package/build/es/index.typings.mjs +104 -0
  15. package/build/es/index.typings.mjs.map +1 -1
  16. package/build/es/meta.d.mts +417 -2
  17. package/build/es/meta.mjs +131 -0
  18. package/build/es/meta.mjs.map +1 -1
  19. package/build/internal/cjs/index.d.ts +30 -3
  20. package/build/internal/cjs/index.js +114 -0
  21. package/build/internal/cjs/index.js.map +1 -1
  22. package/build/internal/cjs/index.typings.d.ts +49 -2
  23. package/build/internal/cjs/index.typings.js +105 -0
  24. package/build/internal/cjs/index.typings.js.map +1 -1
  25. package/build/internal/cjs/meta.d.ts +417 -2
  26. package/build/internal/cjs/meta.js +137 -0
  27. package/build/internal/cjs/meta.js.map +1 -1
  28. package/build/internal/es/index.d.mts +30 -3
  29. package/build/internal/es/index.mjs +113 -0
  30. package/build/internal/es/index.mjs.map +1 -1
  31. package/build/internal/es/index.typings.d.mts +49 -2
  32. package/build/internal/es/index.typings.mjs +104 -0
  33. package/build/internal/es/index.typings.mjs.map +1 -1
  34. package/build/internal/es/meta.d.mts +417 -2
  35. package/build/internal/es/meta.mjs +131 -0
  36. package/build/internal/es/meta.mjs.map +1 -1
  37. package/package.json +3 -3
@@ -1,6 +1,6 @@
1
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, RequestedFieldsWithLiterals, RestoreInfo, ShareUrlInstallOptions, Status, StatusWithLiterals, TPAAppPage, TPAAppRequirements, TPAPermissions, TPASettingsClientSpec, TPAWidgetPosition, TenantType, TenantTypeWithLiterals, UninstallAppRequest, UninstallAppResponse, WebhookIdentityType, WebhookIdentityTypeWithLiterals, Widget } from './index.typings.js';
2
+ import { Tenant, InstallAppOptions, InstallAppResponse, InstallAppApplicationErrors, BulkInstallAppOptions, BulkInstallAppResponse, BulkInstallAppApplicationErrors, 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, 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, RequestedFieldsWithLiterals, RestoreInfo, ShareUrlInstallOptions, Status, StatusWithLiterals, TPAAppPage, TPAAppRequirements, TPAPermissions, TPASettingsClientSpec, TPAWidgetPosition, TenantType, TenantTypeWithLiterals, UninstallAppRequest, UninstallAppResponse, WebhookIdentityType, WebhookIdentityTypeWithLiterals, Widget } from './index.typings.js';
4
4
 
5
5
  declare function installApp$1(httpClient: HttpClient): InstallAppSignature;
6
6
  interface InstallAppSignature {
@@ -28,6 +28,32 @@ interface InstallAppSignature {
28
28
  __applicationErrorsType?: InstallAppApplicationErrors;
29
29
  }>;
30
30
  }
31
+ declare function bulkInstallApp$1(httpClient: HttpClient): BulkInstallAppSignature;
32
+ interface BulkInstallAppSignature {
33
+ /**
34
+ * <blockquote class="warning">
35
+ *
36
+ * __Warning:__
37
+ * By using this API to install 3rd-party apps, you acknowledge and agree that:
38
+ *
39
+ * - 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.
40
+ * - 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.
41
+ * - 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.
42
+ * - You agree to the Wix App Market [terms of use](https://www.wix.com/about/app-market-terms).
43
+ *
44
+ * By installing any 3rd-party app through this API, you confirm your acceptance of all the above conditions.
45
+ *
46
+ * </blockquote>
47
+ *
48
+ * Bulk installs apps on a tenant, specifying the details of the app instances to create.
49
+ *
50
+ * The IDs of these app instances are automatically generated and included in the `appInstance` objects in the response.
51
+ * @param - Tenant details.
52
+ */
53
+ (tenant: NonNullablePaths<Tenant, `_id`, 2>, options?: BulkInstallAppOptions): Promise<NonNullablePaths<BulkInstallAppResponse, `results` | `results.${number}.itemMetadata.originalIndex` | `results.${number}.itemMetadata.success` | `results.${number}.itemMetadata.error.code` | `results.${number}.itemMetadata.error.description` | `results.${number}.appInstance._id` | `results.${number}.appInstance.appDefId` | `results.${number}.appInstance.enabled` | `bulkActionMetadata.totalSuccesses` | `bulkActionMetadata.totalFailures` | `bulkActionMetadata.undetailedFailures`, 6> & {
54
+ __applicationErrorsType?: BulkInstallAppApplicationErrors;
55
+ }>;
56
+ }
31
57
  declare function uninstallApp$1(httpClient: HttpClient): UninstallAppSignature;
32
58
  interface UninstallAppSignature {
33
59
  /**
@@ -90,6 +116,7 @@ interface GetInstalledAppsSignature {
90
116
  declare const onAppInstanceAppInstalledOnTenant$1: EventDefinition<AppInstanceAppInstalledOnTenantEnvelope, "wix.apps.v1.app_instance_app_installed_on_tenant">;
91
117
 
92
118
  declare const installApp: MaybeContext<BuildRESTFunction<typeof installApp$1> & typeof installApp$1>;
119
+ declare const bulkInstallApp: MaybeContext<BuildRESTFunction<typeof bulkInstallApp$1> & typeof bulkInstallApp$1>;
93
120
  declare const uninstallApp: MaybeContext<BuildRESTFunction<typeof uninstallApp$1> & typeof uninstallApp$1>;
94
121
  declare const bulkUninstallApp: MaybeContext<BuildRESTFunction<typeof bulkUninstallApp$1> & typeof bulkUninstallApp$1>;
95
122
  declare const installAppFromShareUrl: MaybeContext<BuildRESTFunction<typeof installAppFromShareUrl$1> & typeof installAppFromShareUrl$1>;
@@ -98,4 +125,4 @@ declare const getInstalledApps: MaybeContext<BuildRESTFunction<typeof getInstall
98
125
  /** */
99
126
  declare const onAppInstanceAppInstalledOnTenant: BuildEventDefinition<typeof onAppInstanceAppInstalledOnTenant$1> & typeof onAppInstanceAppInstalledOnTenant$1;
100
127
 
101
- export { AppInstanceAppInstalledOnTenantEnvelope, BulkUninstallAppOptions, BulkUninstallAppResponse, GetInstalledAppsResponse, InstallAppApplicationErrors, InstallAppFromShareUrlApplicationErrors, InstallAppFromShareUrlOptions, InstallAppFromShareUrlResponse, InstallAppOptions, InstallAppResponse, InstallTypeWithLiterals, IsPermittedToInstallAppsApplicationErrors, IsPermittedToInstallAppsOptions, IsPermittedToInstallAppsResponse, Tenant, UninstallAppOptions, bulkUninstallApp, getInstalledApps, installApp, installAppFromShareUrl, isPermittedToInstallApps, onAppInstanceAppInstalledOnTenant, uninstallApp };
128
+ export { AppInstanceAppInstalledOnTenantEnvelope, BulkInstallAppApplicationErrors, BulkInstallAppOptions, BulkInstallAppResponse, BulkUninstallAppOptions, BulkUninstallAppResponse, GetInstalledAppsResponse, InstallAppApplicationErrors, InstallAppFromShareUrlApplicationErrors, InstallAppFromShareUrlOptions, InstallAppFromShareUrlResponse, InstallAppOptions, InstallAppResponse, InstallTypeWithLiterals, IsPermittedToInstallAppsApplicationErrors, IsPermittedToInstallAppsOptions, IsPermittedToInstallAppsResponse, Tenant, UninstallAppOptions, bulkInstallApp, bulkUninstallApp, getInstalledApps, installApp, installAppFromShareUrl, isPermittedToInstallApps, onAppInstanceAppInstalledOnTenant, uninstallApp };
@@ -25,6 +25,7 @@ __export(index_exports, {
25
25
  Status: () => Status,
26
26
  TenantType: () => TenantType,
27
27
  WebhookIdentityType: () => WebhookIdentityType,
28
+ bulkInstallApp: () => bulkInstallApp4,
28
29
  bulkUninstallApp: () => bulkUninstallApp4,
29
30
  getInstalledApps: () => getInstalledApps4,
30
31
  installApp: () => installApp4,
@@ -119,6 +120,12 @@ function resolveWixDevcenterAppsInstallerV1AppsInstallerServiceUrl(opts) {
119
120
  srcPath: "/_api/apps-installer-service",
120
121
  destPath: ""
121
122
  }
123
+ ],
124
+ "vibe._base_domain_": [
125
+ {
126
+ srcPath: "/_api/apps-installer-service",
127
+ destPath: ""
128
+ }
122
129
  ]
123
130
  };
124
131
  return (0, import_rest_modules2.resolveUrl)(Object.assign(opts, { domainToMappings }));
@@ -140,6 +147,9 @@ function installApp(payload) {
140
147
  method: "POST",
141
148
  methodFqn: "wix.devcenter.apps.installer.v1.AppsInstallerService.InstallApp",
142
149
  packageName: PACKAGE_NAME,
150
+ migrationOptions: {
151
+ optInTransformResponse: true
152
+ },
143
153
  url: resolveWixDevcenterAppsInstallerV1AppsInstallerServiceUrl({
144
154
  protoPath: "/v1/app-instance/install",
145
155
  data: serializedData,
@@ -162,6 +172,56 @@ function installApp(payload) {
162
172
  }
163
173
  return __installApp;
164
174
  }
175
+ function bulkInstallApp(payload) {
176
+ function __bulkInstallApp({ host }) {
177
+ const serializedData = (0, import_transform_paths.transformPaths)(payload, [
178
+ {
179
+ transformFn: import_timestamp.transformSDKTimestampToRESTTimestamp,
180
+ paths: [
181
+ { path: "appInstances.installedDate" },
182
+ { path: "appInstances.updatedDate" }
183
+ ]
184
+ }
185
+ ]);
186
+ const metadata = {
187
+ entityFqdn: "wix.apps.v1.app_instance",
188
+ method: "POST",
189
+ methodFqn: "wix.devcenter.apps.installer.v1.AppsInstallerService.BulkInstallApp",
190
+ packageName: PACKAGE_NAME,
191
+ migrationOptions: {
192
+ optInTransformResponse: true
193
+ },
194
+ url: resolveWixDevcenterAppsInstallerV1AppsInstallerServiceUrl({
195
+ protoPath: "/v1/bulk/app-instance/install",
196
+ data: serializedData,
197
+ host
198
+ }),
199
+ data: serializedData,
200
+ transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
201
+ {
202
+ transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
203
+ paths: [
204
+ { path: "results.appInstance.installedDate" },
205
+ { path: "results.appInstance.updatedDate" }
206
+ ]
207
+ },
208
+ {
209
+ transformFn: import_float.transformRESTFloatToSDKFloat,
210
+ paths: [
211
+ {
212
+ path: "clientSpecMap.data.widgets.*.gluedOptions.verticalMargin"
213
+ },
214
+ {
215
+ path: "clientSpecMap.data.widgets.*.gluedOptions.horizontalMargin"
216
+ }
217
+ ]
218
+ }
219
+ ])
220
+ };
221
+ return metadata;
222
+ }
223
+ return __bulkInstallApp;
224
+ }
165
225
  function uninstallApp(payload) {
166
226
  function __uninstallApp({ host }) {
167
227
  const metadata = {
@@ -169,6 +229,9 @@ function uninstallApp(payload) {
169
229
  method: "POST",
170
230
  methodFqn: "wix.devcenter.apps.installer.v1.AppsInstallerService.UninstallApp",
171
231
  packageName: PACKAGE_NAME,
232
+ migrationOptions: {
233
+ optInTransformResponse: true
234
+ },
172
235
  url: resolveWixDevcenterAppsInstallerV1AppsInstallerServiceUrl({
173
236
  protoPath: "/v1/app-instance/uninstall",
174
237
  data: payload,
@@ -187,6 +250,9 @@ function bulkUninstallApp(payload) {
187
250
  method: "POST",
188
251
  methodFqn: "wix.devcenter.apps.installer.v1.AppsInstallerService.BulkUninstallApp",
189
252
  packageName: PACKAGE_NAME,
253
+ migrationOptions: {
254
+ optInTransformResponse: true
255
+ },
190
256
  url: resolveWixDevcenterAppsInstallerV1AppsInstallerServiceUrl({
191
257
  protoPath: "/v1/bulk/app-instance/uninstall",
192
258
  data: payload,
@@ -225,6 +291,9 @@ function installAppFromShareUrl(payload) {
225
291
  method: "POST",
226
292
  methodFqn: "wix.devcenter.apps.installer.v1.AppsInstallerService.InstallAppFromShareUrl",
227
293
  packageName: PACKAGE_NAME,
294
+ migrationOptions: {
295
+ optInTransformResponse: true
296
+ },
228
297
  url: resolveWixDevcenterAppsInstallerV1AppsInstallerServiceUrl({
229
298
  protoPath: "/v1/app-share-url/install",
230
299
  data: payload,
@@ -263,6 +332,9 @@ function isPermittedToInstallApps(payload) {
263
332
  method: "POST",
264
333
  methodFqn: "wix.devcenter.apps.installer.v1.AppsInstallerService.IsPermittedToInstallApps",
265
334
  packageName: PACKAGE_NAME,
335
+ migrationOptions: {
336
+ optInTransformResponse: true
337
+ },
266
338
  url: resolveWixDevcenterAppsInstallerV1AppsInstallerServiceUrl({
267
339
  protoPath: "/v1/app-instance/is-permitted-to-install",
268
340
  data: serializedData,
@@ -281,6 +353,9 @@ function getInstalledApps(payload) {
281
353
  method: "GET",
282
354
  methodFqn: "wix.devcenter.apps.installer.v1.AppsInstallerService.GetInstalledApps",
283
355
  packageName: PACKAGE_NAME,
356
+ migrationOptions: {
357
+ optInTransformResponse: true
358
+ },
284
359
  url: resolveWixDevcenterAppsInstallerV1AppsInstallerServiceUrl({
285
360
  protoPath: "/v1/app-instances",
286
361
  data: payload,
@@ -374,6 +449,35 @@ async function installApp2(tenant, options) {
374
449
  throw transformedError;
375
450
  }
376
451
  }
452
+ async function bulkInstallApp2(tenant, options) {
453
+ const { httpClient, sideEffects } = arguments[2];
454
+ const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
455
+ tenant,
456
+ appInstances: options?.appInstances
457
+ });
458
+ const reqOpts = bulkInstallApp(payload);
459
+ sideEffects?.onSiteCall?.();
460
+ try {
461
+ const result = await httpClient.request(reqOpts);
462
+ sideEffects?.onSuccess?.(result);
463
+ return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
464
+ } catch (err) {
465
+ const transformedError = (0, import_transform_error.transformError)(
466
+ err,
467
+ {
468
+ spreadPathsToArguments: {},
469
+ explicitPathsToArguments: {
470
+ tenant: "$[0]",
471
+ appInstances: "$[1].appInstances"
472
+ },
473
+ singleArgumentUnchanged: false
474
+ },
475
+ ["tenant", "options"]
476
+ );
477
+ sideEffects?.onError?.(err);
478
+ throw transformedError;
479
+ }
480
+ }
377
481
  async function uninstallApp2(options) {
378
482
  const { httpClient, sideEffects } = arguments[1];
379
483
  const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
@@ -526,6 +630,14 @@ function installApp3(httpClient) {
526
630
  { httpClient }
527
631
  );
528
632
  }
633
+ function bulkInstallApp3(httpClient) {
634
+ return (tenant, options) => bulkInstallApp2(
635
+ tenant,
636
+ options,
637
+ // @ts-ignore
638
+ { httpClient }
639
+ );
640
+ }
529
641
  function uninstallApp3(httpClient) {
530
642
  return (options) => uninstallApp2(
531
643
  options,
@@ -583,6 +695,7 @@ var onAppInstanceAppInstalledOnTenant = (0, import_sdk_types.EventDefinition)(
583
695
  var import_rest_modules3 = require("@wix/sdk-runtime/rest-modules");
584
696
  var import_event_definition_modules = require("@wix/sdk-runtime/event-definition-modules");
585
697
  var installApp4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(installApp3);
698
+ var bulkInstallApp4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(bulkInstallApp3);
586
699
  var uninstallApp4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(uninstallApp3);
587
700
  var bulkUninstallApp4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(bulkUninstallApp3);
588
701
  var installAppFromShareUrl4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(installAppFromShareUrl3);
@@ -598,6 +711,7 @@ var onAppInstanceAppInstalledOnTenant2 = (0, import_event_definition_modules.cre
598
711
  Status,
599
712
  TenantType,
600
713
  WebhookIdentityType,
714
+ bulkInstallApp,
601
715
  bulkUninstallApp,
602
716
  getInstalledApps,
603
717
  installApp,