@wix/auto_sdk_suppliers-hub_suppliers 1.0.13 → 1.0.14

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,11 +1,126 @@
1
- import { MaybeContext, BuildRESTFunction, HttpClient } from '@wix/sdk-types';
2
- import { SuppliersQueryBuilder, SupplierQuery, typedQuerySuppliers } from './index.typings.js';
3
- export { AccountInfo, ActionEvent, ApplicationError, BulkActionMetadata, BulkCreateSuppliersOptions, BulkCreateSuppliersRequest, BulkCreateSuppliersResponse, BulkDeleteSuppliersRequest, BulkDeleteSuppliersResponse, BulkDeleteSuppliersResponseBulkSupplierResult, BulkSupplierResult, BulkUpdateSupplierTagsApplicationErrors, BulkUpdateSupplierTagsByFilterApplicationErrors, BulkUpdateSupplierTagsByFilterOptions, BulkUpdateSupplierTagsByFilterRequest, BulkUpdateSupplierTagsByFilterResponse, BulkUpdateSupplierTagsOptions, BulkUpdateSupplierTagsRequest, BulkUpdateSupplierTagsResponse, BulkUpdateSupplierTagsResult, BulkUpdateSuppliersOptions, BulkUpdateSuppliersRequest, BulkUpdateSuppliersResponse, BulkUpdateSuppliersResponseBulkSupplierResult, CommonQueryWithEntityContext, CreateSupplierRequest, CreateSupplierResponse, CursorPaging, CursorPagingMetadata, CursorQuery, CursorQueryPagingMethodOneOf, Cursors, DeleteSupplierRequest, DeleteSupplierResponse, DomainEvent, DomainEventBodyOneOf, EntityCreatedEvent, EntityDeletedEvent, EntityUpdatedEvent, GetSupplierRequest, GetSupplierResponse, IdentificationData, IdentificationDataIdOneOf, ItemMetadata, Location, MaskedSupplier, MessageEnvelope, QuerySuppliersRequest, QuerySuppliersResponse, RestoreInfo, SortOrder, SortOrderWithLiterals, Sorting, Supplier, SupplierQuerySpec, SupplierType, SupplierTypeWithLiterals, SuppliersQueryResult, TagList, Tags, TagsModified, UpdateSupplier, UpdateSupplierRequest, UpdateSupplierResponse, WebhookIdentityType, WebhookIdentityTypeWithLiterals, utils } from './index.typings.js';
1
+ import { HttpClient, NonNullablePaths, MaybeContext, BuildRESTFunction } from '@wix/sdk-types';
2
+ import { Supplier, UpdateSupplier, BulkCreateSuppliersOptions, BulkCreateSuppliersResponse, MaskedSupplier, BulkUpdateSuppliersOptions, BulkUpdateSuppliersResponse, BulkDeleteSuppliersResponse, BulkUpdateSupplierTagsOptions, BulkUpdateSupplierTagsResponse, BulkUpdateSupplierTagsApplicationErrors, BulkUpdateSupplierTagsByFilterOptions, BulkUpdateSupplierTagsByFilterResponse, BulkUpdateSupplierTagsByFilterApplicationErrors, SuppliersQueryBuilder, SupplierQuery, typedQuerySuppliers } from './index.typings.js';
3
+ export { AccountInfo, ActionEvent, ApplicationError, BulkActionMetadata, BulkCreateSuppliersRequest, BulkDeleteSuppliersRequest, BulkDeleteSuppliersResponseBulkSupplierResult, BulkSupplierResult, BulkUpdateSupplierTagsByFilterRequest, BulkUpdateSupplierTagsRequest, BulkUpdateSupplierTagsResult, BulkUpdateSuppliersRequest, BulkUpdateSuppliersResponseBulkSupplierResult, CommonQueryWithEntityContext, CreateSupplierRequest, CreateSupplierResponse, CursorPaging, CursorPagingMetadata, CursorQuery, CursorQueryPagingMethodOneOf, Cursors, DeleteSupplierRequest, DeleteSupplierResponse, DomainEvent, DomainEventBodyOneOf, EntityCreatedEvent, EntityDeletedEvent, EntityUpdatedEvent, GetSupplierRequest, GetSupplierResponse, IdentificationData, IdentificationDataIdOneOf, ItemMetadata, Location, MessageEnvelope, QuerySuppliersRequest, QuerySuppliersResponse, RestoreInfo, SortOrder, SortOrderWithLiterals, Sorting, SupplierQuerySpec, SupplierType, SupplierTypeWithLiterals, SuppliersQueryResult, TagList, Tags, TagsModified, UpdateSupplierRequest, UpdateSupplierResponse, WebhookIdentityType, WebhookIdentityTypeWithLiterals, utils } from './index.typings.js';
4
+
5
+ declare function createSupplier$1(httpClient: HttpClient): CreateSupplierSignature;
6
+ interface CreateSupplierSignature {
7
+ /**
8
+ * Creates a supplier profile.
9
+ *
10
+ * The supplier's `appId` is automatically set to the ID of the calling application. Use this endpoint when onboarding new suppliers to your marketplace provider's network.
11
+ * @param - Supplier to be created.
12
+ * @returns The created Supplier.
13
+ */
14
+ (supplier: NonNullablePaths<Supplier, `location` | `name` | `types`, 2>): Promise<NonNullablePaths<Supplier, `verified` | `types` | `tags.privateTags.tagIds`, 4>>;
15
+ }
16
+ declare function getSupplier$1(httpClient: HttpClient): GetSupplierSignature;
17
+ interface GetSupplierSignature {
18
+ /**
19
+ * Retrieves a supplier by ID, returning complete supplier information including current revision number for update operations.
20
+ * @param - ID of the Supplier to retrieve.
21
+ * @returns The requested Supplier.
22
+ */
23
+ (supplierId: string): Promise<NonNullablePaths<Supplier, `verified` | `types` | `tags.privateTags.tagIds`, 4>>;
24
+ }
25
+ declare function updateSupplier$1(httpClient: HttpClient): UpdateSupplierSignature;
26
+ interface UpdateSupplierSignature {
27
+ /**
28
+ * Updates a supplier.
29
+ *
30
+ * Each time the supplier is updated, `revision` increments by 1. The current `revision` must be passed when updating the supplier. This ensures you're working with the latest supplier information and prevents conflicting changes. If the revision is outdated, the request fails and you must fetch the current supplier state before retrying.
31
+ *
32
+ * When updating rating information, update both `rating` and `reviewCount` together to maintain consistency.
33
+ * @param - Supplier ID.
34
+ * @returns Updated supplier with incremented revision number.
35
+ */
36
+ (_id: string, supplier: NonNullablePaths<UpdateSupplier, `revision`, 2>): Promise<NonNullablePaths<Supplier, `verified` | `types` | `tags.privateTags.tagIds`, 4>>;
37
+ }
38
+ declare function deleteSupplier$1(httpClient: HttpClient): DeleteSupplierSignature;
39
+ interface DeleteSupplierSignature {
40
+ /**
41
+ * Permanently deletes a supplier from the marketplace. This action cannot be undone. Use this endpoint when removing suppliers that are no longer active in your network.
42
+ * @param - Id of the Supplier to delete.
43
+ */
44
+ (supplierId: string): Promise<void>;
45
+ }
46
+ declare function bulkCreateSuppliers$1(httpClient: HttpClient): BulkCreateSuppliersSignature;
47
+ interface BulkCreateSuppliersSignature {
48
+ /**
49
+ * Creates multiple suppliers in a single synchronous request.
50
+ *
51
+ * Supports up to 100 suppliers per request. Set `returnEntity` to `true` to receive the created suppliers with their assigned IDs and revision numbers. Use this endpoint when importing suppliers from external sources or onboarding multiple suppliers simultaneously.
52
+ *
53
+ * Each supplier in the request is processed independently. The response includes metadata indicating success or failure for each supplier.
54
+ * @param - List of suppliers to create.
55
+ */
56
+ (suppliers: NonNullablePaths<Supplier, `location` | `name` | `types`, 2>[], options?: BulkCreateSuppliersOptions): Promise<NonNullablePaths<BulkCreateSuppliersResponse, `results` | `results.${number}.itemMetadata.originalIndex` | `results.${number}.itemMetadata.success` | `results.${number}.itemMetadata.error.code` | `results.${number}.itemMetadata.error.description` | `results.${number}.item.verified` | `bulkActionMetadata.totalSuccesses` | `bulkActionMetadata.totalFailures` | `bulkActionMetadata.undetailedFailures`, 6>>;
57
+ }
58
+ declare function bulkUpdateSuppliers$1(httpClient: HttpClient): BulkUpdateSuppliersSignature;
59
+ interface BulkUpdateSuppliersSignature {
60
+ /**
61
+ * Updates multiple suppliers in a single synchronous request.
62
+ *
63
+ * Supports up to 100 suppliers per request. Each supplier must include its current revision number to prevent conflicting changes. Set `returnEntity` to `true` to receive the updated suppliers in the response.
64
+ *
65
+ * To update more than 100 suppliers, split them into multiple batches and make separate requests. When updating rating information, update both `rating` and `reviewCount` together to maintain consistency.
66
+ * @param - List of suppliers to update. Each must include current revision number.
67
+ */
68
+ (suppliers: NonNullablePaths<MaskedSupplier, `supplier._id` | `supplier.revision`, 3>[], options?: BulkUpdateSuppliersOptions): Promise<NonNullablePaths<BulkUpdateSuppliersResponse, `results` | `results.${number}.itemMetadata.originalIndex` | `results.${number}.itemMetadata.success` | `results.${number}.itemMetadata.error.code` | `results.${number}.itemMetadata.error.description` | `results.${number}.item.verified` | `bulkActionMetadata.totalSuccesses` | `bulkActionMetadata.totalFailures` | `bulkActionMetadata.undetailedFailures`, 6>>;
69
+ }
70
+ declare function bulkDeleteSuppliers$1(httpClient: HttpClient): BulkDeleteSuppliersSignature;
71
+ interface BulkDeleteSuppliersSignature {
72
+ /**
73
+ * Permanently deletes multiple suppliers in a single synchronous request. This action cannot be undone.
74
+ *
75
+ * Supports up to 100 suppliers per request. To delete more than 100 suppliers, split the supplier IDs into multiple batches and make separate requests.
76
+ *
77
+ * Each supplier deletion is processed independently. The response includes metadata indicating success or failure for each supplier.
78
+ * @param - Supplier ids to be deleted
79
+ */
80
+ (supplierIds: string[]): Promise<NonNullablePaths<BulkDeleteSuppliersResponse, `results` | `results.${number}.itemMetadata.originalIndex` | `results.${number}.itemMetadata.success` | `results.${number}.itemMetadata.error.code` | `results.${number}.itemMetadata.error.description` | `bulkActionMetadata.totalSuccesses` | `bulkActionMetadata.totalFailures` | `bulkActionMetadata.undetailedFailures`, 6>>;
81
+ }
82
+ declare function bulkUpdateSupplierTags$1(httpClient: HttpClient): BulkUpdateSupplierTagsSignature;
83
+ interface BulkUpdateSupplierTagsSignature {
84
+ /**
85
+ * Updates tags on multiple suppliers specified by supplier IDs in a single synchronous request.
86
+ *
87
+ * Supports up to 100 suppliers per request. You can assign new tags, unassign existing tags, or both in a single operation. If a tag appears in both `assignTags` and `unassignTags` lists, it will be assigned. Assignment takes precedence.
88
+ *
89
+ * Use this endpoint to organize suppliers with public tags for categorization visible to site members, or private tags for internal management requiring additional permissions.
90
+ * @param - List of supplier IDs to update tags for.
91
+ */
92
+ (supplierIds: string[], options?: BulkUpdateSupplierTagsOptions): Promise<NonNullablePaths<BulkUpdateSupplierTagsResponse, `results` | `results.${number}.itemMetadata.originalIndex` | `results.${number}.itemMetadata.success` | `results.${number}.itemMetadata.error.code` | `results.${number}.itemMetadata.error.description` | `bulkActionMetadata.totalSuccesses` | `bulkActionMetadata.totalFailures` | `bulkActionMetadata.undetailedFailures`, 6> & {
93
+ __applicationErrorsType?: BulkUpdateSupplierTagsApplicationErrors;
94
+ }>;
95
+ }
96
+ declare function bulkUpdateSupplierTagsByFilter$1(httpClient: HttpClient): BulkUpdateSupplierTagsByFilterSignature;
97
+ interface BulkUpdateSupplierTagsByFilterSignature {
98
+ /**
99
+ * Updates tags on multiple suppliers matching filter criteria in a single asynchronous request.
100
+ *
101
+ * Use this endpoint for large-scale tag operations across many suppliers based on conditions such as location, verification status, or rating. An empty filter updates all suppliers. The operation returns a job ID for tracking completion status.
102
+ *
103
+ * If a tag appears in both `assignTags` and `unassignTags` lists, it will be assigned. Assignment takes precedence. This endpoint has no supplier limit, unlike the synchronous tag update endpoint which is limited to 100 suppliers.
104
+ * @param - Filter criteria to select which suppliers to update. An empty filter matches all suppliers. See supported filters in the API documentation.
105
+ */
106
+ (filter: Record<string, any>, options?: BulkUpdateSupplierTagsByFilterOptions): Promise<NonNullablePaths<BulkUpdateSupplierTagsByFilterResponse, `jobId`, 2> & {
107
+ __applicationErrorsType?: BulkUpdateSupplierTagsByFilterApplicationErrors;
108
+ }>;
109
+ }
4
110
 
