@wix/auto_sdk_portfolio_project-items 1.0.52 → 1.0.53

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.
@@ -156,6 +156,177 @@ interface Link {
156
156
  */
157
157
  target?: string | null;
158
158
  }
159
+ interface GenerateTokenForProjectItemsRequest {
160
+ /**
161
+ * Media ids of requested project items
162
+ * @minSize 1
163
+ * @maxLength 100
164
+ */
165
+ mediaIds: string[];
166
+ }
167
+ interface GenerateTokenForProjectItemsResponse {
168
+ /** Generated media tokens for project items */
169
+ mediaTokens?: ProjectItemMediaToken[];
170
+ }
171
+ interface ProjectItemMediaToken {
172
+ /** Media id of project item */
173
+ mediaId?: string;
174
+ /** Generated media token for project item */
175
+ mediaToken?: string;
176
+ }
177
+ interface DomainEvent extends DomainEventBodyOneOf {
178
+ createdEvent?: EntityCreatedEvent;
179
+ updatedEvent?: EntityUpdatedEvent;
180
+ deletedEvent?: EntityDeletedEvent;
181
+ actionEvent?: ActionEvent;
182
+ /** Event ID. With this ID you can easily spot duplicated events and ignore them. */
183
+ _id?: string;
184
+ /**
185
+ * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities.
186
+ * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.
187
+ */
188
+ entityFqdn?: string;
189
+ /**
190
+ * Event action name, placed at the top level to make it easier for users to dispatch messages.
191
+ * For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.
192
+ */
193
+ slug?: string;
194
+ /** ID of the entity associated with the event. */
195
+ entityId?: string;
196
+ /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */
197
+ eventTime?: Date | null;
198
+ /**
199
+ * Whether the event was triggered as a result of a privacy regulation application
200
+ * (for example, GDPR).
201
+ */
202
+ triggeredByAnonymizeRequest?: boolean | null;
203
+ /** If present, indicates the action that triggered the event. */
204
+ originatedFrom?: string | null;
205
+ /**
206
+ * A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at `16:00` and then again at `16:01`, the second update will always have a higher sequence number.
207
+ * You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it.
208
+ */
209
+ entityEventSequence?: string | null;
210
+ }
211
+ /** @oneof */
212
+ interface DomainEventBodyOneOf {
213
+ createdEvent?: EntityCreatedEvent;
214
+ updatedEvent?: EntityUpdatedEvent;
215
+ deletedEvent?: EntityDeletedEvent;
216
+ actionEvent?: ActionEvent;
217
+ }
218
+ interface EntityCreatedEvent {
219
+ entity?: string;
220
+ }
221
+ interface RestoreInfo {
222
+ deletedDate?: Date | null;
223
+ }
224
+ interface EntityUpdatedEvent {
225
+ /**
226
+ * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.
227
+ * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.
228
+ * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.
229
+ */
230
+ currentEntity?: string;
231
+ }
232
+ interface EntityDeletedEvent {
233
+ /** Entity that was deleted. */
234
+ deletedEntity?: string | null;
235
+ }
236
+ interface ActionEvent {
237
+ body?: string;
238
+ }
239
+ interface MessageEnvelope {
240
+ /**
241
+ * App instance ID.
242
+ * @format GUID
243
+ */
244
+ instanceId?: string | null;
245
+ /**
246
+ * Event type.
247
+ * @maxLength 150
248
+ */
249
+ eventType?: string;
250
+ /** The identification type and identity data. */
251
+ identity?: IdentificationData;
252
+ /** Stringify payload. */
253
+ data?: string;
254
+ /** Details related to the account */
255
+ accountInfo?: AccountInfo;
256
+ }
257
+ interface IdentificationData extends IdentificationDataIdOneOf {
258
+ /**
259
+ * ID of a site visitor that has not logged in to the site.
260
+ * @format GUID
261
+ */
262
+ anonymousVisitorId?: string;
263
+ /**
264
+ * ID of a site visitor that has logged in to the site.
265
+ * @format GUID
266
+ */
267
+ memberId?: string;
268
+ /**
269
+ * ID of a Wix user (site owner, contributor, etc.).
270
+ * @format GUID
271
+ */
272
+ wixUserId?: string;
273
+ /**
274
+ * ID of an app.
275
+ * @format GUID
276
+ */
277
+ appId?: string;
278
+ /** @readonly */
279
+ identityType?: WebhookIdentityTypeWithLiterals;
280
+ }
281
+ /** @oneof */
282
+ interface IdentificationDataIdOneOf {
283
+ /**
284
+ * ID of a site visitor that has not logged in to the site.
285
+ * @format GUID
286
+ */
287
+ anonymousVisitorId?: string;
288
+ /**
289
+ * ID of a site visitor that has logged in to the site.
290
+ * @format GUID
291
+ */
292
+ memberId?: string;
293
+ /**
294
+ * ID of a Wix user (site owner, contributor, etc.).
295
+ * @format GUID
296
+ */
297
+ wixUserId?: string;
298
+ /**
299
+ * ID of an app.
300
+ * @format GUID
301
+ */
302
+ appId?: string;
303
+ }
304
+ declare enum WebhookIdentityType {
305
+ UNKNOWN = "UNKNOWN",
306
+ ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR",
307
+ MEMBER = "MEMBER",
308
+ WIX_USER = "WIX_USER",
309
+ APP = "APP"
310
+ }
311
+ /** @enumType */
312
+ type WebhookIdentityTypeWithLiterals = WebhookIdentityType | 'UNKNOWN' | 'ANONYMOUS_VISITOR' | 'MEMBER' | 'WIX_USER' | 'APP';
313
+ interface AccountInfo {
314
+ /**
315
+ * ID of the Wix account associated with the event.
316
+ * @format GUID
317
+ */
318
+ accountId?: string | null;
319
+ /**
320
+ * ID of the parent Wix account. Only included when accountId belongs to a child account.
321
+ * @format GUID
322
+ */
323
+ parentAccountId?: string | null;
324
+ /**
325
+ * ID of the Wix site associated with the event. Only included when the event is tied to a specific site.
326
+ * @format GUID
327
+ */
328
+ siteId?: string | null;
329
+ }
159
330
  interface InvalidateCache extends InvalidateCacheGetByOneOf {
160
331
  /**
161
332
  * Invalidate by msId. NOT recommended, as this will invalidate the entire site cache!
@@ -621,68 +792,6 @@ interface CreateProjectGalleryResponse {
621
792
  */
622
793
  galleryId?: string;
623
794
  }
