@wix/auto_sdk_app-management_apps 1.0.4 → 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_": [
@@ -157,6 +154,12 @@ function resolveWixDevcenterAppsV1AppsServiceUrl(opts) {
157
154
  srcPath: "/apps/v1/apps",
158
155
  destPath: "/v1/apps"
159
156
  }
157
+ ],
158
+ "api._api_base_domain_": [
159
+ {
160
+ srcPath: "/apps-service",
161
+ destPath: ""
162
+ }
160
163
  ]
161
164
  };
162
165
  return (0, import_rest_modules2.resolveUrl)(Object.assign(opts, { domainToMappings }));
@@ -349,60 +352,6 @@ function setNamespace(payload) {
349
352
  }
350
353
  return __setNamespace;
351
354
  }
352
- function createSecondarySecret(payload) {
353
- function __createSecondarySecret({ host }) {
354
- const metadata = {
355
- entityFqdn: "wix.devcenter.apps.v1.app",
356
- method: "POST",
357
- methodFqn: "wix.devcenter.apps.v1.AppsService.CreateSecondarySecret",
358
- packageName: PACKAGE_NAME,
359
- migrationOptions: {
360
- optInTransformResponse: true
361
- },
362
- url: resolveWixDevcenterAppsV1AppsServiceUrl({
363
- protoPath: "/v1/apps/{appId}/secrets/secondary",
364
- data: payload,
365
- host
366
- }),
367
- data: payload,
368
- transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
369
- {
370
- transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
371
- paths: TRANSFORM_PATHS_0
372
- }
373
- ])
374
- };
375
- return metadata;
376
- }
377
- return __createSecondarySecret;
378
- }
379
- function revokeSecret(payload) {
380
- function __revokeSecret({ host }) {
381
- const metadata = {
382
- entityFqdn: "wix.devcenter.apps.v1.app",
383
- method: "POST",
384
- methodFqn: "wix.devcenter.apps.v1.AppsService.RevokeSecret",
385
- packageName: PACKAGE_NAME,
386
- migrationOptions: {
387
- optInTransformResponse: true
388
- },
389
- url: resolveWixDevcenterAppsV1AppsServiceUrl({
390
- protoPath: "/v1/apps/{appId}/secrets/revoke",
391
- data: payload,
392
- host
393
- }),
394
- data: payload,
395
- transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
396
- {
397
- transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
398
- paths: TRANSFORM_PATHS_2
399
- }
400
- ])
401
- };
402
- return metadata;
403
- }
404
- return __revokeSecret;
405
- }
406
355
 
407
356
  // src/devcenter-apps-v1-app-apps.universal.ts
408
357
  var Status = /* @__PURE__ */ ((Status2) => {
@@ -551,7 +500,6 @@ async function getApp2(appId, options) {
551
500
  const { httpClient, sideEffects } = arguments[2];
552
501
  const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
553
502
  appId,
554
- consistent: options?.consistent,
555
503
  additionalFields: options?.additionalFields
556
504
  });
557
505
  const reqOpts = getApp(payload);
@@ -567,7 +515,6 @@ async function getApp2(appId, options) {
567
515
  spreadPathsToArguments: {},
568
516
  explicitPathsToArguments: {
569
517
  appId: "$[0]",
570
- consistent: "$[1].consistent",
571
518
  additionalFields: "$[1].additionalFields"
572
519
  },
573
520
  singleArgumentUnchanged: false
@@ -709,58 +656,6 @@ async function setNamespace2(appId, appName, options) {
709
656
  throw transformedError;
710
657
  }
711
658
  }
712
- async function createSecondarySecret2(appId, options) {
713
- const { httpClient, sideEffects } = arguments[2];
714
- const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
715
- appId,
716
- revision: options?.revision
717
- });
718
- const reqOpts = createSecondarySecret(payload);
719
- sideEffects?.onSiteCall?.();
720
- try {
721
- const result = await httpClient.request(reqOpts);
722
- sideEffects?.onSuccess?.(result);
723
- return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
724
- } catch (err) {
725
- const transformedError = (0, import_transform_error.transformError)(
726
- err,
727
- {
728
- spreadPathsToArguments: {},
729
- explicitPathsToArguments: { appId: "$[0]", revision: "$[1].revision" },
730
- singleArgumentUnchanged: false
731
- },
732
- ["appId", "options"]
733
- );
734
- sideEffects?.onError?.(err);
735
- throw transformedError;
736
- }
737
- }
738
- async function revokeSecret2(appId, secretToRevoke) {
739
- const { httpClient, sideEffects } = arguments[2];
740
- const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
741
- appId,
742
- secretToRevoke
743
- });
744
- const reqOpts = revokeSecret(payload);
745
- sideEffects?.onSiteCall?.();
746
- try {
747
- const result = await httpClient.request(reqOpts);
748
- sideEffects?.onSuccess?.(result);
749
- return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
750
- } catch (err) {
751
- const transformedError = (0, import_transform_error.transformError)(
752
- err,
753
- {
754
- spreadPathsToArguments: {},
755
- explicitPathsToArguments: { appId: "$[0]", secretToRevoke: "$[1]" },
756
- singleArgumentUnchanged: false
757
- },
758
- ["appId", "secretToRevoke"]
759
- );
760
- sideEffects?.onError?.(err);
761
- throw transformedError;
762
- }
763
- }
764
659
 
765
660
  // src/devcenter-apps-v1-app-apps.public.ts
766
661
  function createApp3(httpClient) {
@@ -818,22 +713,6 @@ function setNamespace3(httpClient) {
818
713
  { httpClient }
819
714
  );
820
715
  }
821
- function createSecondarySecret3(httpClient) {
822
- return (appId, options) => createSecondarySecret2(
823
- appId,
824
- options,
825
- // @ts-ignore
826
- { httpClient }
827
- );
828
- }
829
- function revokeSecret3(httpClient) {
830
- return (appId, secretToRevoke) => revokeSecret2(
831
- appId,
832
- secretToRevoke,
833
- // @ts-ignore
834
- { httpClient }
835
- );
836
- }
837
716
 
838
717
  // src/devcenter-apps-v1-app-apps.context.ts
839
718
  var import_rest_modules3 = require("@wix/sdk-runtime/rest-modules");
@@ -844,8 +723,6 @@ var generateSlug4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(g
844
723
  var getNamespaceSuggestion4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(getNamespaceSuggestion3);
845
724
  var getNamespaceSuggestionByName4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(getNamespaceSuggestionByName3);
846
725
  var setNamespace4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(setNamespace3);
847
- var createSecondarySecret4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(createSecondarySecret3);
848
- var revokeSecret4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(revokeSecret3);
849
726
  // Annotate the CommonJS export names for ESM import in node:
850
727
  0 && (module.exports = {
851
728
  Action,
@@ -867,12 +744,10 @@ var revokeSecret4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(r
867
744
  VersionStatus,
868
745
  WebhookIdentityType,
869
746
  createApp,
870
- createSecondarySecret,
871
747
  generateSlug,
872
748
  getApp,
873
749
  getNamespaceSuggestion,
874
750
  getNamespaceSuggestionByName,
875
- revokeSecret,
876
751
  setNamespace,
877
752
  updateApp
878
753
  });