@wix/auto_sdk_rich-content_ricos-polls 1.0.0 → 1.0.1

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.
@@ -340,68 +340,6 @@ interface DeletePollRequest {
340
340
  }
341
341
  interface DeletePollResponse {
342
342
  }
343
- interface ListPollsRequest {
344
- /**
345
- * Cursor paging options.
346
- *
347
- * Default: `paging.limit` is `50`.
348
- */
349
- paging?: CursorPaging;
350
- /**
351
- * Additional fields to return.
352
- * @maxSize 2
353
- */
354
- fields?: RequestedFieldsWithLiterals[];
355
- }
356
- interface CursorPaging {
357
- /**
358
- * Maximum number of items to return in the results.
359
- * @max 100
360
- */
361
- limit?: number | null;
362
- /**
363
- * Pointer to the next or previous page in the list of results.
364
- *
365
- * Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response.
366
- * Not relevant for the first request.
367
- * @maxLength 16000
368
- */
369
- cursor?: string | null;
370
- }
371
- interface ListPollsResponse {
372
- /**
373
- * Retrieved polls.
374
- * @maxSize 100
375
- */
376
- polls?: Poll[];
377
- /** Paging metadata. */
378
- pagingMetadata?: CursorPagingMetadata;
379
- }
380
- interface CursorPagingMetadata {
381
- /** Number of items returned in current page. */
382
- count?: number | null;
383
- /** Cursor strings that point to the next page, previous page, or both. */
384
- cursors?: Cursors;
385
- /**
386
- * Whether there are more pages to retrieve following the current page.
387
- *
388
- * + `true`: Another page of results can be retrieved.
389
- * + `false`: This is the last page.
390
- */
391
- hasNext?: boolean | null;
392
- }
393
- interface Cursors {
394
- /**
395
- * Cursor string pointing to the next page in the list of results.
396
- * @maxLength 16000
397
- */
398
- next?: string | null;
399
- /**
400
- * Cursor pointing to the previous page in the list of results.
401
- * @maxLength 16000
402
- */
403
- prev?: string | null;
404
- }
405
343
  interface CastVoteRequest {
406
344
  /**
407
345
  * ID of the poll to vote in.
@@ -464,6 +402,21 @@ interface ListVotersRequest {
464
402
  */
465
403
  paging?: CursorPaging;
466
404
  }
405
+ interface CursorPaging {
406
+ /**
407
+ * Maximum number of items to return in the results.
408
+ * @max 100
409
+ */
410
+ limit?: number | null;
411
+ /**
412
+ * Pointer to the next or previous page in the list of results.
413
+ *
414
+ * Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response.
415
+ * Not relevant for the first request.
416
+ * @maxLength 16000
417
+ */
418
+ cursor?: string | null;
419
+ }
467
420
  interface ListVotersResponse {
468
421
  /**
469
422
  * Site members who voted for the option, most recent first.
@@ -480,6 +433,31 @@ interface Voter {
480
433
  /** Date and time of the vote. */
481
434
  voteDate?: Date | null;
482
435
  }