624
- interface DomainEvent extends DomainEventBodyOneOf {
625
- createdEvent?: EntityCreatedEvent;
626
- updatedEvent?: EntityUpdatedEvent;
627
- deletedEvent?: EntityDeletedEvent;
628
- actionEvent?: ActionEvent;
629
- /** Event ID. With this ID you can easily spot duplicated events and ignore them. */
630
- _id?: string;
631
- /**
632
- * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities.
633
- * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.
634
- */
635
- entityFqdn?: string;
636
- /**
637
- * Event action name, placed at the top level to make it easier for users to dispatch messages.
638
- * For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.
639
- */
640
- slug?: string;
641
- /** ID of the entity associated with the event. */
642
- entityId?: string;
643
- /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */
644
- eventTime?: Date | null;
645
- /**
646
- * Whether the event was triggered as a result of a privacy regulation application
647
- * (for example, GDPR).
648
- */
649
- triggeredByAnonymizeRequest?: boolean | null;
650
- /** If present, indicates the action that triggered the event. */
651
- originatedFrom?: string | null;
652
- /**
653
- * A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at `16:00` and then again at `16:01`, the second update will always have a higher sequence number.
654
- * You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it.
655
- */
656
- entityEventSequence?: string | null;
657
- }
658
- /** @oneof */
659
- interface DomainEventBodyOneOf {
660
- createdEvent?: EntityCreatedEvent;
661
- updatedEvent?: EntityUpdatedEvent;
662
- deletedEvent?: EntityDeletedEvent;
663
- actionEvent?: ActionEvent;
664
- }
665
- interface EntityCreatedEvent {
666
- entity?: string;
667
- }
668
- interface RestoreInfo {
669
- deletedDate?: Date | null;
670
- }
671
- interface EntityUpdatedEvent {
672
- /**
673
- * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.
674
- * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.
675
- * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.
676
- */
677
- currentEntity?: string;
678
- }
679
- interface EntityDeletedEvent {
680
- /** Entity that was deleted. */
681
- deletedEntity?: string | null;
682
- }
683
- interface ActionEvent {
684
- body?: string;
685
- }
686
795
  interface Empty {
687
796
  }
