@wix/auto_sdk_app-management_apps 1.0.5 → 1.0.6

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.
@@ -1,6 +1,6 @@
1
1
  import { HttpClient, NonNullablePaths, MaybeContext, BuildRESTFunction } from '@wix/sdk-types';
2
- import { V1App, GetAppOptions, UpdateApp, GenerateSlugResponse, GetNamespaceSuggestionOptions, GetNamespaceSuggestionResponse, GetNamespaceSuggestionByNameOptions, GetNamespaceSuggestionByNameResponse, SetNamespaceOptions, SetNamespaceResponse, CreateSecondarySecretOptions, CreateSecondarySecretResponse, SecretToRevokeWithLiterals, RevokeSecretResponse } from './index.typings.js';
3
- export { AccountInfo, Action, ActionEvent, ActionWithLiterals, ActivateSecondarySecretRequest, ActivateSecondarySecretResponse, AddressLocation, App, AppChangedEvent, AppComponentMetadata, AppOwnerChangedEvent, AppSecrets, AppSlugChanged, AppType, AppTypeWithLiterals, AppUriMessage, AppUrls, AppUrlsChangedInOldServiceEvent, AppUrlsChangedInOldServiceEventChangedUrlOneOf, AppVersionApproved, AppVersionArchived, AppVersionCreated, AppVersionDeclined, AppVersionDraftChanged, AppVersionPublished, AppVersionReleased, AppVersionStateChanged, AppVersionStateChangedStateOneOf, AppVersionSubmitted, AssociateServiceAppRequest, AssociateServiceAppResponse, CompanionAppOptions, ConsentOptions, ContactEmails, CreateAppRequest, CreateAppResponse, CreateSecondarySecretRequest, CreateServiceAppRequest, CreateServiceAppResponse, CreatedBy, CreatedByType, CreatedByTypeWithLiterals, CursorPaging, Cursors, DeleteAppRequest, DeleteAppResponse, DomainEvent, DomainEventBodyOneOf, Empty, EntityCreatedEvent, EntityDeletedEvent, EntityUpdatedEvent, ForceCascadeDeleteAppDecision, ForceCascadeDeleteAppDecisionWithLiterals, ForceCascadeDeleteAppRequest, ForceCascadeDeleteAppResponse, GenerateSlugRequest, GetAppRequest, GetAppResponse, GetNamespaceSuggestionByNameRequest, GetNamespaceSuggestionRequest, HostAppConfig, IdentificationData, IdentificationDataIdOneOf, InstallationPreferences, InstallationPreferencesOpenButtonOptionsOneOf, LoginPolicy, LoginPolicyWithLiterals, MessageEnvelope, NamespaceType, NamespaceTypeWithLiterals, OpenButtonAction, OpenButtonActionWithLiterals, OpenComponentId, Paging, PagingMetadataV2, PartialVersionOptions, PermissionLevel, PermissionLevelWithLiterals, QueryAppRequest, QueryAppResponse, QueryV2, QueryV2PagingMethodOneOf, RedirectTarget, RedirectTargetWithLiterals, RedirectUrlMessage, RenameCodeIdentifierRequest, RenameCodeIdentifierResponse, RenameSlugRequest, RenameSlugResponse, RequestedFields, RequestedFieldsWithLiterals, RestoreInfo, RevokeSecretRequest, RollbackSecretRequest, RollbackSecretResponse, RotateSecretRequest, RotateSecretResponse, SecretToRevoke, SetAppOwnerRequest, SetAppOwnerResponse, SetCacheableAppRequest, SetCacheableAppResponse, SetCodeIdentifierRequest, SetCodeIdentifierResponse, SetCompanionAppOptionsRequest, SetCompanionAppOptionsResponse, SetComponentsMetadataRequest, SetComponentsMetadataResponse, SetExceededSizeRequest, SetExceededSizeResponse, SetHipaaCompliantRequest, SetHipaaCompliantResponse, SetNamespaceRequest, SetOwnershipTagRequest, SetOwnershipTagResponse, SetPrivateAppRequest, SetPrivateAppResponse, ShowConsentBehaviour, ShowConsentBehaviourWithLiterals, SortOrder, SortOrderWithLiterals, Sorting, Status, StatusWithLiterals, SuggestCodeIdentifierRequest, SuggestCodeIdentifierResponse, TenantType, TenantTypeWithLiterals, UninstallActions, UninstallActionsWithLiterals, UnreleasedChanges, UpdateAppRequest, UpdateAppResponse, UpdateHostAppConfigRequest, UpdateHostAppConfigResponse, VersionStatus, VersionStatusWithLiterals, WebhookIdentityType, WebhookIdentityTypeWithLiterals } from './index.typings.js';
2
+ import { V1App, GetAppOptions, UpdateApp, GenerateSlugResponse, GetNamespaceSuggestionOptions, GetNamespaceSuggestionResponse, GetNamespaceSuggestionByNameOptions, GetNamespaceSuggestionByNameResponse, SetNamespaceOptions, SetNamespaceResponse } from './index.typings.js';
3
+ export { AccountInfo, Action, ActionEvent, ActionWithLiterals, ActivateSecondarySecretRequest, ActivateSecondarySecretResponse, AddressLocation, App, AppChangedEvent, AppComponentMetadata, AppOwnerChangedEvent, AppSecrets, AppSlugChanged, AppType, AppTypeWithLiterals, AppUriMessage, AppUrls, AppUrlsChangedInOldServiceEvent, AppUrlsChangedInOldServiceEventChangedUrlOneOf, AppVersionApproved, AppVersionArchived, AppVersionCreated, AppVersionDeclined, AppVersionDraftChanged, AppVersionPublished, AppVersionReleased, AppVersionStateChanged, AppVersionStateChangedStateOneOf, AppVersionSubmitted, AssociateServiceAppRequest, AssociateServiceAppResponse, CompanionAppOptions, ConsentOptions, ContactEmails, CreateAppRequest, CreateAppResponse, CreateSecondarySecretRequest, CreateSecondarySecretResponse, CreateServiceAppRequest, CreateServiceAppResponse, CreatedBy, CreatedByType, CreatedByTypeWithLiterals, CursorPaging, Cursors, DeleteAppRequest, DeleteAppResponse, DomainEvent, DomainEventBodyOneOf, Empty, EntityCreatedEvent, EntityDeletedEvent, EntityUpdatedEvent, ForceCascadeDeleteAppDecision, ForceCascadeDeleteAppDecisionWithLiterals, ForceCascadeDeleteAppRequest, ForceCascadeDeleteAppResponse, GenerateSlugRequest, GetAppRequest, GetAppResponse, GetNamespaceSuggestionByNameRequest, GetNamespaceSuggestionRequest, HostAppConfig, IdentificationData, IdentificationDataIdOneOf, InstallationPreferences, InstallationPreferencesOpenButtonOptionsOneOf, LoginPolicy, LoginPolicyWithLiterals, MessageEnvelope, NamespaceType, NamespaceTypeWithLiterals, OpenButtonAction, OpenButtonActionWithLiterals, OpenComponentId, Paging, PagingMetadataV2, PartialVersionOptions, PermissionLevel, PermissionLevelWithLiterals, QueryAppRequest, QueryAppResponse, QueryV2, QueryV2PagingMethodOneOf, RedirectTarget, RedirectTargetWithLiterals, RedirectUrlMessage, RenameCodeIdentifierRequest, RenameCodeIdentifierResponse, RenameSlugRequest, RenameSlugResponse, RequestedFields, RequestedFieldsWithLiterals, RestoreInfo, RevokeSecretRequest, RevokeSecretResponse, RollbackSecretRequest, RollbackSecretResponse, RotateSecretRequest, RotateSecretResponse, SecretToRevoke, SecretToRevokeWithLiterals, SetAppOwnerRequest, SetAppOwnerResponse, SetCacheableAppRequest, SetCacheableAppResponse, SetCodeIdentifierRequest, SetCodeIdentifierResponse, SetCompanionAppOptionsRequest, SetCompanionAppOptionsResponse, SetComponentsMetadataRequest, SetComponentsMetadataResponse, SetExceededSizeRequest, SetExceededSizeResponse, SetHipaaCompliantRequest, SetHipaaCompliantResponse, SetNamespaceRequest, SetOwnershipTagRequest, SetOwnershipTagResponse, SetPrivateAppRequest, SetPrivateAppResponse, ShowConsentBehaviour, ShowConsentBehaviourWithLiterals, SortOrder, SortOrderWithLiterals, Sorting, Status, StatusWithLiterals, SuggestCodeIdentifierRequest, SuggestCodeIdentifierResponse, TenantType, TenantTypeWithLiterals, UninstallActions, UninstallActionsWithLiterals, UnreleasedChanges, UpdateAppRequest, UpdateAppResponse, UpdateHostAppConfigRequest, UpdateHostAppConfigResponse, VersionStatus, VersionStatusWithLiterals, WebhookIdentityType, WebhookIdentityTypeWithLiterals } from './index.typings.js';
4
4
 