5
111
  declare function customQuerySuppliers(httpClient: HttpClient): {
6
112
  (): SuppliersQueryBuilder;
7
113
  (query: SupplierQuery): ReturnType<typeof typedQuerySuppliers>;
8
114
  };
115
+ declare const createSupplier: MaybeContext<BuildRESTFunction<typeof createSupplier$1> & typeof createSupplier$1>;
116
+ declare const getSupplier: MaybeContext<BuildRESTFunction<typeof getSupplier$1> & typeof getSupplier$1>;
117
+ declare const updateSupplier: MaybeContext<BuildRESTFunction<typeof updateSupplier$1> & typeof updateSupplier$1>;
118
+ declare const deleteSupplier: MaybeContext<BuildRESTFunction<typeof deleteSupplier$1> & typeof deleteSupplier$1>;
119
+ declare const bulkCreateSuppliers: MaybeContext<BuildRESTFunction<typeof bulkCreateSuppliers$1> & typeof bulkCreateSuppliers$1>;
120
+ declare const bulkUpdateSuppliers: MaybeContext<BuildRESTFunction<typeof bulkUpdateSuppliers$1> & typeof bulkUpdateSuppliers$1>;
121
+ declare const bulkDeleteSuppliers: MaybeContext<BuildRESTFunction<typeof bulkDeleteSuppliers$1> & typeof bulkDeleteSuppliers$1>;
122
+ declare const bulkUpdateSupplierTags: MaybeContext<BuildRESTFunction<typeof bulkUpdateSupplierTags$1> & typeof bulkUpdateSupplierTags$1>;
123
+ declare const bulkUpdateSupplierTagsByFilter: MaybeContext<BuildRESTFunction<typeof bulkUpdateSupplierTagsByFilter$1> & typeof bulkUpdateSupplierTagsByFilter$1>;
9
124
  declare const querySuppliers: MaybeContext<BuildRESTFunction<typeof customQuerySuppliers> & typeof customQuerySuppliers>;