436
+ interface CursorPagingMetadata {
437
+ /** Number of items returned in current page. */
438
+ count?: number | null;
439
+ /** Cursor strings that point to the next page, previous page, or both. */
440
+ cursors?: Cursors;
441
+ /**
442
+ * Whether there are more pages to retrieve following the current page.
443
+ *
444
+ * + `true`: Another page of results can be retrieved.
445
+ * + `false`: This is the last page.
446
+ */
447
+ hasNext?: boolean | null;
448
+ }
449
+ interface Cursors {
450
+ /**
451
+ * Cursor string pointing to the next page in the list of results.
452
+ * @maxLength 16000
453
+ */
454
+ next?: string | null;
455
+ /**
456
+ * Cursor pointing to the previous page in the list of results.
457
+ * @maxLength 16000
458
+ */
459
+ prev?: string | null;
460
+ }
483
461
  interface DomainEvent extends DomainEventBodyOneOf {
484
462
  createdEvent?: EntityCreatedEvent;
485
463
  updatedEvent?: EntityUpdatedEvent;
@@ -756,19 +734,6 @@ interface UpdatePoll {
756
734
  */
757
735
  currentVoterOptionIds?: string[];
758
736
  }
759
- interface ListPollsOptions {
760
- /**
761
- * Cursor paging options.
762
- *
763
- * Default: `paging.limit` is `50`.
764
- */
765
- paging?: CursorPaging;
766
- /**
767
- * Additional fields to return.
768
- * @maxSize 2
769
- */
770
- fields?: RequestedFieldsWithLiterals[];
771
- }
772
737
  interface ListVotersIdentifiers {
773
738
  /**
774
739
  * Poll ID.
@@ -790,4 +755,4 @@ interface ListVotersOptions {
790
755
  paging?: CursorPaging;
791
756
  }
792
757
 
793
- export { type AccountInfo, type ActionEvent, type CastVoteApplicationErrors, type CastVoteRequest, type CastVoteResponse, type CommonIdentificationData, type CommonIdentificationDataIdOneOf, type CreatePollRequest, type CreatePollResponse, type CursorPaging, type CursorPagingMetadata, type Cursors, type DeletePollApplicationErrors, type DeletePollRequest, type DeletePollResponse, type DomainEvent, type DomainEventBodyOneOf, type EntityCreatedEvent, type EntityDeletedEvent, type EntityUpdatedEvent, type GetPollOptions, type GetPollRequest, type GetPollResponse, type IdentificationData, type IdentificationDataIdOneOf, IdentityType, type IdentityTypeWithLiterals, type ListPollsOptions, type ListPollsRequest, type ListPollsResponse, type ListVotersApplicationErrors, type ListVotersIdentifiers, type ListVotersOptions, type ListVotersRequest, type ListVotersResponse, type MessageEnvelope, type Poll, type PollOption, type PollOptionResults, type PollResults, type PollSettings, type PollVoteCast, type PollVoteRemoved, type RemoveVoteApplicationErrors, type RemoveVoteRequest, type RemoveVoteResponse, RequestedFields, type RequestedFieldsWithLiterals, type RestoreInfo, ResultsVisibility, type ResultsVisibilityWithLiterals, type UpdatePoll, type UpdatePollApplicationErrors, type UpdatePollRequest, type UpdatePollResponse, type Voter, VotingAccess, type VotingAccessWithLiterals, WebhookIdentityType, type WebhookIdentityTypeWithLiterals };
758
+ export { type AccountInfo, type ActionEvent, type CastVoteApplicationErrors, type CastVoteRequest, type CastVoteResponse, type CommonIdentificationData, type CommonIdentificationDataIdOneOf, type CreatePollRequest, type CreatePollResponse, type CursorPaging, type CursorPagingMetadata, type Cursors, type DeletePollApplicationErrors, type DeletePollRequest, type DeletePollResponse, type DomainEvent, type DomainEventBodyOneOf, type EntityCreatedEvent, type EntityDeletedEvent, type EntityUpdatedEvent, type GetPollOptions, type GetPollRequest, type GetPollResponse, type IdentificationData, type IdentificationDataIdOneOf, IdentityType, type IdentityTypeWithLiterals, type ListVotersApplicationErrors, type ListVotersIdentifiers, type ListVotersOptions, type ListVotersRequest, type ListVotersResponse, type MessageEnvelope, type Poll, type PollOption, type PollOptionResults, type PollResults, type PollSettings, type PollVoteCast, type PollVoteRemoved, type RemoveVoteApplicationErrors, type RemoveVoteRequest, type RemoveVoteResponse, RequestedFields, type RequestedFieldsWithLiterals, type RestoreInfo, ResultsVisibility, type ResultsVisibilityWithLiterals, type UpdatePoll, type UpdatePollApplicationErrors, type UpdatePollRequest, type UpdatePollResponse, type Voter, VotingAccess, type VotingAccessWithLiterals, WebhookIdentityType, type WebhookIdentityTypeWithLiterals };
@@ -29,7 +29,6 @@ __export(index_exports, {
29
29
  createPoll: () => createPoll4,
30
30
  deletePoll: () => deletePoll4,
31
31
  getPoll: () => getPoll4,
32
- listPolls: () => listPolls4,
33
32
  listVoters: () => listVoters4,
34
33
  removeVote: () => removeVote4,
35
34
  updatePoll: () => updatePoll4
@@ -52,11 +51,7 @@ var TRANSFORM_PATHS_0 = [
52
51
  { path: "poll.updatedDate" }
53
52
  ];
54
53
  var TRANSFORM_PATHS_1 = [{ path: "fieldMask" }];
55
- var TRANSFORM_PATHS_2 = [
56
- { path: "polls.createdDate" },
57
- { path: "polls.updatedDate" }
58
- ];
59
- var TRANSFORM_PATHS_3 = [{ path: "voters.voteDate" }];
54
+ var TRANSFORM_PATHS_2 = [{ path: "voters.voteDate" }];
60
55
  function resolveWixRicosV1RicosPollsUrl(opts) {
61
56
  const domainToMappings = {};
62
57
  return (0, import_rest_modules2.resolveUrl)(Object.assign(opts, { domainToMappings }));
@@ -180,33 +175,6 @@ function deletePoll(payload) {
180
175
  }
181
176
  return __deletePoll;
182
177
  }
183
- function listPolls(payload) {
184
- function __listPolls({ host }) {
185
- const metadata = {
186
- entityFqdn: "wix.ricos.v1.poll",
187
- method: "GET",
188
- methodFqn: "wix.ricos.v1.RicosPolls.ListPolls",
189
- packageName: PACKAGE_NAME,
190
- migrationOptions: {
191
- optInTransformResponse: true
192
- },
193
- url: resolveWixRicosV1RicosPollsUrl({
194
- protoPath: "/v1/polls",
195
- data: payload,
196
- host
197
- }),
198
- params: (0, import_rest_modules.toURLSearchParams)(payload),
199
- transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
200
- {
201
- transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
202
- paths: TRANSFORM_PATHS_2
203
- }
204
- ])
205
- };
206
- return metadata;
207
- }
208
- return __listPolls;
209
- }
210
178
  function castVote(payload) {
211
179
  function __castVote({ host }) {
212
180
  const metadata = {
@@ -268,7 +236,7 @@ function listVoters(payload) {
268
236
  transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
269
237
  {
270
238
  transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
271
- paths: TRANSFORM_PATHS_3
239
+ paths: TRANSFORM_PATHS_2
272
240
  }
273
241
  ])
274
242
  };
@@ -285,10 +253,6 @@ var TRANSFORM_PATHS_02 = [
285
253
  { path: "poll.image" },
286
254
  { path: "poll.options.image" }
287
255
  ];
288
- var TRANSFORM_PATHS_12 = [
289
- { path: "polls.image" },
290
- { path: "polls.options.image" }
291
- ];
292
256
  var IdentityType = /* @__PURE__ */ ((IdentityType2) => {
293
257
  IdentityType2["UNKNOWN"] = "UNKNOWN";
294
258
  IdentityType2["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
@@ -453,42 +417,6 @@ async function deletePoll2(pollId) {
453
417
  throw transformedError;
454
418
  }
455
419
  }
456
- async function listPolls2(options) {
457
- const { httpClient, sideEffects } = arguments[1];
458
- const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
459
- paging: options?.paging,
460
- fields: options?.fields
461
- });
462
- const reqOpts = listPolls(payload);
463
- sideEffects?.onSiteCall?.();
464
- try {
465
- const result = await httpClient.request(reqOpts);
466
- sideEffects?.onSuccess?.(result);
467
- return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(
468
- (0, import_transform_paths2.transformPaths)(result.data, [
469
- {
470
- transformFn: import_image2.transformRESTImageToSDKImage,
471
- paths: TRANSFORM_PATHS_12
472
- }
473
- ])
474
- );
475
- } catch (err) {
476
- const transformedError = (0, import_transform_error.transformError)(
477
- err,
478
- {
479
- spreadPathsToArguments: {},
480
- explicitPathsToArguments: {
481
- paging: "$[0].paging",
482
- fields: "$[0].fields"
483
- },
484
- singleArgumentUnchanged: false
485
- },
486
- ["options"]
487
- );
488
- sideEffects?.onError?.(err);
489
- throw transformedError;
490
- }
491
- }
492
420
  async function castVote2(pollId, optionId) {
493
421
  const { httpClient, sideEffects } = arguments[2];
494
422
  const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
@@ -604,13 +532,6 @@ function deletePoll3(httpClient) {
604
532
  { httpClient }
605
533
  );
606
534
  }
607
- function listPolls3(httpClient) {
608
- return (options) => listPolls2(
609
- options,
610
- // @ts-ignore
611
- { httpClient }
612
- );
613
- }
614
535
  function castVote3(httpClient) {
615
536
  return (pollId, optionId) => castVote2(
616
537
  pollId,
@@ -642,7 +563,6 @@ var createPoll4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(cre
642
563
  var getPoll4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(getPoll3);
643
564
  var updatePoll4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(updatePoll3);
644
565
  var deletePoll4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(deletePoll3);
645
- var listPolls4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(listPolls3);
646
566
  var castVote4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(castVote3);
647
567
  var removeVote4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(removeVote3);
648
568
  var listVoters4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(listVoters3);
@@ -657,7 +577,6 @@ var listVoters4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(lis
657
577
  createPoll,
658
578
  deletePoll,
659
579
  getPoll,
660
- listPolls,
661
580
  listVoters,
662
581
  removeVote,
663
582
  updatePoll