{"version":3,"sources":["jsdelivr-header.js","/npm/@wix/auto_sdk_ecom_orders-settings-bundle@1.0.1/index.ts","/npm/@wix/auto_sdk_ecom_orders-settings-bundle@1.0.1/src/ecom-v1-orders-settings-orders-settings.public.ts","/npm/@wix/auto_sdk_ecom_orders-settings-bundle@1.0.1/src/ecom-v1-orders-settings-orders-settings.universal.ts","/npm/@wix/auto_sdk_ecom_orders-settings-bundle@1.0.1/src/ecom-v1-orders-settings-orders-settings.http.ts","/npm/@wix/auto_sdk_ecom_orders-settings-bundle@1.0.1/src/ecom-v1-orders-settings-orders-settings.context.ts"],"names":[],"mappings":"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","file":"/npm/@wix/auto_sdk_ecom_orders-settings-bundle@1.0.1/build/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/@wix/auto_sdk_ecom_orders-settings-bundle@1.0.1/build/index.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","export * from './src/ecom-v1-orders-settings-orders-settings.context.js';\n","import { renameKeysFromRESTResponseToSDKResponse } from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { transformRESTTimestampToSDKTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport { EventDefinition, HttpClient } from '@wix/sdk-types';\nimport {\n  GetOrdersSettingsResponse,\n  GetOrdersSettingsResponseNonNullableFields,\n  OrdersSettings,\n  OrdersSettingsUpdatedEnvelope,\n  UpdateOrdersSettingsResponse,\n  UpdateOrdersSettingsResponseNonNullableFields,\n  getOrdersSettings as universalGetOrdersSettings,\n  updateOrdersSettings as universalUpdateOrdersSettings,\n} from './ecom-v1-orders-settings-orders-settings.universal.js';\n\nexport const __metadata = { PACKAGE_NAME: '@wix/ecom' };\n\nexport function getOrdersSettings(\n  httpClient: HttpClient\n): GetOrdersSettingsSignature {\n  return () =>\n    universalGetOrdersSettings(\n      // @ts-ignore\n      { httpClient }\n    );\n}\n\ninterface GetOrdersSettingsSignature {\n  /**\n   * Retrieves the sites' order settings.\n   *\n   *\n   * The `getOrdersSettings()` function returns a Promise that resolves to orders settings.\n   * @returns The requested orders settings.\n   */\n  (): Promise<\n    GetOrdersSettingsResponse & GetOrdersSettingsResponseNonNullableFields\n  >;\n}\n\nexport function updateOrdersSettings(\n  httpClient: HttpClient\n): UpdateOrdersSettingsSignature {\n  return (ordersSettings: OrdersSettings) =>\n    universalUpdateOrdersSettings(\n      ordersSettings,\n      // @ts-ignore\n      { httpClient }\n    );\n}\n\ninterface UpdateOrdersSettingsSignature {\n  /**\n   * Updates the sites' orders settings.\n   *\n   *\n   * The `updateOrdersSettings()` function returns a Promise that resolves to the newly updated orders settings.\n   * @param - Orders settings to update.\n   * @returns The updated orders settings.\n   */\n  (ordersSettings: OrdersSettings): Promise<\n    UpdateOrdersSettingsResponse & UpdateOrdersSettingsResponseNonNullableFields\n  >;\n}\n\nexport const onOrdersSettingsUpdated = EventDefinition(\n  'wix.ecom.v1.orders_settings_updated',\n  true,\n  (event: OrdersSettingsUpdatedEnvelope) =>\n    renameKeysFromRESTResponseToSDKResponse(\n      transformPaths(event, [\n        {\n          transformFn: transformRESTTimestampToSDKTimestamp,\n          paths: [\n            { path: 'entity.createdDate' },\n            { path: 'entity.updatedDate' },\n            { path: 'metadata.eventTime' },\n          ],\n        },\n      ])\n    )\n)<OrdersSettingsUpdatedEnvelope>();\n\nexport {\n  ActionEvent,\n  BaseEventMetadata,\n  DeleteOrdersSettingsRequest,\n  DeleteOrdersSettingsResponse,\n  DomainEvent,\n  DomainEventBodyOneOf,\n  EntityCreatedEvent,\n  EntityDeletedEvent,\n  EntityUpdatedEvent,\n  EventMetadata,\n  GetOrdersSettingsRequest,\n  GetOrdersSettingsResponse,\n  GetOrdersSettingsResponseNonNullableFields,\n  IdentificationData,\n  IdentificationDataIdOneOf,\n  InventoryUpdateTrigger,\n  ListOrdersSettingsRequest,\n  ListOrdersSettingsResponse,\n  MessageEnvelope,\n  OrdersSettings,\n  OrdersSettingsUpdatedEnvelope,\n  RestoreInfo,\n  UpdateOrdersSettingsRequest,\n  UpdateOrdersSettingsResponse,\n  UpdateOrdersSettingsResponseNonNullableFields,\n  WebhookIdentityType,\n} from './ecom-v1-orders-settings-orders-settings.universal.js';\n","import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport {\n  renameKeysFromSDKRequestToRESTRequest,\n  renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { HttpClient } from '@wix/sdk-types';\nimport * as ambassadorWixEcomV1OrdersSettings from './ecom-v1-orders-settings-orders-settings.http.js';\n\nexport interface OrdersSettings {\n  /**\n   * Defines when to update the store inventory.\n   *\n   * - `ON_ORDER_PAID`: Stock quantities will update only after the payment is approved.\n   *  - `ON_ORDER_PLACED`: Stock quantities will update while the payment is being processed. If the payment did not go through, items will restock.\n   *\n   * Default: `ON_ORDER_PLACED`\n   */\n  inventoryUpdateTrigger?: InventoryUpdateTrigger;\n  /**\n   * Whether to automatically create invoices for every new order paid online.\n   * Default: `false`\n   */\n  createInvoice?: boolean | null;\n  /**\n   * Date and time the orders settings were created.\n   * @readonly\n   */\n  _createdDate?: Date | null;\n  /**\n   * Date and time the orders settings were updated.\n   * @readonly\n   */\n  _updatedDate?: Date | null;\n}\n\nexport enum InventoryUpdateTrigger {\n  UNKNOWN_INVENTORY_UPDATE_TRIGGER = 'UNKNOWN_INVENTORY_UPDATE_TRIGGER',\n  /** Stock quantities will update only after the payment is approved. */\n  ON_ORDER_PAID = 'ON_ORDER_PAID',\n  /** Stock quantities will update while the payment is being processed. If the payment did not go through, items will restock. */\n  ON_ORDER_PLACED = 'ON_ORDER_PLACED',\n}\n\nexport interface GetOrdersSettingsRequest {}\n\nexport interface GetOrdersSettingsResponse {\n  /** Orders settings. */\n  ordersSettings?: OrdersSettings;\n}\n\nexport interface UpdateOrdersSettingsRequest {\n  /** Orders settings to update. */\n  ordersSettings: OrdersSettings;\n}\n\nexport interface UpdateOrdersSettingsResponse {\n  /** The updated orders settings. */\n  ordersSettings?: OrdersSettings;\n}\n\nexport interface DeleteOrdersSettingsRequest {}\n\nexport interface DeleteOrdersSettingsResponse {}\n\nexport interface ListOrdersSettingsRequest {}\n\nexport interface ListOrdersSettingsResponse {\n  /** List of retrieved orders settings. */\n  ordersSettings?: OrdersSettings[];\n}\n\nexport interface DomainEvent extends DomainEventBodyOneOf {\n  createdEvent?: EntityCreatedEvent;\n  updatedEvent?: EntityUpdatedEvent;\n  deletedEvent?: EntityDeletedEvent;\n  actionEvent?: ActionEvent;\n  /**\n   * Unique event ID.\n   * Allows clients to ignore duplicate webhooks.\n   */\n  _id?: string;\n  /**\n   * Assumes actions are also always typed to an entity_type\n   * Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction\n   */\n  entityFqdn?: string;\n  /**\n   * This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug)\n   * This is although the created/updated/deleted notion is duplication of the oneof types\n   * Example: created/updated/deleted/started/completed/email_opened\n   */\n  slug?: string;\n  /** ID of the entity associated with the event. */\n  entityId?: string;\n  /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example: 2020-04-26T13:57:50.699Z */\n  eventTime?: Date | null;\n  /**\n   * Whether the event was triggered as a result of a privacy regulation application\n   * (for example, GDPR).\n   */\n  triggeredByAnonymizeRequest?: boolean | null;\n  /** If present, indicates the action that triggered the event. */\n  originatedFrom?: string | null;\n  /**\n   * A sequence number defining the order of updates to the underlying entity.\n   * For example, given that some entity was updated at 16:00 and than again at 16:01,\n   * it is guaranteed that the sequence number of the second update is strictly higher than the first.\n   * As the consumer, you can use this value to ensure that you handle messages in the correct order.\n   * To do so, you will need to persist this number on your end, and compare the sequence number from the\n   * message against the one you have stored. Given that the stored number is higher, you should ignore the message.\n   */\n  entityEventSequence?: string | null;\n}\n\n/** @oneof */\nexport interface DomainEventBodyOneOf {\n  createdEvent?: EntityCreatedEvent;\n  updatedEvent?: EntityUpdatedEvent;\n  deletedEvent?: EntityDeletedEvent;\n  actionEvent?: ActionEvent;\n}\n\nexport interface EntityCreatedEvent {\n  entity?: string;\n}\n\nexport interface RestoreInfo {\n  deletedDate?: Date | null;\n}\n\nexport interface EntityUpdatedEvent {\n  /**\n   * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.\n   * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.\n   * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.\n   */\n  currentEntity?: string;\n}\n\nexport interface EntityDeletedEvent {\n  /** Entity that was deleted */\n  deletedEntity?: string | null;\n}\n\nexport interface ActionEvent {\n  body?: string;\n}\n\nexport interface MessageEnvelope {\n  /** App instance ID. */\n  instanceId?: string | null;\n  /** Event type. */\n  eventType?: string;\n  /** The identification type and identity data. */\n  identity?: IdentificationData;\n  /** Stringify payload. */\n  data?: string;\n}\n\nexport interface IdentificationData extends IdentificationDataIdOneOf {\n  /** ID of a site visitor that has not logged in to the site. */\n  anonymousVisitorId?: string;\n  /** ID of a site visitor that has logged in to the site. */\n  memberId?: string;\n  /** ID of a Wix user (site owner, contributor, etc.). */\n  wixUserId?: string;\n  /** ID of an app. */\n  appId?: string;\n  /** @readonly */\n  identityType?: WebhookIdentityType;\n}\n\n/** @oneof */\nexport interface IdentificationDataIdOneOf {\n  /** ID of a site visitor that has not logged in to the site. */\n  anonymousVisitorId?: string;\n  /** ID of a site visitor that has logged in to the site. */\n  memberId?: string;\n  /** ID of a Wix user (site owner, contributor, etc.). */\n  wixUserId?: string;\n  /** ID of an app. */\n  appId?: string;\n}\n\nexport enum WebhookIdentityType {\n  UNKNOWN = 'UNKNOWN',\n  ANONYMOUS_VISITOR = 'ANONYMOUS_VISITOR',\n  MEMBER = 'MEMBER',\n  WIX_USER = 'WIX_USER',\n  APP = 'APP',\n}\n\ninterface OrdersSettingsNonNullableFields {\n  inventoryUpdateTrigger: InventoryUpdateTrigger;\n}\n\nexport interface GetOrdersSettingsResponseNonNullableFields {\n  ordersSettings?: OrdersSettingsNonNullableFields;\n}\n\nexport interface UpdateOrdersSettingsResponseNonNullableFields {\n  ordersSettings?: OrdersSettingsNonNullableFields;\n}\n\nexport interface BaseEventMetadata {\n  /** App instance ID. */\n  instanceId?: string | null;\n  /** Event type. */\n  eventType?: string;\n  /** The identification type and identity data. */\n  identity?: IdentificationData;\n}\n\nexport interface EventMetadata extends BaseEventMetadata {\n  /**\n   * Unique event ID.\n   * Allows clients to ignore duplicate webhooks.\n   */\n  _id?: string;\n  /**\n   * Assumes actions are also always typed to an entity_type\n   * Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction\n   */\n  entityFqdn?: string;\n  /**\n   * This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug)\n   * This is although the created/updated/deleted notion is duplication of the oneof types\n   * Example: created/updated/deleted/started/completed/email_opened\n   */\n  slug?: string;\n  /** ID of the entity associated with the event. */\n  entityId?: string;\n  /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example: 2020-04-26T13:57:50.699Z */\n  eventTime?: Date | null;\n  /**\n   * Whether the event was triggered as a result of a privacy regulation application\n   * (for example, GDPR).\n   */\n  triggeredByAnonymizeRequest?: boolean | null;\n  /** If present, indicates the action that triggered the event. */\n  originatedFrom?: string | null;\n  /**\n   * A sequence number defining the order of updates to the underlying entity.\n   * For example, given that some entity was updated at 16:00 and than again at 16:01,\n   * it is guaranteed that the sequence number of the second update is strictly higher than the first.\n   * As the consumer, you can use this value to ensure that you handle messages in the correct order.\n   * To do so, you will need to persist this number on your end, and compare the sequence number from the\n   * message against the one you have stored. Given that the stored number is higher, you should ignore the message.\n   */\n  entityEventSequence?: string | null;\n}\n\nexport interface OrdersSettingsUpdatedEnvelope {\n  entity: OrdersSettings;\n  metadata: EventMetadata;\n}\n\n/**\n * Triggered when orders settings are updated.\n * @permissionScope Manage Stores - all permissions\n * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES\n * @permissionScope Read eCommerce - all read permissions\n * @permissionScopeId SCOPE.DC-ECOM-MEGA.READ-ECOM\n * @permissionScope Read Orders\n * @permissionScopeId SCOPE.DC-STORES.READ-ORDERS\n * @permissionScope Read Stores - all read permissions\n * @permissionScopeId SCOPE.DC-STORES-MEGA.READ-STORES\n * @permissionScope Manage Restaurants - all permissions\n * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES\n * @permissionScope Manage eCommerce - all permissions\n * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM\n * @permissionScope Manage Orders\n * @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS\n * @permissionId ECOM.READ_ORDERS_SETTINGS\n * @webhook\n * @eventType wix.ecom.v1.orders_settings_updated\n * @documentationMaturity preview\n */\nexport declare function onOrdersSettingsUpdated(\n  handler: (event: OrdersSettingsUpdatedEnvelope) => void | Promise<void>\n): void;\n\n/**\n * Retrieves the sites' order settings.\n *\n *\n * The `getOrdersSettings()` function returns a Promise that resolves to orders settings.\n * @public\n * @documentationMaturity preview\n * @permissionId ECOM.READ_ORDERS_SETTINGS\n * @permissionScope Manage Stores - all permissions\n * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES\n * @permissionScope Read eCommerce - all read permissions\n * @permissionScopeId SCOPE.DC-ECOM-MEGA.READ-ECOM\n * @permissionScope Read Orders\n * @permissionScopeId SCOPE.DC-STORES.READ-ORDERS\n * @permissionScope Read Stores - all read permissions\n * @permissionScopeId SCOPE.DC-STORES-MEGA.READ-STORES\n * @permissionScope Manage Restaurants - all permissions\n * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES\n * @permissionScope Manage eCommerce - all permissions\n * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM\n * @permissionScope Manage Orders\n * @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS\n * @applicableIdentity APP\n * @applicableIdentity VISITOR\n * @returns The requested orders settings.\n * @fqn wix.ecom.orders_settings.api.v1.OrdersSettingsService.GetOrdersSettings\n */\nexport async function getOrdersSettings(): Promise<\n  GetOrdersSettingsResponse & GetOrdersSettingsResponseNonNullableFields\n> {\n  // @ts-ignore\n  const { httpClient, sideEffects } = arguments[0] as {\n    httpClient: HttpClient;\n    sideEffects?: any;\n  };\n\n  const payload = renameKeysFromSDKRequestToRESTRequest({});\n\n  const reqOpts = ambassadorWixEcomV1OrdersSettings.getOrdersSettings(payload);\n\n  sideEffects?.onSiteCall?.();\n  try {\n    const result = await httpClient.request(reqOpts);\n    sideEffects?.onSuccess?.(result);\n\n    return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n  } catch (err: any) {\n    const transformedError = sdkTransformError(\n      err,\n      {\n        spreadPathsToArguments: {},\n        explicitPathsToArguments: {},\n        singleArgumentUnchanged: false,\n      },\n      []\n    );\n    sideEffects?.onError?.(err);\n\n    throw transformedError;\n  }\n}\n\n/**\n * Updates the sites' orders settings.\n *\n *\n * The `updateOrdersSettings()` function returns a Promise that resolves to the newly updated orders settings.\n * @public\n * @documentationMaturity preview\n * @requiredField ordersSettings\n * @param ordersSettings - Orders settings to update.\n * @permissionId ECOM.UPDATE_ORDERS_SETTINGS\n * @permissionScope Manage Stores - all permissions\n * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES\n * @permissionScope Manage Restaurants - all permissions\n * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES\n * @permissionScope Manage eCommerce - all permissions\n * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM\n * @permissionScope Manage Orders\n * @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS\n * @applicableIdentity APP\n * @returns The updated orders settings.\n * @fqn wix.ecom.orders_settings.api.v1.OrdersSettingsService.UpdateOrdersSettings\n */\nexport async function updateOrdersSettings(\n  ordersSettings: OrdersSettings\n): Promise<\n  UpdateOrdersSettingsResponse & UpdateOrdersSettingsResponseNonNullableFields\n> {\n  // @ts-ignore\n  const { httpClient, sideEffects } = arguments[1] as {\n    httpClient: HttpClient;\n    sideEffects?: any;\n  };\n\n  const payload = renameKeysFromSDKRequestToRESTRequest({\n    ordersSettings: ordersSettings,\n  });\n\n  const reqOpts =\n    ambassadorWixEcomV1OrdersSettings.updateOrdersSettings(payload);\n\n  sideEffects?.onSiteCall?.();\n  try {\n    const result = await httpClient.request(reqOpts);\n    sideEffects?.onSuccess?.(result);\n\n    return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n  } catch (err: any) {\n    const transformedError = sdkTransformError(\n      err,\n      {\n        spreadPathsToArguments: {},\n        explicitPathsToArguments: { ordersSettings: '$[0]' },\n        singleArgumentUnchanged: false,\n      },\n      ['ordersSettings']\n    );\n    sideEffects?.onError?.(err);\n\n    throw transformedError;\n  }\n}\n","import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\nimport { transformSDKTimestampToRESTTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformRESTTimestampToSDKTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformSDKFieldMaskToRESTFieldMask } from '@wix/sdk-runtime/transformations/field-mask';\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveWixEcomOrdersSettingsApiV1OrdersSettingsServiceUrl(\n  opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n  const domainToMappings = {\n    'api._api_base_domain_': [\n      {\n        srcPath: '/orders-settings',\n        destPath: '',\n      },\n    ],\n    'www.wixapis.com': [\n      {\n        srcPath: '/ecom/v1/orders-settings',\n        destPath: '/v1/orders-settings',\n      },\n    ],\n    'manage._base_domain_': [\n      {\n        srcPath: '/ecom/v1/orders-settings',\n        destPath: '/v1/orders-settings',\n      },\n    ],\n  };\n\n  return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_ecom_orders-settings';\n\n/**\n * Retrieves the sites' order settings.\n *\n *\n * The `getOrdersSettings()` function returns a Promise that resolves to orders settings.\n */\nexport function getOrdersSettings(payload: object): RequestOptionsFactory<any> {\n  function __getOrdersSettings({ host }: any) {\n    const metadata = {\n      entityFqdn: 'wix.ecom.v1.orders_settings',\n      method: 'GET' as any,\n      methodFqn:\n        'wix.ecom.orders_settings.api.v1.OrdersSettingsService.GetOrdersSettings',\n      packageName: PACKAGE_NAME,\n      url: resolveWixEcomOrdersSettingsApiV1OrdersSettingsServiceUrl({\n        protoPath: '/v1/orders-settings',\n        data: payload,\n        host,\n      }),\n      params: toURLSearchParams(payload),\n      transformResponse: (payload: any) =>\n        transformPaths(payload, [\n          {\n            transformFn: transformRESTTimestampToSDKTimestamp,\n            paths: [\n              { path: 'ordersSettings.createdDate' },\n              { path: 'ordersSettings.updatedDate' },\n            ],\n          },\n        ]),\n    };\n\n    return metadata;\n  }\n\n  return __getOrdersSettings;\n}\n\n/**\n * Updates the sites' orders settings.\n *\n *\n * The `updateOrdersSettings()` function returns a Promise that resolves to the newly updated orders settings.\n */\nexport function updateOrdersSettings(\n  payload: object\n): RequestOptionsFactory<any> {\n  function __updateOrdersSettings({ host }: any) {\n    const serializedData = transformPaths(payload, [\n      {\n        transformFn: transformSDKFieldMaskToRESTFieldMask,\n        paths: [{ path: 'fieldMask' }],\n      },\n      {\n        transformFn: transformSDKTimestampToRESTTimestamp,\n        paths: [\n          { path: 'ordersSettings.createdDate' },\n          { path: 'ordersSettings.updatedDate' },\n        ],\n      },\n    ]);\n    const metadata = {\n      entityFqdn: 'wix.ecom.v1.orders_settings',\n      method: 'PATCH' as any,\n      methodFqn:\n        'wix.ecom.orders_settings.api.v1.OrdersSettingsService.UpdateOrdersSettings',\n      packageName: PACKAGE_NAME,\n      url: resolveWixEcomOrdersSettingsApiV1OrdersSettingsServiceUrl({\n        protoPath: '/v1/orders-settings',\n        data: serializedData,\n        host,\n      }),\n      data: serializedData,\n      transformResponse: (payload: any) =>\n        transformPaths(payload, [\n          {\n            transformFn: transformRESTTimestampToSDKTimestamp,\n            paths: [\n              { path: 'ordersSettings.createdDate' },\n              { path: 'ordersSettings.updatedDate' },\n            ],\n          },\n        ]),\n    };\n\n    return metadata;\n  }\n\n  return __updateOrdersSettings;\n}\n","import {\n  getOrdersSettings as publicGetOrdersSettings,\n  updateOrdersSettings as publicUpdateOrdersSettings,\n} from './ecom-v1-orders-settings-orders-settings.public.js';\nimport { createRESTModule } from '@wix/sdk-runtime/rest-modules';\nimport { createEventModule } from '@wix/sdk-runtime/event-definition-modules';\nimport { BuildRESTFunction, MaybeContext } from '@wix/sdk-types';\nimport { onOrdersSettingsUpdated as publicOnOrdersSettingsUpdated } from './ecom-v1-orders-settings-orders-settings.public.js';\n\nexport const getOrdersSettings: MaybeContext<\n  BuildRESTFunction<typeof publicGetOrdersSettings> &\n    typeof publicGetOrdersSettings\n> = /*#__PURE__*/ createRESTModule(publicGetOrdersSettings);\nexport const updateOrdersSettings: MaybeContext<\n  BuildRESTFunction<typeof publicUpdateOrdersSettings> &\n    typeof publicUpdateOrdersSettings\n> = /*#__PURE__*/ createRESTModule(publicUpdateOrdersSettings);\n/**\n * Triggered when orders settings are updated.\n */\nexport const onOrdersSettingsUpdated: ReturnType<\n  typeof createEventModule<typeof publicOnOrdersSettingsUpdated>\n> = createEventModule(publicOnOrdersSettingsUpdated);\n\nexport {\n  InventoryUpdateTrigger,\n  WebhookIdentityType,\n} from './ecom-v1-orders-settings-orders-settings.universal.js';\nexport {\n  OrdersSettings,\n  GetOrdersSettingsRequest,\n  GetOrdersSettingsResponse,\n  UpdateOrdersSettingsRequest,\n  UpdateOrdersSettingsResponse,\n  DeleteOrdersSettingsRequest,\n  DeleteOrdersSettingsResponse,\n  ListOrdersSettingsRequest,\n  ListOrdersSettingsResponse,\n  DomainEvent,\n  DomainEventBodyOneOf,\n  EntityCreatedEvent,\n  RestoreInfo,\n  EntityUpdatedEvent,\n  EntityDeletedEvent,\n  ActionEvent,\n  MessageEnvelope,\n  IdentificationData,\n  IdentificationDataIdOneOf,\n  GetOrdersSettingsResponseNonNullableFields,\n  UpdateOrdersSettingsResponseNonNullableFields,\n  BaseEventMetadata,\n  EventMetadata,\n  OrdersSettingsUpdatedEnvelope,\n} from './ecom-v1-orders-settings-orders-settings.universal.js';\n"]}