5
5
  declare function createApp$1(httpClient: HttpClient): CreateAppSignature;
6
6
  interface CreateAppSignature {
@@ -36,11 +36,17 @@ interface UpdateAppSignature {
36
36
  * when updating the app. This ensures you're working with the latest app and prevents unintended overwrites.
37
37
  * Supports partial updates; specify the app's ID and the fields to change.
38
38
  *
39
+ * In REST requests, explicitly set `mask.paths` to only the fields to
40
+ * change, such as `["name"]`, excluding `id` and `revision`. Supply the app ID in the URL
41
+ * and the current revision in the request body.
42
+ * The published SDK's `apps.updateApp()` does not expose a field-mask argument. Use the
43
+ * SDK-authenticated REST workaround shown in this method's SDK example, which sends an
44
+ * explicit mask with `fetchWithAuth` from `@wix/sdk/context`.
45
+ *
39
46
  * This method cannot update `appSecrets`, `accountId`, `namespace`, `slug`, `createdBy`,
40
47
  * `companionApp`, or `codeIdentifier`. Including any of these fields or their nested fields in the
41
48
  * request causes the entire request to fail; they aren't silently ignored.
42
- * Use Set Namespace to assign a namespace and Generate Slug to generate a slug. To rotate app
43
- * secrets, use Create Secondary Secret and Revoke Secret. This method does not support changing
49
+ * Use Set Namespace to assign a namespace and Generate Slug to generate a slug. This method does not support changing
44
50
  * the owning account, creator, companion-app designation, or code identifier.
45
51
  *
46
52
  * Changing `status` requires additional status-change authorization beyond permission to update other fields.
@@ -105,29 +111,6 @@ interface SetNamespaceSignature {
105
111
  */
106
112
  (appId: string, appName: string, options?: SetNamespaceOptions): Promise<NonNullablePaths<SetNamespaceResponse, `namespace`, 0>>;
107
113
  }
108
- declare function createSecondarySecret$1(httpClient: HttpClient): CreateSecondarySecretSignature;
109
- interface CreateSecondarySecretSignature {
110
- /**
111
- * Shares WIX_DEVELOPERS.MODIFY_APP with the sibling app-write RPCs, which declare no audience
112
- * (adding one here would break consistent-audience-for-shared-permission across all of them).
113
- * Renaming the permission would change who is actually authorized, so it stays as-is —
114
- * the real check is the MANUAL validateUpdateAppPermission(...) in code.
115
- * @param - App ID.
116
- */
117
- (appId: string, options?: CreateSecondarySecretOptions): Promise<NonNullablePaths<CreateSecondarySecretResponse, `app.name` | `app.appSecrets.appSecret` | `app.appSecrets.webhookPublicKey` | `app.appSecrets.secondarySecretActive` | `app.status` | `app.appUrls.redirectUris` | `app.appUrls.postInstallationUrls` | `app.createdBy._id` | `app.createdBy.type` | `app.installationPreferences.openComponentIdOptions.componentId` | `app.installationPreferences.overridePostInstallationRedirect` | `app.installationPreferences.openButtonAction` | `app.installationPreferences.uninstallAction` | `app.unreleasedChanges.componentsChanges` | `app.unreleasedChanges.appTranslationsChanges` | `app.unreleasedChanges.componentsTranslationChanges` | `app.unreleasedChanges.appPermissionsChanges` | `app.unreleasedChanges.appEntityChanges`, 3>>;
118
- }
119
- declare function revokeSecret$1(httpClient: HttpClient): RevokeSecretSignature;
120
- interface RevokeSecretSignature {
121
- /**
122
- * Shares WIX_DEVELOPERS.MODIFY_APP with the sibling app-write RPCs, which declare no audience
123
- * (adding one here would break consistent-audience-for-shared-permission across all of them).
124
- * Renaming the permission would change who is actually authorized, so it stays as-is —
125
- * the real check is the MANUAL validateUpdateAppPermission(...) in code.
126
- * @param - App ID.
127
- * @param - Credential to revoke. The app must have both a previous and a replacement secret.
128
- */
129
- (appId: string, secretToRevoke: SecretToRevokeWithLiterals): Promise<RevokeSecretResponse>;
130
- }
131
114
 
132
115
  declare const createApp: MaybeContext<BuildRESTFunction<typeof createApp$1> & typeof createApp$1>;
133
116
  declare const getApp: MaybeContext<BuildRESTFunction<typeof getApp$1> & typeof getApp$1>;
@@ -136,7 +119,5 @@ declare const generateSlug: MaybeContext<BuildRESTFunction<typeof generateSlug$1
136
119
  declare const getNamespaceSuggestion: MaybeContext<BuildRESTFunction<typeof getNamespaceSuggestion$1> & typeof getNamespaceSuggestion$1>;
137
120
  declare const getNamespaceSuggestionByName: MaybeContext<BuildRESTFunction<typeof getNamespaceSuggestionByName$1> & typeof getNamespaceSuggestionByName$1>;
138
121
  declare const setNamespace: MaybeContext<BuildRESTFunction<typeof setNamespace$1> & typeof setNamespace$1>;
139
- declare const createSecondarySecret: MaybeContext<BuildRESTFunction<typeof createSecondarySecret$1> & typeof createSecondarySecret$1>;
140
- declare const revokeSecret: MaybeContext<BuildRESTFunction<typeof revokeSecret$1> & typeof revokeSecret$1>;
141
122
 
142
- export { CreateSecondarySecretOptions, CreateSecondarySecretResponse, GenerateSlugResponse, GetAppOptions, GetNamespaceSuggestionByNameOptions, GetNamespaceSuggestionByNameResponse, GetNamespaceSuggestionOptions, GetNamespaceSuggestionResponse, RevokeSecretResponse, SecretToRevokeWithLiterals, SetNamespaceOptions, SetNamespaceResponse, UpdateApp, V1App, createApp, createSecondarySecret, generateSlug, getApp, getNamespaceSuggestion, getNamespaceSuggestionByName, revokeSecret, setNamespace, updateApp };
123
+ export { GenerateSlugResponse, GetAppOptions, GetNamespaceSuggestionByNameOptions, GetNamespaceSuggestionByNameResponse, GetNamespaceSuggestionOptions, GetNamespaceSuggestionResponse, SetNamespaceOptions, SetNamespaceResponse, UpdateApp, V1App, createApp, generateSlug, getApp, getNamespaceSuggestion, getNamespaceSuggestionByName, setNamespace, updateApp };
@@ -39,12 +39,10 @@ __export(index_exports, {
39
39
  VersionStatus: () => VersionStatus,
40
40
  WebhookIdentityType: () => WebhookIdentityType,
41
41
  createApp: () => createApp4,
42
- createSecondarySecret: () => createSecondarySecret4,
43
42
  generateSlug: () => generateSlug4,
44
43
  getApp: () => getApp4,
45
44
  getNamespaceSuggestion: () => getNamespaceSuggestion4,
46
45
  getNamespaceSuggestionByName: () => getNamespaceSuggestionByName4,
47
- revokeSecret: () => revokeSecret4,
48
46
  setNamespace: () => setNamespace4,
49
47
  updateApp: () => updateApp4
50
48
  });
@@ -67,7 +65,6 @@ var TRANSFORM_PATHS_0 = [
67
65
  { path: "app.appSecrets.previousSecretRevokeDate" }
68
66
  ];
69
67
  var TRANSFORM_PATHS_1 = [{ path: "mask" }];
70
- var TRANSFORM_PATHS_2 = [{ path: "previousSecretRevokeAt" }];
71
68
  function resolveWixDevcenterAppsV1AppsServiceUrl(opts) {
72
69
  const domainToMappings = {
73
70
  "editor._base_domain_": [
@@ -355,60 +352,6 @@ function setNamespace(payload) {
355
352
  }
356
353
  return __setNamespace;
357
354
  }
358
- function createSecondarySecret(payload) {
359
- function __createSecondarySecret({ host }) {
360
- const metadata = {
361
- entityFqdn: "wix.devcenter.apps.v1.app",
362
- method: "POST",
363
- methodFqn: "wix.devcenter.apps.v1.AppsService.CreateSecondarySecret",
364
- packageName: PACKAGE_NAME,
365
- migrationOptions: {
366
- optInTransformResponse: true
367
- },
368
- url: resolveWixDevcenterAppsV1AppsServiceUrl({
369
- protoPath: "/v1/apps/{appId}/secrets/secondary",
370
- data: payload,
371
- host
372
- }),
373
- data: payload,
374
- transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
375
- {
376
- transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
377
- paths: TRANSFORM_PATHS_0
378
- }
379
- ])
380
- };
381
- return metadata;
382
- }
383
- return __createSecondarySecret;
384
- }
385
- function revokeSecret(payload) {
386
- function __revokeSecret({ host }) {
387
- const metadata = {
388
- entityFqdn: "wix.devcenter.apps.v1.app",
389
- method: "POST",
390
- methodFqn: "wix.devcenter.apps.v1.AppsService.RevokeSecret",
391
- packageName: PACKAGE_NAME,
392
- migrationOptions: {
393
- optInTransformResponse: true
394
- },
395
- url: resolveWixDevcenterAppsV1AppsServiceUrl({
396
- protoPath: "/v1/apps/{appId}/secrets/revoke",
397
- data: payload,
398
- host
399
- }),
400
- data: payload,
401
- transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
402
- {
403
- transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
404
- paths: TRANSFORM_PATHS_2
405
- }
406
- ])
407
- };
408
- return metadata;
409
- }
410
- return __revokeSecret;
411
- }
412
355
 