688
797
  interface DeletedProjectRestored {
@@ -721,115 +830,6 @@ interface CloneFromOriginRequest {
721
830
  }
722
831
  interface CloneFromOriginResponse {
723
832
  }
724
- interface MessageEnvelope {
725
- /**
726
- * App instance ID.
727
- * @format GUID
728
- */
729
- instanceId?: string | null;
730
- /**
731
- * Event type.
732
- * @maxLength 150
733
- */
734
- eventType?: string;
735
- /** The identification type and identity data. */
736
- identity?: IdentificationData;
737
- /** Stringify payload. */
738
- data?: string;
739
- /** Details related to the account */
740
- accountInfo?: AccountInfo;
741
- }
742
- interface IdentificationData extends IdentificationDataIdOneOf {
743
- /**
744
- * ID of a site visitor that has not logged in to the site.
745
- * @format GUID
746
- */
747
- anonymousVisitorId?: string;
748
- /**
749
- * ID of a site visitor that has logged in to the site.
750
- * @format GUID
751
- */
752
- memberId?: string;
753
- /**
754
- * ID of a Wix user (site owner, contributor, etc.).
755
- * @format GUID
756
- */
757
- wixUserId?: string;
758
- /**
759
- * ID of an app.
760
- * @format GUID
761
- */
762
- appId?: string;
763
- /** @readonly */
764
- identityType?: WebhookIdentityTypeWithLiterals;
765
- }
766
- /** @oneof */
767
- interface IdentificationDataIdOneOf {
768
- /**
769
- * ID of a site visitor that has not logged in to the site.
770
- * @format GUID
771
- */
772
- anonymousVisitorId?: string;
773
- /**
774
- * ID of a site visitor that has logged in to the site.
775
- * @format GUID
776
- */
777
- memberId?: string;
778
- /**
779
- * ID of a Wix user (site owner, contributor, etc.).
780
- * @format GUID
781
- */
782
- wixUserId?: string;
783
- /**
784
- * ID of an app.
785
- * @format GUID
786
- */
787
- appId?: string;
788
- }
789
- declare enum WebhookIdentityType {
790
- UNKNOWN = "UNKNOWN",
791
- ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR",
792
- MEMBER = "MEMBER",
793
- WIX_USER = "WIX_USER",
794
- APP = "APP"
795
- }
796
- /** @enumType */
797
- type WebhookIdentityTypeWithLiterals = WebhookIdentityType | 'UNKNOWN' | 'ANONYMOUS_VISITOR' | 'MEMBER' | 'WIX_USER' | 'APP';
798
- interface AccountInfo {
799
- /**
800
- * ID of the Wix account associated with the event.
801
- * @format GUID
802
- */
803
- accountId?: string | null;
804
- /**
805
- * ID of the parent Wix account. Only included when accountId belongs to a child account.
806
- * @format GUID
807
- */
808
- parentAccountId?: string | null;
809
- /**
810
- * ID of the Wix site associated with the event. Only included when the event is tied to a specific site.
811
- * @format GUID
812
- */
813
- siteId?: string | null;
814
- }
815
- interface GenerateTokenForProjectItemsRequest {
816
- /**
817
- * Media ids of requested project items
818
- * @minSize 1
819
- * @maxLength 100
820
- */
821
- mediaIds: string[];
822
- }
823
- interface GenerateTokenForProjectItemsResponse {
824
- /** Generated media tokens for project items */
825
- mediaTokens?: ProjectItemMediaToken[];
826
- }
827
- interface ProjectItemMediaToken {
828
- /** Media id of project item */
829
- mediaId?: string;
830
- /** Generated media token for project item */
831
- mediaToken?: string;
832
- }
833
833
  interface BaseEventMetadata {
834
834
  /**
835
835
  * App instance ID.
@@ -926,6 +926,16 @@ interface ProjectItemUpdatedEnvelope {
926
926
  * @slug updated
927
927
  */
928
928
  declare function onProjectItemUpdated(handler: (event: ProjectItemUpdatedEnvelope) => void | Promise<void>): void;
929
+ /**
930
+ * Generate media token for project items
931
+ * @param mediaIds - Media ids of requested project items
932
+ * @public
933
+ * @requiredField mediaIds
934
+ * @permissionId PORTFOLIO.PROJECT_ITEM_CREATE
935
+ * @applicableIdentity APP
936
+ * @fqn com.wixpress.portfolio.portfolioapp.MediaService.GenerateTokenForProjectItems
937
+ */
938
+ declare function generateTokenForProjectItems(mediaIds: string[]): Promise<NonNullablePaths<GenerateTokenForProjectItemsResponse, `mediaTokens` | `mediaTokens.${number}.mediaId` | `mediaTokens.${number}.mediaToken`, 2>>;
929
939
  /**
930
940
  * Creates a project item.
931
941
  * @param item - Project item to create.
@@ -1128,15 +1138,5 @@ interface DuplicateProjectItemsOptions {
1128
1138
  */
1129
1139
  targetProjectId: string;
1130
1140
  }
1131
- /**
1132
- * Generate media token for project items
1133
- * @param mediaIds - Media ids of requested project items
1134
- * @public
1135
- * @requiredField mediaIds
1136
- * @permissionId PORTFOLIO.PROJECT_ITEM_CREATE
1137
- * @applicableIdentity APP
1138
- * @fqn com.wixpress.portfolio.portfolioapp.MediaService.GenerateTokenForProjectItems
1139
- */
1140
- declare function generateTokenForProjectItems(mediaIds: string[]): Promise<NonNullablePaths<GenerateTokenForProjectItemsResponse, `mediaTokens` | `mediaTokens.${number}.mediaId` | `mediaTokens.${number}.mediaToken`, 2>>;
1141
1141
 
1142
1142
  export { type AccountInfo, type AccountInfoMetadata, type ActionEvent, type AddressLocation, type App, type ApplicationError, type BaseEventMetadata, type BulkActionMetadata, type BulkCreateProjectItemResult, type BulkCreateProjectItemsOptions, type BulkCreateProjectItemsRequest, type BulkCreateProjectItemsResponse, type BulkDeleteProjectItemResult, type BulkDeleteProjectItemsOptions, type BulkDeleteProjectItemsRequest, type BulkDeleteProjectItemsResponse, type BulkUpdateProjectItemResult, type BulkUpdateProjectItemsOptions, type BulkUpdateProjectItemsRequest, type BulkUpdateProjectItemsResponse, type CloneFromOriginRequest, type CloneFromOriginResponse, type CreateProjectGalleryRequest, type CreateProjectGalleryResponse, type CreateProjectItemRequest, type CreateProjectItemResponse, type CursorPaging, type Cursors, type CustomTag, type DeleteProjectItemRequest, type DeleteProjectItemResponse, type DeletedProjectRestored, type DomainEvent, type DomainEventBodyOneOf, type DuplicateProjectItemsOptions, type DuplicateProjectItemsRequest, type DuplicateProjectItemsResponse, type Empty, type EntityCreatedEvent, type EntityDeletedEvent, type EntityUpdatedEvent, type EventMetadata, type File, type GenerateTokenForProjectItemsRequest, type GenerateTokenForProjectItemsResponse, type GetProjectItemRequest, type GetProjectItemResponse, type IdentificationData, type IdentificationDataIdOneOf, type Image, ImageType, type ImageTypeWithLiterals, type InvalidateCache, type InvalidateCacheGetByOneOf, type Item, type ItemMetadata, type ItemMetadataOneOf, type Link, type ListProjectItemsOptions, type ListProjectItemsRequest, type ListProjectItemsResponse, type MaskedItem, type MessageEnvelope, type Page, type Pages, type Paging, type PagingMetadataV2, type Point, type ProjectItemCreatedEnvelope, type ProjectItemDeletedEnvelope, type ProjectItemMediaToken, type ProjectItemUpdatedEnvelope, type QueryProjectItemsRequest, type QueryProjectItemsResponse, type QueryV2, type QueryV2PagingMethodOneOf, type RestoreInfo, SortOrder, type SortOrderWithLiterals, type Sorting, type Tags, Type, type TypeWithLiterals, type URI, type URIs, type UnsharpMasking, type UpdateProjectItem, type UpdateProjectItemRequest, type UpdateProjectItemResponse, type Video, type VideoResolution, WebhookIdentityType, type WebhookIdentityTypeWithLiterals, bulkCreateProjectItems, bulkDeleteProjectItems, bulkUpdateProjectItems, createProjectItem, deleteProjectItem, duplicateProjectItems, generateTokenForProjectItems, getProjectItem, listProjectItems, onProjectItemCreated, onProjectItemDeleted, onProjectItemUpdated, updateProjectItem };
@@ -80,71 +80,6 @@ var TRANSFORM_PATHS_9 = [
80
80
  { path: "items.item.video.videoInfo.resolutions.poster.urlExpirationDate" },
81
81
  { path: "items.item.video.videoInfo.posters.urlExpirationDate" }
82
82
  ];
83
- function resolveComWixpressPortfolioPortfolioappMediaServiceUrl(opts) {
84
- const domainToMappings = {
85
- "manage._base_domain_": [
86
- {
87
- srcPath: "/_api/portfolio-app-service",
88
- destPath: "/api"
89
- }
90
- ],
91
- "editor._base_domain_": [
92
- {
93
- srcPath: "/_api/portfolio-app-service",
94
- destPath: "/api"
95
- }
96
- ],
97
- "blocks._base_domain_": [
98
- {
99
- srcPath: "/_api/portfolio-app-service",
100
- destPath: "/api"
101
- }
102
- ],
103
- "create.editorx": [
104
- {
105
- srcPath: "/_api/portfolio-app-service",
106
- destPath: "/api"
107
- }
108
- ],
109
- _: [
110
- {
111
- srcPath: "/_api/portfolio-app-service",
112
- destPath: "/api"
113
- }
114
- ],
115
- "api._api_base_domain_": [
116
- {
117
- srcPath: "/_api/portfolio-app-service",
118
- destPath: "/api"
119
- }
120
- ],
121
- "www.wixapis.com": [
122
- {
123
- srcPath: "/portfolio/v1/settings",
124
- destPath: "/api/v1/portfolio/settings"
125
- },
126
- {
127
- srcPath: "/portfolio/portfolio-app/api/v1/portfolio/settings",
128
- destPath: "/api/v1/portfolio/settings"
129
- },
130
- {
131
- srcPath: "/portfolio/project-items/api/v1/portfolio/project/items/media",
132
- destPath: "/api/v1/portfolio/project/items/media"
133
- }
134
- ],
135
- "*.dev.wix-code.com": [
136
- {
137
- srcPath: "/portfolio/portfolio-app/api/v1/portfolio/settings",
138
- destPath: "/api/v1/portfolio/settings"
139
- },
140
- {
141
- srcPath: "/portfolio/project-items/api/v1/portfolio/project/items/media",
142
- destPath: "/api/v1/portfolio/project/items/media"
143
- }
144
- ]
145
- };
146
- return resolveUrl(Object.assign(opts, { domainToMappings }));
147
- }
148
83
  function resolveComWixpressPortfolioProjectitemsProjectItemsServiceUrl(opts) {
149
84
  const domainToMappings = {
150
85
  "manage._base_domain_": [
@@ -264,7 +199,93 @@ function resolveComWixpressPortfolioProjectitemsProjectItemsServiceUrl(opts) {
264
199
  };
265
200
  return resolveUrl(Object.assign(opts, { domainToMappings }));
266
201
  }
202
+ function resolveComWixpressPortfolioPortfolioappMediaServiceUrl(opts) {
203
+ const domainToMappings = {
204
+ "manage._base_domain_": [
205
+ {
206
+ srcPath: "/_api/portfolio-app-service",
207
+ destPath: "/api"
208
+ }
209
+ ],
210
+ "editor._base_domain_": [
211
+ {
212
+ srcPath: "/_api/portfolio-app-service",
213
+ destPath: "/api"
214
+ }
215
+ ],
216
+ "blocks._base_domain_": [
217
+ {
218
+ srcPath: "/_api/portfolio-app-service",
219
+ destPath: "/api"
220
+ }
221
+ ],
222
+ "create.editorx": [
223
+ {
224
+ srcPath: "/_api/portfolio-app-service",
225
+ destPath: "/api"
226
+ }
227
+ ],
228
+ _: [
229
+ {
230
+ srcPath: "/_api/portfolio-app-service",
231
+ destPath: "/api"
232
+ }
233
+ ],
234
+ "api._api_base_domain_": [
235
+ {
236
+ srcPath: "/_api/portfolio-app-service",
237
+ destPath: "/api"
238
+ }
239
+ ],
240
+ "www.wixapis.com": [
241
+ {
242
+ srcPath: "/portfolio/v1/settings",
243
+ destPath: "/api/v1/portfolio/settings"
244
+ },
245
+ {
246
+ srcPath: "/portfolio/portfolio-app/api/v1/portfolio/settings",
247
+ destPath: "/api/v1/portfolio/settings"
248
+ },
249
+ {
250
+ srcPath: "/portfolio/project-items/api/v1/portfolio/project/items/media",
251
+ destPath: "/api/v1/portfolio/project/items/media"
252
+ }
253
+ ],
254
+ "*.dev.wix-code.com": [
255
+ {
256
+ srcPath: "/portfolio/portfolio-app/api/v1/portfolio/settings",
257
+ destPath: "/api/v1/portfolio/settings"
258
+ },
259
+ {
260
+ srcPath: "/portfolio/project-items/api/v1/portfolio/project/items/media",
261
+ destPath: "/api/v1/portfolio/project/items/media"
262
+ }
263
+ ]
264
+ };
265
+ return resolveUrl(Object.assign(opts, { domainToMappings }));
266
+ }
267
267
  var PACKAGE_NAME = "@wix/auto_sdk_portfolio_project-items";
268
+ function generateTokenForProjectItems(payload) {
269
+ function __generateTokenForProjectItems({ host }) {
270
+ const metadata = {
271
+ entityFqdn: "wix.portfolio.project_items.v1.project_item",
272
+ method: "POST",
273
+ methodFqn: "com.wixpress.portfolio.portfolioapp.MediaService.GenerateTokenForProjectItems",
274
+ packageName: PACKAGE_NAME,
275
+ migrationOptions: {
276
+ optInTransformResponse: true
277
+ },
278
+ url: resolveComWixpressPortfolioPortfolioappMediaServiceUrl({
279
+ protoPath: "/api/v1/portfolio/project/items/media",
280
+ data: payload,
281
+ host
282
+ }),
283
+ data: payload
284
+ };
285
+ return metadata;
286
+ }
287
+ return __generateTokenForProjectItems;
288
+ }
268
289
  function createProjectItem(payload) {
269
290
  function __createProjectItem({ host }) {
270
291
  const serializedData = transformPaths(payload, [
@@ -573,27 +594,6 @@ function duplicateProjectItems(payload) {
573
594
  }
574
595
  return __duplicateProjectItems;
575
596
  }
576
- function generateTokenForProjectItems(payload) {
577
- function __generateTokenForProjectItems({ host }) {
578
- const metadata = {
579
- entityFqdn: "wix.portfolio.project_items.v1.project_item",
580
- method: "POST",
581
- methodFqn: "com.wixpress.portfolio.portfolioapp.MediaService.GenerateTokenForProjectItems",
582
- packageName: PACKAGE_NAME,
583
- migrationOptions: {
584
- optInTransformResponse: true
585
- },
586
- url: resolveComWixpressPortfolioPortfolioappMediaServiceUrl({
587
- protoPath: "/api/v1/portfolio/project/items/media",
588
- data: payload,
589
- host
590
- }),
591
- data: payload
592
- };
593
- return metadata;
594
- }
595
- return __generateTokenForProjectItems;
596
- }
597
597
 
598
598
  // src/portfolio-project-items-v1-project-item-project-items.universal.ts
599
599
  import { transformSDKImageToRESTImage } from "@wix/sdk-runtime/transformations/image";
@@ -621,11 +621,6 @@ var ImageType = /* @__PURE__ */ ((ImageType2) => {
621
621
  ImageType2["EXTERNAL"] = "EXTERNAL";
622
622
  return ImageType2;
623
623
  })(ImageType || {});
624
- var SortOrder = /* @__PURE__ */ ((SortOrder2) => {
625
- SortOrder2["ASC"] = "ASC";
626
- SortOrder2["DESC"] = "DESC";
627
- return SortOrder2;
628
- })(SortOrder || {});
629
624
  var WebhookIdentityType = /* @__PURE__ */ ((WebhookIdentityType2) => {
630
625
  WebhookIdentityType2["UNKNOWN"] = "UNKNOWN";
631
626
  WebhookIdentityType2["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
@@ -634,6 +629,36 @@ var WebhookIdentityType = /* @__PURE__ */ ((WebhookIdentityType2) => {
634
629
  WebhookIdentityType2["APP"] = "APP";
635
630
  return WebhookIdentityType2;
636
631
  })(WebhookIdentityType || {});
632
+ var SortOrder = /* @__PURE__ */ ((SortOrder2) => {
633
+ SortOrder2["ASC"] = "ASC";
634
+ SortOrder2["DESC"] = "DESC";
635
+ return SortOrder2;
636
+ })(SortOrder || {});
637
+ async function generateTokenForProjectItems2(mediaIds) {
638
+ const { httpClient, sideEffects } = arguments[1];
639
+ const payload = renameKeysFromSDKRequestToRESTRequest({ mediaIds });
640
+ const reqOpts = generateTokenForProjectItems(
641
+ payload
642
+ );
643
+ sideEffects?.onSiteCall?.();
644
+ try {
645
+ const result = await httpClient.request(reqOpts);
646
+ sideEffects?.onSuccess?.(result);
647
+ return renameKeysFromRESTResponseToSDKResponse(result.data);
648
+ } catch (err) {
649
+ const transformedError = sdkTransformError(
650
+ err,
651
+ {
652
+ spreadPathsToArguments: {},
653
+ explicitPathsToArguments: { mediaIds: "$[0]" },
654
+ singleArgumentUnchanged: false
655
+ },
656
+ ["mediaIds"]
657
+ );
658
+ sideEffects?.onError?.(err);
659
+ throw transformedError;
660
+ }
661
+ }
637
662
  async function createProjectItem2(item) {
638
663
  const { httpClient, sideEffects } = arguments[1];
639
664
  const payload = transformPaths2(
@@ -986,31 +1011,6 @@ async function duplicateProjectItems2(originProjectId, options) {
986
1011
  throw transformedError;
987
1012
  }
988
1013
  }
989
- async function generateTokenForProjectItems2(mediaIds) {
990
- const { httpClient, sideEffects } = arguments[1];
991
- const payload = renameKeysFromSDKRequestToRESTRequest({ mediaIds });
992
- const reqOpts = generateTokenForProjectItems(
993
- payload
994
- );
995
- sideEffects?.onSiteCall?.();
996
- try {
997
- const result = await httpClient.request(reqOpts);
998
- sideEffects?.onSuccess?.(result);
999
- return renameKeysFromRESTResponseToSDKResponse(result.data);
1000
- } catch (err) {
1001
- const transformedError = sdkTransformError(
1002
- err,
1003
- {
1004
- spreadPathsToArguments: {},
1005
- explicitPathsToArguments: { mediaIds: "$[0]" },
1006
- singleArgumentUnchanged: false
1007
- },
1008
- ["mediaIds"]
1009
- );
1010
- sideEffects?.onError?.(err);
1011
- throw transformedError;
1012
- }
1013
- }
1014
1014
  export {
1015
1015
  ImageType,
1016
1016
  SortOrder,