{"version":3,"sources":["../src/tips-staff-v1-staff-tippable-staff.universal.ts","../src/tips-staff-v1-staff-tippable-staff.http.ts","../src/tips-staff-v1-staff-tippable-staff.public.ts","../src/tips-staff-v1-staff-tippable-staff.context.ts"],"sourcesContent":["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 ambassadorWixTipsStaffV1Staff from './tips-staff-v1-staff-tippable-staff.http.js';\n\n/**\n * Information about a team member who's eligible to receive a portion of the tip.\n * Currently, only [Bookings staff members](https://dev.wix.com/docs/rest/business-solutions/bookings/staff-members/introduction)\n * and [site collaborators](https://support.wix.com/en/article/inviting-people-to-contribute-to-your-site)\n * are eligible for tip distributions.\n */\nexport interface Staff {\n  /**\n   * Staff ID. Matches `staffMemberId` if available, or\n   * `identificationData.wixUserId` if not.\n   * @readonly\n   */\n  _id?: string | null;\n  /** Staff name. Matches the name of the Bookings staff member if available. */\n  name?: string | null;\n  /**\n   * Staff member ID. Available only if the staff is connected to a\n   * Bookings staff member.\n   */\n  staffMemberId?: string | null;\n  /**\n   * Identification data of the staff. Available only if the staff is a\n   * [site collaborator](https://support.wix.com/en/article/inviting-people-to-contribute-to-your-site).\n   */\n  identificationData?: IdentificationData;\n}\n\nexport interface IdentificationData extends IdentificationDataIdOneOf {\n  /** ID of a site visitor who hasn't logged in to the site. */\n  anonymousVisitorId?: string;\n  /** ID of a site visitor who has logged in to the site. */\n  memberId?: string;\n  /**\n   * ID of a Wix user. For example, the site owner or a\n   * [site collaborator](https://support.wix.com/en/article/inviting-people-to-contribute-to-your-site).\n   */\n  wixUserId?: string;\n  /** ID of an app. */\n  appId?: string;\n  /**\n   * ID of the [contact](https://dev.wix.com/docs/sdk/backend-modules/crm/contacts/introduction)\n   * in the site's [CRM by Ascend](https://www.wix.com/ascend/crm) system.\n   */\n  contactId?: string | null;\n}\n\n/** @oneof */\nexport interface IdentificationDataIdOneOf {\n  /** ID of a site visitor who hasn't logged in to the site. */\n  anonymousVisitorId?: string;\n  /** ID of a site visitor who has logged in to the site. */\n  memberId?: string;\n  /**\n   * ID of a Wix user. For example, the site owner or a\n   * [site collaborator](https://support.wix.com/en/article/inviting-people-to-contribute-to-your-site).\n   */\n  wixUserId?: string;\n  /** ID of an app. */\n  appId?: string;\n}\n\nexport enum IdentityType {\n  UNKNOWN = 'UNKNOWN',\n  ANONYMOUS_VISITOR = 'ANONYMOUS_VISITOR',\n  MEMBER = 'MEMBER',\n  WIX_USER = 'WIX_USER',\n  APP = 'APP',\n}\n\nexport interface ListTippableStaffRequest {\n  /**\n   * Whether to include staff who are only Wix users and not\n   * Bookings staff members in the response. Setting `{\"includeWixUsers\": true}` returns all tippable\n   * staff, including Bookings staff, site collaborators, or those who are both.\n   * By default, or if you provide `{\"includeWixUsers\": false}`, only Bookings\n   * staff members or those who are both are returned.\n   *\n   * Default: `false`.\n   */\n  includeWixUsers?: boolean;\n  /**\n   * Filters the returned staff by name. If you provide a name as filter, only\n   * staff whose names start with the given input are returned. The filter isn't\n   * case sensitive.\n   *\n   * Max: 500 characters\n   */\n  filterByName?: string | null;\n  /**\n   * Filters the returned staff by ID. If you provide a list of IDs as filter,\n   * only staff members with exact matching IDs are returned.\n   *\n   * Max: 100 IDs\n   */\n  filterByIds?: string[] | null;\n}\n\nexport interface ListTippableStaffResponse {\n  /** Retrieved staff. */\n  staff?: Staff[];\n}\n\ninterface IdentificationDataNonNullableFields {\n  anonymousVisitorId: string;\n  memberId: string;\n  wixUserId: string;\n  appId: string;\n  identityType: IdentityType;\n}\n\ninterface StaffNonNullableFields {\n  identificationData?: IdentificationDataNonNullableFields;\n}\n\nexport interface ListTippableStaffResponseNonNullableFields {\n  staff: StaffNonNullableFields[];\n}\n\n/**\n * Retrieves a list of up to 100 staff who are eligible to receive tips, given\n * the provided filtering.\n * @public\n * @documentationMaturity preview\n * @param options - Options to use when listing tippable staff.\n * @permissionId WIX_TIPS.STAFF_READ\n * @permissionScope Manage Bookings\n * @permissionScopeId SCOPE.DC-BOOKINGS.MANAGE-BOOKINGS\n * @permissionScope Manage Bookings - all permissions\n * @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.MANAGE-BOOKINGS\n * @applicableIdentity APP\n * @fqn wix.tips.staff.v1.TipStaffService.ListTippableStaff\n */\nexport async function listTippableStaff(\n  options?: ListTippableStaffOptions\n): Promise<\n  ListTippableStaffResponse & ListTippableStaffResponseNonNullableFields\n> {\n  // @ts-ignore\n  const { httpClient, sideEffects } = arguments[1] as {\n    httpClient: HttpClient;\n    sideEffects?: any;\n  };\n\n  const payload = renameKeysFromSDKRequestToRESTRequest({\n    includeWixUsers: options?.includeWixUsers,\n    filterByName: options?.filterByName,\n    filterByIds: options?.filterByIds,\n  });\n\n  const reqOpts = ambassadorWixTipsStaffV1Staff.listTippableStaff(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          includeWixUsers: '$[0].includeWixUsers',\n          filterByName: '$[0].filterByName',\n          filterByIds: '$[0].filterByIds',\n        },\n        singleArgumentUnchanged: false,\n      },\n      ['options']\n    );\n    sideEffects?.onError?.(err);\n\n    throw transformedError;\n  }\n}\n\nexport interface ListTippableStaffOptions {\n  /**\n   * Whether to include staff who are only Wix users and not Bookings staff members in the response. Setting `{\"includeWixUsers\": true}` returns all tippable\n   * staff, including Bookings staff, site collaborators, or those who are both.\n   * By default, or if you provide `{\"includeWixUsers\": false}`, only Bookings\n   * staff members or those who are both are returned.\n   *\n   * Default: `false`.\n   */\n  includeWixUsers?: boolean;\n  /**\n   * Filters the returned staff by name. If you provide a name as filter, only\n   * staff whose names start with the given input are returned. The filter isn't\n   * case sensitive.\n   *\n   * Max: 500 characters\n   */\n  filterByName?: string | null;\n  /**\n   * Filters the returned staff by ID. If you provide a list of IDs as filter,\n   * only staff members with exact matching IDs are returned.\n   *\n   * Max: 100 IDs\n   */\n  filterByIds?: string[] | null;\n}\n","import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveWixTipsStaffV1TipStaffServiceUrl(\n  opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n  const domainToMappings = {\n    'manage._base_domain_': [\n      {\n        srcPath: '/_api/tips-staff-service',\n        destPath: '',\n      },\n    ],\n    _: [\n      {\n        srcPath: '/_api/tips-staff-service',\n        destPath: '',\n      },\n    ],\n    'bo._base_domain_': [\n      {\n        srcPath: '/_api/tips-staff-service',\n        destPath: '',\n      },\n    ],\n    'wixbo.ai': [\n      {\n        srcPath: '/_api/tips-staff-service',\n        destPath: '',\n      },\n    ],\n    'wix-bo.com': [\n      {\n        srcPath: '/_api/tips-staff-service',\n        destPath: '',\n      },\n    ],\n    'www.wixapis.com': [\n      {\n        srcPath: '/tips-staff',\n        destPath: '',\n      },\n    ],\n  };\n\n  return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_ecom_tippable-staff';\n\n/**\n * Retrieves a list of up to 100 staff who are eligible to receive tips, given\n * the provided filtering.\n */\nexport function listTippableStaff(payload: object): RequestOptionsFactory<any> {\n  function __listTippableStaff({ host }: any) {\n    const metadata = {\n      entityFqdn: 'wix.tips.staff.v1.staff',\n      method: 'GET' as any,\n      methodFqn: 'wix.tips.staff.v1.TipStaffService.ListTippableStaff',\n      packageName: PACKAGE_NAME,\n      url: resolveWixTipsStaffV1TipStaffServiceUrl({\n        protoPath: '/v1/eligible-staff',\n        data: payload,\n        host,\n      }),\n      params: toURLSearchParams(payload),\n    };\n\n    return metadata;\n  }\n\n  return __listTippableStaff;\n}\n","import { HttpClient } from '@wix/sdk-types';\nimport {\n  ListTippableStaffOptions,\n  ListTippableStaffResponse,\n  ListTippableStaffResponseNonNullableFields,\n  listTippableStaff as universalListTippableStaff,\n} from './tips-staff-v1-staff-tippable-staff.universal.js';\n\nexport const __metadata = { PACKAGE_NAME: '@wix/ecom' };\n\nexport function listTippableStaff(\n  httpClient: HttpClient\n): ListTippableStaffSignature {\n  return (options?: ListTippableStaffOptions) =>\n    universalListTippableStaff(\n      options,\n      // @ts-ignore\n      { httpClient }\n    );\n}\n\ninterface ListTippableStaffSignature {\n  /**\n   * Retrieves a list of up to 100 staff who are eligible to receive tips, given\n   * the provided filtering.\n   * @param - Options to use when listing tippable staff.\n   */\n  (options?: ListTippableStaffOptions | undefined): Promise<\n    ListTippableStaffResponse & ListTippableStaffResponseNonNullableFields\n  >;\n}\n\nexport {\n  IdentificationData,\n  IdentificationDataIdOneOf,\n  IdentityType,\n  ListTippableStaffOptions,\n  ListTippableStaffRequest,\n  ListTippableStaffResponse,\n  ListTippableStaffResponseNonNullableFields,\n  Staff,\n} from './tips-staff-v1-staff-tippable-staff.universal.js';\n","import { listTippableStaff as publicListTippableStaff } from './tips-staff-v1-staff-tippable-staff.public.js';\nimport { createRESTModule } from '@wix/sdk-runtime/rest-modules';\nimport { BuildRESTFunction, MaybeContext } from '@wix/sdk-types';\n\nexport const listTippableStaff: MaybeContext<\n  BuildRESTFunction<typeof publicListTippableStaff> &\n    typeof publicListTippableStaff\n> = /*#__PURE__*/ createRESTModule(publicListTippableStaff);\n\nexport { IdentityType } from './tips-staff-v1-staff-tippable-staff.universal.js';\nexport {\n  Staff,\n  IdentificationData,\n  IdentificationDataIdOneOf,\n  ListTippableStaffRequest,\n  ListTippableStaffResponse,\n  ListTippableStaffResponseNonNullableFields,\n  ListTippableStaffOptions,\n} from './tips-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