413
356
  // src/devcenter-apps-v1-app-apps.universal.ts
414
357
  var Status = /* @__PURE__ */ ((Status2) => {
@@ -557,7 +500,6 @@ async function getApp2(appId, options) {
557
500
  const { httpClient, sideEffects } = arguments[2];
558
501
  const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
559
502
  appId,
560
- consistent: options?.consistent,
561
503
  additionalFields: options?.additionalFields
562
504
  });
563
505
  const reqOpts = getApp(payload);
@@ -573,7 +515,6 @@ async function getApp2(appId, options) {
573
515
  spreadPathsToArguments: {},
574
516
  explicitPathsToArguments: {
575
517
  appId: "$[0]",
576
- consistent: "$[1].consistent",
577
518
  additionalFields: "$[1].additionalFields"
578
519
  },
579
520
  singleArgumentUnchanged: false
@@ -715,58 +656,6 @@ async function setNamespace2(appId, appName, options) {
715
656
  throw transformedError;
716
657
  }
717
658
  }
718
- async function createSecondarySecret2(appId, options) {
719
- const { httpClient, sideEffects } = arguments[2];
720
- const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
721
- appId,
722
- revision: options?.revision
723
- });
724
- const reqOpts = createSecondarySecret(payload);
725
- sideEffects?.onSiteCall?.();
726
- try {
727
- const result = await httpClient.request(reqOpts);
728
- sideEffects?.onSuccess?.(result);
729
- return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
730
- } catch (err) {
731
- const transformedError = (0, import_transform_error.transformError)(
732
- err,
733
- {
734
- spreadPathsToArguments: {},
735
- explicitPathsToArguments: { appId: "$[0]", revision: "$[1].revision" },
736
- singleArgumentUnchanged: false
737
- },
738
- ["appId", "options"]
739
- );
740
- sideEffects?.onError?.(err);
741
- throw transformedError;
742
- }
743
- }
744
- async function revokeSecret2(appId, secretToRevoke) {
745
- const { httpClient, sideEffects } = arguments[2];
746
- const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
747
- appId,
748
- secretToRevoke
749
- });
750
- const reqOpts = revokeSecret(payload);
751
- sideEffects?.onSiteCall?.();
752
- try {
753
- const result = await httpClient.request(reqOpts);
754
- sideEffects?.onSuccess?.(result);
755
- return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
756
- } catch (err) {
757
- const transformedError = (0, import_transform_error.transformError)(
758
- err,
759
- {
760
- spreadPathsToArguments: {},
761
- explicitPathsToArguments: { appId: "$[0]", secretToRevoke: "$[1]" },
762
- singleArgumentUnchanged: false
763
- },
764
- ["appId", "secretToRevoke"]
765
- );
766
- sideEffects?.onError?.(err);
767
- throw transformedError;
768
- }
769
- }
770
659
 