10
125
 
11
- export { SupplierQuery, SuppliersQueryBuilder, querySuppliers };
126
+ export { BulkCreateSuppliersOptions, BulkCreateSuppliersResponse, BulkDeleteSuppliersResponse, BulkUpdateSupplierTagsApplicationErrors, BulkUpdateSupplierTagsByFilterApplicationErrors, BulkUpdateSupplierTagsByFilterOptions, BulkUpdateSupplierTagsByFilterResponse, BulkUpdateSupplierTagsOptions, BulkUpdateSupplierTagsResponse, BulkUpdateSuppliersOptions, BulkUpdateSuppliersResponse, MaskedSupplier, Supplier, SupplierQuery, SuppliersQueryBuilder, UpdateSupplier, bulkCreateSuppliers, bulkDeleteSuppliers, bulkUpdateSupplierTags, bulkUpdateSupplierTagsByFilter, bulkUpdateSuppliers, createSupplier, deleteSupplier, getSupplier, querySuppliers, updateSupplier };
@@ -585,7 +585,9 @@ async function typedQuerySuppliers(query) {
585
585
  }
586
586
  }
587
587
  var utils = {
588
- ...(0, import_query_builder_utils.createQueryUtils)()
588
+ query: {
589
+ ...(0, import_query_builder_utils.createQueryUtils)()
590
+ }
589
591
  };
590
592
  async function bulkCreateSuppliers2(suppliers, options) {
591
593
  const { httpClient, sideEffects } = arguments[2];