771
660
  // src/devcenter-apps-v1-app-apps.public.ts
772
661
  function createApp3(httpClient) {
@@ -824,22 +713,6 @@ function setNamespace3(httpClient) {
824
713
  { httpClient }
825
714
  );
826
715
  }
827
- function createSecondarySecret3(httpClient) {
828
- return (appId, options) => createSecondarySecret2(
829
- appId,
830
- options,
831
- // @ts-ignore
832
- { httpClient }
833
- );
834
- }
835
- function revokeSecret3(httpClient) {
836
- return (appId, secretToRevoke) => revokeSecret2(
837
- appId,
838
- secretToRevoke,
839
- // @ts-ignore
840
- { httpClient }
841
- );
842
- }
843
716
 
844
717
  // src/devcenter-apps-v1-app-apps.context.ts
845
718
  var import_rest_modules3 = require("@wix/sdk-runtime/rest-modules");
@@ -850,8 +723,6 @@ var generateSlug4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(g
850
723
  var getNamespaceSuggestion4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(getNamespaceSuggestion3);
851
724
  var getNamespaceSuggestionByName4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(getNamespaceSuggestionByName3);
852
725
  var setNamespace4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(setNamespace3);
853
- var createSecondarySecret4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(createSecondarySecret3);
854
- var revokeSecret4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(revokeSecret3);
855
726
  // Annotate the CommonJS export names for ESM import in node:
856
727
  0 && (module.exports = {
857
728
  Action,
@@ -873,12 +744,10 @@ var revokeSecret4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(r
873
744
  VersionStatus,
874
745
  WebhookIdentityType,
875
746
  createApp,
876
- createSecondarySecret,
877
747
  generateSlug,
878
748
  getApp,
879
749
  getNamespaceSuggestion,
880
750
  getNamespaceSuggestionByName,
881
- revokeSecret,
882
751
  setNamespace,
883
752
  updateApp
884
753
  });