@wix/auto_sdk_domains_domain-suggestions 1.0.8 → 1.0.10
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.
- package/build/cjs/index.d.ts +29 -1
- package/build/cjs/index.js +202 -15
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/index.typings.d.ts +179 -1
- package/build/cjs/index.typings.js +188 -15
- package/build/cjs/index.typings.js.map +1 -1
- package/build/cjs/meta.d.ts +125 -1
- package/build/cjs/meta.js +167 -15
- package/build/cjs/meta.js.map +1 -1
- package/build/{internal/cjs/src/premium-domains-v2-suggestion-domain-suggestions.public.d.ts → es/index.d.mts} +13 -8
- package/build/es/index.mjs +181 -0
- package/build/es/index.mjs.map +1 -0
- package/build/{internal/cjs/src/premium-domains-v2-suggestion-domain-suggestions.universal.d.ts → es/index.typings.d.mts} +11 -9
- package/build/es/index.typings.mjs +167 -0
- package/build/es/index.typings.mjs.map +1 -0
- package/build/{internal/cjs/src/premium-domains-v2-suggestion-domain-suggestions.types.d.ts → es/meta.d.mts} +23 -6
- package/build/es/meta.mjs +143 -0
- package/build/es/meta.mjs.map +1 -0
- package/build/internal/cjs/index.d.ts +29 -1
- package/build/internal/cjs/index.js +202 -15
- package/build/internal/cjs/index.js.map +1 -1
- package/build/internal/cjs/index.typings.d.ts +179 -1
- package/build/internal/cjs/index.typings.js +188 -15
- package/build/internal/cjs/index.typings.js.map +1 -1
- package/build/internal/cjs/meta.d.ts +125 -1
- package/build/internal/cjs/meta.js +167 -15
- package/build/internal/cjs/meta.js.map +1 -1
- package/build/{cjs/src/premium-domains-v2-suggestion-domain-suggestions.public.d.ts → internal/es/index.d.mts} +13 -8
- package/build/internal/es/index.mjs +181 -0
- package/build/internal/es/index.mjs.map +1 -0
- package/build/internal/es/{src/premium-domains-v2-suggestion-domain-suggestions.universal.d.ts → index.typings.d.mts} +11 -9
- package/build/internal/es/index.typings.mjs +167 -0
- package/build/internal/es/index.typings.mjs.map +1 -0
- package/build/{cjs/src/premium-domains-v2-suggestion-domain-suggestions.types.d.ts → internal/es/meta.d.mts} +23 -6
- package/build/internal/es/meta.mjs +143 -0
- package/build/internal/es/meta.mjs.map +1 -0
- package/package.json +11 -10
- package/build/cjs/src/premium-domains-v2-suggestion-domain-suggestions.context.d.ts +0 -4
- package/build/cjs/src/premium-domains-v2-suggestion-domain-suggestions.context.js +0 -7
- package/build/cjs/src/premium-domains-v2-suggestion-domain-suggestions.context.js.map +0 -1
- package/build/cjs/src/premium-domains-v2-suggestion-domain-suggestions.http.d.ts +0 -11
- package/build/cjs/src/premium-domains-v2-suggestion-domain-suggestions.http.js +0 -130
- package/build/cjs/src/premium-domains-v2-suggestion-domain-suggestions.http.js.map +0 -1
- package/build/cjs/src/premium-domains-v2-suggestion-domain-suggestions.meta.d.ts +0 -13
- package/build/cjs/src/premium-domains-v2-suggestion-domain-suggestions.meta.js +0 -47
- package/build/cjs/src/premium-domains-v2-suggestion-domain-suggestions.meta.js.map +0 -1
- package/build/cjs/src/premium-domains-v2-suggestion-domain-suggestions.public.js +0 -12
- package/build/cjs/src/premium-domains-v2-suggestion-domain-suggestions.public.js.map +0 -1
- package/build/cjs/src/premium-domains-v2-suggestion-domain-suggestions.types.js +0 -3
- package/build/cjs/src/premium-domains-v2-suggestion-domain-suggestions.types.js.map +0 -1
- package/build/cjs/src/premium-domains-v2-suggestion-domain-suggestions.universal.d.ts +0 -177
- package/build/cjs/src/premium-domains-v2-suggestion-domain-suggestions.universal.js +0 -82
- package/build/cjs/src/premium-domains-v2-suggestion-domain-suggestions.universal.js.map +0 -1
- package/build/es/index.d.ts +0 -1
- package/build/es/index.js +0 -2
- package/build/es/index.js.map +0 -1
- package/build/es/index.typings.d.ts +0 -1
- package/build/es/index.typings.js +0 -2
- package/build/es/index.typings.js.map +0 -1
- package/build/es/meta.d.ts +0 -1
- package/build/es/meta.js +0 -2
- package/build/es/meta.js.map +0 -1
- package/build/es/src/premium-domains-v2-suggestion-domain-suggestions.context.d.ts +0 -4
- package/build/es/src/premium-domains-v2-suggestion-domain-suggestions.context.js +0 -4
- package/build/es/src/premium-domains-v2-suggestion-domain-suggestions.context.js.map +0 -1
- package/build/es/src/premium-domains-v2-suggestion-domain-suggestions.http.d.ts +0 -11
- package/build/es/src/premium-domains-v2-suggestion-domain-suggestions.http.js +0 -126
- package/build/es/src/premium-domains-v2-suggestion-domain-suggestions.http.js.map +0 -1
- package/build/es/src/premium-domains-v2-suggestion-domain-suggestions.meta.d.ts +0 -13
- package/build/es/src/premium-domains-v2-suggestion-domain-suggestions.meta.js +0 -20
- package/build/es/src/premium-domains-v2-suggestion-domain-suggestions.meta.js.map +0 -1
- package/build/es/src/premium-domains-v2-suggestion-domain-suggestions.public.d.ts +0 -24
- package/build/es/src/premium-domains-v2-suggestion-domain-suggestions.public.js +0 -8
- package/build/es/src/premium-domains-v2-suggestion-domain-suggestions.public.js.map +0 -1
- package/build/es/src/premium-domains-v2-suggestion-domain-suggestions.types.d.ts +0 -108
- package/build/es/src/premium-domains-v2-suggestion-domain-suggestions.types.js +0 -2
- package/build/es/src/premium-domains-v2-suggestion-domain-suggestions.types.js.map +0 -1
- package/build/es/src/premium-domains-v2-suggestion-domain-suggestions.universal.d.ts +0 -177
- package/build/es/src/premium-domains-v2-suggestion-domain-suggestions.universal.js +0 -55
- package/build/es/src/premium-domains-v2-suggestion-domain-suggestions.universal.js.map +0 -1
- package/build/internal/cjs/src/premium-domains-v2-suggestion-domain-suggestions.context.d.ts +0 -4
- package/build/internal/cjs/src/premium-domains-v2-suggestion-domain-suggestions.context.js +0 -7
- package/build/internal/cjs/src/premium-domains-v2-suggestion-domain-suggestions.context.js.map +0 -1
- package/build/internal/cjs/src/premium-domains-v2-suggestion-domain-suggestions.http.d.ts +0 -11
- package/build/internal/cjs/src/premium-domains-v2-suggestion-domain-suggestions.http.js +0 -130
- package/build/internal/cjs/src/premium-domains-v2-suggestion-domain-suggestions.http.js.map +0 -1
- package/build/internal/cjs/src/premium-domains-v2-suggestion-domain-suggestions.meta.d.ts +0 -13
- package/build/internal/cjs/src/premium-domains-v2-suggestion-domain-suggestions.meta.js +0 -47
- package/build/internal/cjs/src/premium-domains-v2-suggestion-domain-suggestions.meta.js.map +0 -1
- package/build/internal/cjs/src/premium-domains-v2-suggestion-domain-suggestions.public.js +0 -12
- package/build/internal/cjs/src/premium-domains-v2-suggestion-domain-suggestions.public.js.map +0 -1
- package/build/internal/cjs/src/premium-domains-v2-suggestion-domain-suggestions.types.js +0 -3
- package/build/internal/cjs/src/premium-domains-v2-suggestion-domain-suggestions.types.js.map +0 -1
- package/build/internal/cjs/src/premium-domains-v2-suggestion-domain-suggestions.universal.js +0 -82
- package/build/internal/cjs/src/premium-domains-v2-suggestion-domain-suggestions.universal.js.map +0 -1
- package/build/internal/es/index.d.ts +0 -1
- package/build/internal/es/index.js +0 -2
- package/build/internal/es/index.js.map +0 -1
- package/build/internal/es/index.typings.d.ts +0 -1
- package/build/internal/es/index.typings.js +0 -2
- package/build/internal/es/index.typings.js.map +0 -1
- package/build/internal/es/meta.d.ts +0 -1
- package/build/internal/es/meta.js +0 -2
- package/build/internal/es/meta.js.map +0 -1
- package/build/internal/es/src/premium-domains-v2-suggestion-domain-suggestions.context.d.ts +0 -4
- package/build/internal/es/src/premium-domains-v2-suggestion-domain-suggestions.context.js +0 -4
- package/build/internal/es/src/premium-domains-v2-suggestion-domain-suggestions.context.js.map +0 -1
- package/build/internal/es/src/premium-domains-v2-suggestion-domain-suggestions.http.d.ts +0 -11
- package/build/internal/es/src/premium-domains-v2-suggestion-domain-suggestions.http.js +0 -126
- package/build/internal/es/src/premium-domains-v2-suggestion-domain-suggestions.http.js.map +0 -1
- package/build/internal/es/src/premium-domains-v2-suggestion-domain-suggestions.meta.d.ts +0 -13
- package/build/internal/es/src/premium-domains-v2-suggestion-domain-suggestions.meta.js +0 -20
- package/build/internal/es/src/premium-domains-v2-suggestion-domain-suggestions.meta.js.map +0 -1
- package/build/internal/es/src/premium-domains-v2-suggestion-domain-suggestions.public.d.ts +0 -24
- package/build/internal/es/src/premium-domains-v2-suggestion-domain-suggestions.public.js +0 -8
- package/build/internal/es/src/premium-domains-v2-suggestion-domain-suggestions.public.js.map +0 -1
- package/build/internal/es/src/premium-domains-v2-suggestion-domain-suggestions.types.d.ts +0 -108
- package/build/internal/es/src/premium-domains-v2-suggestion-domain-suggestions.types.js +0 -2
- package/build/internal/es/src/premium-domains-v2-suggestion-domain-suggestions.types.js.map +0 -1
- package/build/internal/es/src/premium-domains-v2-suggestion-domain-suggestions.universal.js +0 -55
- package/build/internal/es/src/premium-domains-v2-suggestion-domain-suggestions.universal.js.map +0 -1
package/build/cjs/index.d.ts
CHANGED
|
@@ -1 +1,29 @@
|
|
|
1
|
-
|
|
1
|
+
import { HttpClient, NonNullablePaths, MaybeContext, BuildRESTFunction } from '@wix/sdk-types';
|
|
2
|
+
import { SuggestDomainsOptions, SuggestDomainsResponse } from './index.typings.js';
|
|
3
|
+
export { CursorPaging, CursorPagingMetadata, Cursors, DomainSuggestion, SuggestDomainsRequest } from './index.typings.js';
|
|
4
|
+
|
|
5
|
+
type SuggestionNonNullablePaths = `domain` | `premium`;
|
|
6
|
+
declare function suggestDomains$1(httpClient: HttpClient): SuggestDomainsSignature;
|
|
7
|
+
interface SuggestDomainsSignature {
|
|
8
|
+
/**
|
|
9
|
+
* Suggests domains that are available for purchase, based on the provided query input.
|
|
10
|
+
*
|
|
11
|
+
* You may use this endpoint to get inspired and then call [Check Domain Availability()](/domainAvailability/check-domain-availability) to check whether a specific variation of the suggestions is also available for purchase.
|
|
12
|
+
*
|
|
13
|
+
* The `tlds` must not include the dot. For example, `com` and not `.com`.
|
|
14
|
+
*
|
|
15
|
+
* > **Important:** This call requires an account level API key and cannot be authenticated with the standard authorization header.
|
|
16
|
+
* @param - Input to base your domain suggestions on. May include
|
|
17
|
+
* letters, numbers, spaces, dots, and hyphens. Must not include the TLD.
|
|
18
|
+
*
|
|
19
|
+
* Min: 3 characters
|
|
20
|
+
* Max: 100 characters
|
|
21
|
+
*/
|
|
22
|
+
(query: string, options?: SuggestDomainsOptions): Promise<NonNullablePaths<SuggestDomainsResponse, {
|
|
23
|
+
[P in SuggestionNonNullablePaths]: `suggestions.${number}.${P}`;
|
|
24
|
+
}[SuggestionNonNullablePaths]>>;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
declare const suggestDomains: MaybeContext<BuildRESTFunction<typeof suggestDomains$1> & typeof suggestDomains$1>;
|
|
28
|
+
|
|
29
|
+
export { SuggestDomainsOptions, SuggestDomainsResponse, suggestDomains };
|
package/build/cjs/index.js
CHANGED
|
@@ -1,18 +1,205 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
15
9
|
};
|
|
16
|
-
|
|
17
|
-
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// index.ts
|
|
21
|
+
var index_exports = {};
|
|
22
|
+
__export(index_exports, {
|
|
23
|
+
suggestDomains: () => suggestDomains4
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(index_exports);
|
|
26
|
+
|
|
27
|
+
// src/premium-domains-v2-suggestion-domain-suggestions.universal.ts
|
|
28
|
+
var import_transform_error = require("@wix/sdk-runtime/transform-error");
|
|
29
|
+
var import_rename_all_nested_keys = require("@wix/sdk-runtime/rename-all-nested-keys");
|
|
30
|
+
|
|
31
|
+
// src/premium-domains-v2-suggestion-domain-suggestions.http.ts
|
|
32
|
+
var import_rest_modules = require("@wix/sdk-runtime/rest-modules");
|
|
33
|
+
var import_rest_modules2 = require("@wix/sdk-runtime/rest-modules");
|
|
34
|
+
function resolveComWixpressPremiumDomainSearchSuggestV2DomainSearchServiceUrl(opts) {
|
|
35
|
+
const domainToMappings = {
|
|
36
|
+
"www._base_domain_": [
|
|
37
|
+
{
|
|
38
|
+
srcPath: "/domain-search/v2",
|
|
39
|
+
destPath: "/v2"
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
srcPath: "/v2/suggest-domains",
|
|
43
|
+
destPath: "/v2/suggest-domains"
|
|
44
|
+
}
|
|
45
|
+
],
|
|
46
|
+
"manage._base_domain_": [
|
|
47
|
+
{
|
|
48
|
+
srcPath: "/v2/check-domain-availability",
|
|
49
|
+
destPath: "/v2/check-domain-availability"
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
srcPath: "/v2/suggest-domains",
|
|
53
|
+
destPath: "/v2/suggest-domains"
|
|
54
|
+
}
|
|
55
|
+
],
|
|
56
|
+
"premium._base_domain_": [
|
|
57
|
+
{
|
|
58
|
+
srcPath: "/v2/check-domain-availability",
|
|
59
|
+
destPath: "/v2/check-domain-availability"
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
srcPath: "/v2/suggest-domains",
|
|
63
|
+
destPath: "/v2/suggest-domains"
|
|
64
|
+
}
|
|
65
|
+
],
|
|
66
|
+
"www.wixapis.com": [
|
|
67
|
+
{
|
|
68
|
+
srcPath: "/domain-search/v2",
|
|
69
|
+
destPath: "/v2"
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
srcPath: "/premium/domains/v2/check-domain-availability",
|
|
73
|
+
destPath: "/v2/check-domain-availability"
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
srcPath: "/premium/domains/v2/suggest-domains",
|
|
77
|
+
destPath: "/v2/suggest-domains"
|
|
78
|
+
}
|
|
79
|
+
],
|
|
80
|
+
"editor._base_domain_": [
|
|
81
|
+
{
|
|
82
|
+
srcPath: "/v2/check-domain-availability",
|
|
83
|
+
destPath: "/v2/check-domain-availability"
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
srcPath: "/v2/suggest-domains",
|
|
87
|
+
destPath: "/v2/suggest-domains"
|
|
88
|
+
}
|
|
89
|
+
],
|
|
90
|
+
"blocks._base_domain_": [
|
|
91
|
+
{
|
|
92
|
+
srcPath: "/v2/check-domain-availability",
|
|
93
|
+
destPath: "/v2/check-domain-availability"
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
srcPath: "/v2/suggest-domains",
|
|
97
|
+
destPath: "/v2/suggest-domains"
|
|
98
|
+
}
|
|
99
|
+
],
|
|
100
|
+
"create.editorx": [
|
|
101
|
+
{
|
|
102
|
+
srcPath: "/v2/check-domain-availability",
|
|
103
|
+
destPath: "/v2/check-domain-availability"
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
srcPath: "/v2/suggest-domains",
|
|
107
|
+
destPath: "/v2/suggest-domains"
|
|
108
|
+
}
|
|
109
|
+
],
|
|
110
|
+
"*.dev.wix-code.com": [
|
|
111
|
+
{
|
|
112
|
+
srcPath: "/premium/domains/v2/check-domain-availability",
|
|
113
|
+
destPath: "/v2/check-domain-availability"
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
srcPath: "/premium/domains/v2/suggest-domains",
|
|
117
|
+
destPath: "/v2/suggest-domains"
|
|
118
|
+
}
|
|
119
|
+
],
|
|
120
|
+
_: [
|
|
121
|
+
{
|
|
122
|
+
srcPath: "/premium/domains/v2/check-domain-availability",
|
|
123
|
+
destPath: "/v2/check-domain-availability"
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
srcPath: "/premium/domains/v2/suggest-domains",
|
|
127
|
+
destPath: "/v2/suggest-domains"
|
|
128
|
+
}
|
|
129
|
+
]
|
|
130
|
+
};
|
|
131
|
+
return (0, import_rest_modules2.resolveUrl)(Object.assign(opts, { domainToMappings }));
|
|
132
|
+
}
|
|
133
|
+
var PACKAGE_NAME = "@wix/auto_sdk_domains_domain-suggestions";
|
|
134
|
+
function suggestDomains(payload) {
|
|
135
|
+
function __suggestDomains({ host }) {
|
|
136
|
+
const metadata = {
|
|
137
|
+
entityFqdn: "wix.premium.domains.v2.suggestion",
|
|
138
|
+
method: "GET",
|
|
139
|
+
methodFqn: "com.wixpress.premium.domain.search.suggest.v2.DomainSearchService.SuggestDomains",
|
|
140
|
+
packageName: PACKAGE_NAME,
|
|
141
|
+
url: resolveComWixpressPremiumDomainSearchSuggestV2DomainSearchServiceUrl(
|
|
142
|
+
{ protoPath: "/v2/suggest-domains", data: payload, host }
|
|
143
|
+
),
|
|
144
|
+
params: (0, import_rest_modules.toURLSearchParams)(payload)
|
|
145
|
+
};
|
|
146
|
+
return metadata;
|
|
147
|
+
}
|
|
148
|
+
return __suggestDomains;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
// src/premium-domains-v2-suggestion-domain-suggestions.universal.ts
|
|
152
|
+
async function suggestDomains2(query, options) {
|
|
153
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
154
|
+
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
155
|
+
query,
|
|
156
|
+
tlds: options?.tlds,
|
|
157
|
+
limit: options?.limit,
|
|
158
|
+
paging: options?.paging,
|
|
159
|
+
maxLength: options?.maxLength
|
|
160
|
+
});
|
|
161
|
+
const reqOpts = suggestDomains(payload);
|
|
162
|
+
sideEffects?.onSiteCall?.();
|
|
163
|
+
try {
|
|
164
|
+
const result = await httpClient.request(reqOpts);
|
|
165
|
+
sideEffects?.onSuccess?.(result);
|
|
166
|
+
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
|
|
167
|
+
} catch (err) {
|
|
168
|
+
const transformedError = (0, import_transform_error.transformError)(
|
|
169
|
+
err,
|
|
170
|
+
{
|
|
171
|
+
spreadPathsToArguments: {},
|
|
172
|
+
explicitPathsToArguments: {
|
|
173
|
+
query: "$[0]",
|
|
174
|
+
tlds: "$[1].tlds",
|
|
175
|
+
limit: "$[1].limit",
|
|
176
|
+
paging: "$[1].paging",
|
|
177
|
+
maxLength: "$[1].maxLength"
|
|
178
|
+
},
|
|
179
|
+
singleArgumentUnchanged: false
|
|
180
|
+
},
|
|
181
|
+
["query", "options"]
|
|
182
|
+
);
|
|
183
|
+
sideEffects?.onError?.(err);
|
|
184
|
+
throw transformedError;
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
// src/premium-domains-v2-suggestion-domain-suggestions.public.ts
|
|
189
|
+
function suggestDomains3(httpClient) {
|
|
190
|
+
return (query, options) => suggestDomains2(
|
|
191
|
+
query,
|
|
192
|
+
options,
|
|
193
|
+
// @ts-ignore
|
|
194
|
+
{ httpClient }
|
|
195
|
+
);
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
// src/premium-domains-v2-suggestion-domain-suggestions.context.ts
|
|
199
|
+
var import_rest_modules3 = require("@wix/sdk-runtime/rest-modules");
|
|
200
|
+
var suggestDomains4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(suggestDomains3);
|
|
201
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
202
|
+
0 && (module.exports = {
|
|
203
|
+
suggestDomains
|
|
204
|
+
});
|
|
18
205
|
//# sourceMappingURL=index.js.map
|
package/build/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,oGAAkF"}
|
|
1
|
+
{"version":3,"sources":["../../index.ts","../../src/premium-domains-v2-suggestion-domain-suggestions.universal.ts","../../src/premium-domains-v2-suggestion-domain-suggestions.http.ts","../../src/premium-domains-v2-suggestion-domain-suggestions.public.ts","../../src/premium-domains-v2-suggestion-domain-suggestions.context.ts"],"sourcesContent":["export * from './src/premium-domains-v2-suggestion-domain-suggestions.context.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, NonNullablePaths } from '@wix/sdk-types';\nimport * as ambassadorWixPremiumDomainsV2Suggestion from './premium-domains-v2-suggestion-domain-suggestions.http.js';\n\nexport interface DomainSuggestion {\n /**\n * Suggested domain name including TLD.\n * @format HOSTNAME\n */\n domain?: string;\n /** Whether the domain has a higher price due to its perceived value or demand. */\n premium?: boolean;\n}\n\nexport interface SuggestDomainsRequest {\n /**\n * Input to base your domain suggestions on. May include\n * letters, numbers, spaces, dots, and hyphens. Must not include the TLD.\n *\n * Min: 3 characters\n * Max: 100 characters\n * @minLength 3\n * @maxLength 100\n */\n query: string;\n /**\n * [Top-level domains](https://en.wikipedia.org/wiki/Top-level_domain). Must\n * not include the dot. For example, `com`, not `.com`. Not all TLDs can be\n * connected to Wix sites. Supported TLDS include `com`, `net`, and `org`.\n * Contact the [Wix B2B sales team](mailto:bizdev@wix.com) for more\n * information.\n *\n * Max: 10 TLDs\n * @maxSize 10\n * @maxLength 63\n */\n tlds?: string[];\n /**\n * Number of domain suggestions to return. __Deprecated__: This field will be\n * removed on March 1, 2025. Use `paging.limit` instead.\n *\n * Min: `1`\n * Max: `20`\n * Default: `10`\n * @min 1\n * @max 20\n * @deprecated Number of domain suggestions to return. __Deprecated__: This field will be\n * removed on March 1, 2025. Use `paging.limit` instead.\n *\n * Min: `1`\n * Max: `20`\n * Default: `10`\n * @replacedBy paging.limit\n * @targetRemovalDate 2025-03-01\n */\n limit?: number | null;\n /** Cursor paging options. */\n paging?: CursorPaging;\n /**\n * Maximum number of characters for the domain name, excluding the TLD.\n *\n * Min: `3`\n * Max: `63`\n * Default: `63`\n * @min 3\n * @max 63\n */\n maxLength?: number | null;\n}\n\nexport interface CursorPaging {\n /**\n * Maximum number of domains to return in the results.\n *\n * Min: `0`\n * Max: `20`\n * @min 1\n * @max 20\n */\n limit?: number | null;\n /**\n * Pointer to the next or previous page in the list of results.\n *\n * You can get the relevant cursor token\n * from the `pagingMetadata` object in the previous call's response.\n * Not relevant for the first request.\n * @maxLength 10000\n */\n cursor?: string | null;\n}\n\nexport interface SuggestDomainsResponse {\n /** List of suggested available domains. */\n suggestions?: DomainSuggestion[];\n /** Metadata about the returned list of suggested domains. */\n pagingMetadata?: CursorPagingMetadata;\n}\n\nexport interface CursorPagingMetadata {\n /** Number of domains returned in the response. */\n count?: number | null;\n /** Cursors to navigate through the result pages using `next` and `prev`. Returned if cursor paging is used. */\n cursors?: Cursors;\n /**\n * Indicates if there are more results after the current page.\n * If `true`, another page of results can be retrieved.\n * If `false`, this is the last page.\n */\n hasNext?: boolean | null;\n}\n\nexport interface Cursors {\n /** Cursor pointing to next page in the list of results. */\n next?: string | null;\n /** Cursor pointing to previous page in the list of results. */\n prev?: string | null;\n}\n\ntype SuggestionNonNullablePaths = `domain` | `premium`;\n\n/**\n * Suggests domains that are available for purchase, based on the provided query input.\n *\n * You may use this endpoint to get inspired and then call [Check Domain Availability()](/domainAvailability/check-domain-availability) to check whether a specific variation of the suggestions is also available for purchase.\n *\n * The `tlds` must not include the dot. For example, `com` and not `.com`.\n *\n * > **Important:** This call requires an account level API key and cannot be authenticated with the standard authorization header.\n * @param query - Input to base your domain suggestions on. May include\n * letters, numbers, spaces, dots, and hyphens. Must not include the TLD.\n *\n * Min: 3 characters\n * Max: 100 characters\n * @public\n * @requiredField query\n * @permissionId DOMAINS.PUBLIC_API_PERMISSION\n * @fqn com.wixpress.premium.domain.search.suggest.v2.DomainSearchService.SuggestDomains\n */\nexport async function suggestDomains(\n query: string,\n options?: SuggestDomainsOptions\n): Promise<\n NonNullablePaths<\n SuggestDomainsResponse,\n {\n [P in SuggestionNonNullablePaths]: `suggestions.${number}.${P}`;\n }[SuggestionNonNullablePaths]\n >\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[2] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n query: query,\n tlds: options?.tlds,\n limit: options?.limit,\n paging: options?.paging,\n maxLength: options?.maxLength,\n });\n\n const reqOpts =\n ambassadorWixPremiumDomainsV2Suggestion.suggestDomains(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 query: '$[0]',\n tlds: '$[1].tlds',\n limit: '$[1].limit',\n paging: '$[1].paging',\n maxLength: '$[1].maxLength',\n },\n singleArgumentUnchanged: false,\n },\n ['query', 'options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface SuggestDomainsOptions {\n /**\n * [Top-level domains](https://en.wikipedia.org/wiki/Top-level_domain). Must\n * not include the dot. For example, `com`, not `.com`. Not all TLDs can be\n * connected to Wix sites. Supported TLDS include `com`, `net`, and `org`.\n * Contact the [Wix B2B sales team](mailto:bizdev@wix.com) for more\n * information.\n *\n * Max: 10 TLDs\n * @maxSize 10\n * @maxLength 63\n */\n tlds?: string[];\n /**\n * Number of domain suggestions to return. __Deprecated__: This field will be\n * removed on March 1, 2025. Use `paging.limit` instead.\n *\n * Min: `1`\n * Max: `20`\n * Default: `10`\n * @min 1\n * @max 20\n * @deprecated Number of domain suggestions to return. __Deprecated__: This field will be\n * removed on March 1, 2025. Use `paging.limit` instead.\n *\n * Min: `1`\n * Max: `20`\n * Default: `10`\n * @replacedBy paging.limit\n * @targetRemovalDate 2025-03-01\n */\n limit?: number | null;\n /** Cursor paging options. */\n paging?: CursorPaging;\n /**\n * Maximum number of characters for the domain name, excluding the TLD.\n *\n * Min: `3`\n * Max: `63`\n * Default: `63`\n * @min 3\n * @max 63\n */\n maxLength?: number | 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 resolveComWixpressPremiumDomainSearchSuggestV2DomainSearchServiceUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'www._base_domain_': [\n {\n srcPath: '/domain-search/v2',\n destPath: '/v2',\n },\n {\n srcPath: '/v2/suggest-domains',\n destPath: '/v2/suggest-domains',\n },\n ],\n 'manage._base_domain_': [\n {\n srcPath: '/v2/check-domain-availability',\n destPath: '/v2/check-domain-availability',\n },\n {\n srcPath: '/v2/suggest-domains',\n destPath: '/v2/suggest-domains',\n },\n ],\n 'premium._base_domain_': [\n {\n srcPath: '/v2/check-domain-availability',\n destPath: '/v2/check-domain-availability',\n },\n {\n srcPath: '/v2/suggest-domains',\n destPath: '/v2/suggest-domains',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/domain-search/v2',\n destPath: '/v2',\n },\n {\n srcPath: '/premium/domains/v2/check-domain-availability',\n destPath: '/v2/check-domain-availability',\n },\n {\n srcPath: '/premium/domains/v2/suggest-domains',\n destPath: '/v2/suggest-domains',\n },\n ],\n 'editor._base_domain_': [\n {\n srcPath: '/v2/check-domain-availability',\n destPath: '/v2/check-domain-availability',\n },\n {\n srcPath: '/v2/suggest-domains',\n destPath: '/v2/suggest-domains',\n },\n ],\n 'blocks._base_domain_': [\n {\n srcPath: '/v2/check-domain-availability',\n destPath: '/v2/check-domain-availability',\n },\n {\n srcPath: '/v2/suggest-domains',\n destPath: '/v2/suggest-domains',\n },\n ],\n 'create.editorx': [\n {\n srcPath: '/v2/check-domain-availability',\n destPath: '/v2/check-domain-availability',\n },\n {\n srcPath: '/v2/suggest-domains',\n destPath: '/v2/suggest-domains',\n },\n ],\n '*.dev.wix-code.com': [\n {\n srcPath: '/premium/domains/v2/check-domain-availability',\n destPath: '/v2/check-domain-availability',\n },\n {\n srcPath: '/premium/domains/v2/suggest-domains',\n destPath: '/v2/suggest-domains',\n },\n ],\n _: [\n {\n srcPath: '/premium/domains/v2/check-domain-availability',\n destPath: '/v2/check-domain-availability',\n },\n {\n srcPath: '/premium/domains/v2/suggest-domains',\n destPath: '/v2/suggest-domains',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_domains_domain-suggestions';\n\n/**\n * Suggests domains that are available for purchase, based on the provided query input.\n *\n * You may use this endpoint to get inspired and then call [Check Domain Availability()](/domainAvailability/check-domain-availability) to check whether a specific variation of the suggestions is also available for purchase.\n *\n * The `tlds` must not include the dot. For example, `com` and not `.com`.\n *\n * > **Important:** This call requires an account level API key and cannot be authenticated with the standard authorization header.\n */\nexport function suggestDomains(payload: object): RequestOptionsFactory<any> {\n function __suggestDomains({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.premium.domains.v2.suggestion',\n method: 'GET' as any,\n methodFqn:\n 'com.wixpress.premium.domain.search.suggest.v2.DomainSearchService.SuggestDomains',\n packageName: PACKAGE_NAME,\n url: resolveComWixpressPremiumDomainSearchSuggestV2DomainSearchServiceUrl(\n { protoPath: '/v2/suggest-domains', data: payload, host }\n ),\n params: toURLSearchParams(payload),\n };\n\n return metadata;\n }\n\n return __suggestDomains;\n}\n","import { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport {\n SuggestDomainsOptions,\n SuggestDomainsResponse,\n suggestDomains as universalSuggestDomains,\n} from './premium-domains-v2-suggestion-domain-suggestions.universal.js';\n\nexport const __metadata = { PACKAGE_NAME: '@wix/domains' };\n\ntype SuggestionNonNullablePaths = `domain` | `premium`;\n\nexport function suggestDomains(\n httpClient: HttpClient\n): SuggestDomainsSignature {\n return (query: string, options?: SuggestDomainsOptions) =>\n universalSuggestDomains(\n query,\n options,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface SuggestDomainsSignature {\n /**\n * Suggests domains that are available for purchase, based on the provided query input.\n *\n * You may use this endpoint to get inspired and then call [Check Domain Availability()](/domainAvailability/check-domain-availability) to check whether a specific variation of the suggestions is also available for purchase.\n *\n * The `tlds` must not include the dot. For example, `com` and not `.com`.\n *\n * > **Important:** This call requires an account level API key and cannot be authenticated with the standard authorization header.\n * @param - Input to base your domain suggestions on. May include\n * letters, numbers, spaces, dots, and hyphens. Must not include the TLD.\n *\n * Min: 3 characters\n * Max: 100 characters\n */\n (query: string, options?: SuggestDomainsOptions): Promise<\n NonNullablePaths<\n SuggestDomainsResponse,\n {\n [P in SuggestionNonNullablePaths]: `suggestions.${number}.${P}`;\n }[SuggestionNonNullablePaths]\n >\n >;\n}\n\nexport {\n CursorPaging,\n CursorPagingMetadata,\n Cursors,\n DomainSuggestion,\n SuggestDomainsOptions,\n SuggestDomainsRequest,\n SuggestDomainsResponse,\n} from './premium-domains-v2-suggestion-domain-suggestions.universal.js';\n","import { suggestDomains as publicSuggestDomains } from './premium-domains-v2-suggestion-domain-suggestions.public.js';\nimport { createRESTModule } from '@wix/sdk-runtime/rest-modules';\nimport { BuildRESTFunction, MaybeContext } from '@wix/sdk-types';\n\nexport const suggestDomains: MaybeContext<\n BuildRESTFunction<typeof publicSuggestDomains> & typeof publicSuggestDomains\n> = /*#__PURE__*/ createRESTModule(publicSuggestDomains);\n\nexport {\n DomainSuggestion,\n SuggestDomainsRequest,\n CursorPaging,\n SuggestDomainsResponse,\n CursorPagingMetadata,\n Cursors,\n SuggestDomainsOptions,\n} from './premium-domains-v2-suggestion-domain-suggestions.universal.js';\n"],"mappings":"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","names":["suggestDomains","import_rest_modules","suggestDomains","sdkTransformError","suggestDomains","import_rest_modules","suggestDomains"]}
|
|
@@ -1 +1,179 @@
|
|
|
1
|
-
|
|
1
|
+
import { NonNullablePaths } from '@wix/sdk-types';
|
|
2
|
+
|
|
3
|
+
interface DomainSuggestion {
|
|
4
|
+
/**
|
|
5
|
+
* Suggested domain name including TLD.
|
|
6
|
+
* @format HOSTNAME
|
|
7
|
+
*/
|
|
8
|
+
domain?: string;
|
|
9
|
+
/** Whether the domain has a higher price due to its perceived value or demand. */
|
|
10
|
+
premium?: boolean;
|
|
11
|
+
}
|
|
12
|
+
interface SuggestDomainsRequest {
|
|
13
|
+
/**
|
|
14
|
+
* Input to base your domain suggestions on. May include
|
|
15
|
+
* letters, numbers, spaces, dots, and hyphens. Must not include the TLD.
|
|
16
|
+
*
|
|
17
|
+
* Min: 3 characters
|
|
18
|
+
* Max: 100 characters
|
|
19
|
+
* @minLength 3
|
|
20
|
+
* @maxLength 100
|
|
21
|
+
*/
|
|
22
|
+
query: string;
|
|
23
|
+
/**
|
|
24
|
+
* [Top-level domains](https://en.wikipedia.org/wiki/Top-level_domain). Must
|
|
25
|
+
* not include the dot. For example, `com`, not `.com`. Not all TLDs can be
|
|
26
|
+
* connected to Wix sites. Supported TLDS include `com`, `net`, and `org`.
|
|
27
|
+
* Contact the [Wix B2B sales team](mailto:bizdev@wix.com) for more
|
|
28
|
+
* information.
|
|
29
|
+
*
|
|
30
|
+
* Max: 10 TLDs
|
|
31
|
+
* @maxSize 10
|
|
32
|
+
* @maxLength 63
|
|
33
|
+
*/
|
|
34
|
+
tlds?: string[];
|
|
35
|
+
/**
|
|
36
|
+
* Number of domain suggestions to return. __Deprecated__: This field will be
|
|
37
|
+
* removed on March 1, 2025. Use `paging.limit` instead.
|
|
38
|
+
*
|
|
39
|
+
* Min: `1`
|
|
40
|
+
* Max: `20`
|
|
41
|
+
* Default: `10`
|
|
42
|
+
* @min 1
|
|
43
|
+
* @max 20
|
|
44
|
+
* @deprecated Number of domain suggestions to return. __Deprecated__: This field will be
|
|
45
|
+
* removed on March 1, 2025. Use `paging.limit` instead.
|
|
46
|
+
*
|
|
47
|
+
* Min: `1`
|
|
48
|
+
* Max: `20`
|
|
49
|
+
* Default: `10`
|
|
50
|
+
* @replacedBy paging.limit
|
|
51
|
+
* @targetRemovalDate 2025-03-01
|
|
52
|
+
*/
|
|
53
|
+
limit?: number | null;
|
|
54
|
+
/** Cursor paging options. */
|
|
55
|
+
paging?: CursorPaging;
|
|
56
|
+
/**
|
|
57
|
+
* Maximum number of characters for the domain name, excluding the TLD.
|
|
58
|
+
*
|
|
59
|
+
* Min: `3`
|
|
60
|
+
* Max: `63`
|
|
61
|
+
* Default: `63`
|
|
62
|
+
* @min 3
|
|
63
|
+
* @max 63
|
|
64
|
+
*/
|
|
65
|
+
maxLength?: number | null;
|
|
66
|
+
}
|
|
67
|
+
interface CursorPaging {
|
|
68
|
+
/**
|
|
69
|
+
* Maximum number of domains to return in the results.
|
|
70
|
+
*
|
|
71
|
+
* Min: `0`
|
|
72
|
+
* Max: `20`
|
|
73
|
+
* @min 1
|
|
74
|
+
* @max 20
|
|
75
|
+
*/
|
|
76
|
+
limit?: number | null;
|
|
77
|
+
/**
|
|
78
|
+
* Pointer to the next or previous page in the list of results.
|
|
79
|
+
*
|
|
80
|
+
* You can get the relevant cursor token
|
|
81
|
+
* from the `pagingMetadata` object in the previous call's response.
|
|
82
|
+
* Not relevant for the first request.
|
|
83
|
+
* @maxLength 10000
|
|
84
|
+
*/
|
|
85
|
+
cursor?: string | null;
|
|
86
|
+
}
|
|
87
|
+
interface SuggestDomainsResponse {
|
|
88
|
+
/** List of suggested available domains. */
|
|
89
|
+
suggestions?: DomainSuggestion[];
|
|
90
|
+
/** Metadata about the returned list of suggested domains. */
|
|
91
|
+
pagingMetadata?: CursorPagingMetadata;
|
|
92
|
+
}
|
|
93
|
+
interface CursorPagingMetadata {
|
|
94
|
+
/** Number of domains returned in the response. */
|
|
95
|
+
count?: number | null;
|
|
96
|
+
/** Cursors to navigate through the result pages using `next` and `prev`. Returned if cursor paging is used. */
|
|
97
|
+
cursors?: Cursors;
|
|
98
|
+
/**
|
|
99
|
+
* Indicates if there are more results after the current page.
|
|
100
|
+
* If `true`, another page of results can be retrieved.
|
|
101
|
+
* If `false`, this is the last page.
|
|
102
|
+
*/
|
|
103
|
+
hasNext?: boolean | null;
|
|
104
|
+
}
|
|
105
|
+
interface Cursors {
|
|
106
|
+
/** Cursor pointing to next page in the list of results. */
|
|
107
|
+
next?: string | null;
|
|
108
|
+
/** Cursor pointing to previous page in the list of results. */
|
|
109
|
+
prev?: string | null;
|
|
110
|
+
}
|
|
111
|
+
type SuggestionNonNullablePaths = `domain` | `premium`;
|
|
112
|
+
/**
|
|
113
|
+
* Suggests domains that are available for purchase, based on the provided query input.
|
|
114
|
+
*
|
|
115
|
+
* You may use this endpoint to get inspired and then call [Check Domain Availability()](/domainAvailability/check-domain-availability) to check whether a specific variation of the suggestions is also available for purchase.
|
|
116
|
+
*
|
|
117
|
+
* The `tlds` must not include the dot. For example, `com` and not `.com`.
|
|
118
|
+
*
|
|
119
|
+
* > **Important:** This call requires an account level API key and cannot be authenticated with the standard authorization header.
|
|
120
|
+
* @param query - Input to base your domain suggestions on. May include
|
|
121
|
+
* letters, numbers, spaces, dots, and hyphens. Must not include the TLD.
|
|
122
|
+
*
|
|
123
|
+
* Min: 3 characters
|
|
124
|
+
* Max: 100 characters
|
|
125
|
+
* @public
|
|
126
|
+
* @requiredField query
|
|
127
|
+
* @permissionId DOMAINS.PUBLIC_API_PERMISSION
|
|
128
|
+
* @fqn com.wixpress.premium.domain.search.suggest.v2.DomainSearchService.SuggestDomains
|
|
129
|
+
*/
|
|
130
|
+
declare function suggestDomains(query: string, options?: SuggestDomainsOptions): Promise<NonNullablePaths<SuggestDomainsResponse, {
|
|
131
|
+
[P in SuggestionNonNullablePaths]: `suggestions.${number}.${P}`;
|
|
132
|
+
}[SuggestionNonNullablePaths]>>;
|
|
133
|
+
interface SuggestDomainsOptions {
|
|
134
|
+
/**
|
|
135
|
+
* [Top-level domains](https://en.wikipedia.org/wiki/Top-level_domain). Must
|
|
136
|
+
* not include the dot. For example, `com`, not `.com`. Not all TLDs can be
|
|
137
|
+
* connected to Wix sites. Supported TLDS include `com`, `net`, and `org`.
|
|
138
|
+
* Contact the [Wix B2B sales team](mailto:bizdev@wix.com) for more
|
|
139
|
+
* information.
|
|
140
|
+
*
|
|
141
|
+
* Max: 10 TLDs
|
|
142
|
+
* @maxSize 10
|
|
143
|
+
* @maxLength 63
|
|
144
|
+
*/
|
|
145
|
+
tlds?: string[];
|
|
146
|
+
/**
|
|
147
|
+
* Number of domain suggestions to return. __Deprecated__: This field will be
|
|
148
|
+
* removed on March 1, 2025. Use `paging.limit` instead.
|
|
149
|
+
*
|
|
150
|
+
* Min: `1`
|
|
151
|
+
* Max: `20`
|
|
152
|
+
* Default: `10`
|
|
153
|
+
* @min 1
|
|
154
|
+
* @max 20
|
|
155
|
+
* @deprecated Number of domain suggestions to return. __Deprecated__: This field will be
|
|
156
|
+
* removed on March 1, 2025. Use `paging.limit` instead.
|
|
157
|
+
*
|
|
158
|
+
* Min: `1`
|
|
159
|
+
* Max: `20`
|
|
160
|
+
* Default: `10`
|
|
161
|
+
* @replacedBy paging.limit
|
|
162
|
+
* @targetRemovalDate 2025-03-01
|
|
163
|
+
*/
|
|
164
|
+
limit?: number | null;
|
|
165
|
+
/** Cursor paging options. */
|
|
166
|
+
paging?: CursorPaging;
|
|
167
|
+
/**
|
|
168
|
+
* Maximum number of characters for the domain name, excluding the TLD.
|
|
169
|
+
*
|
|
170
|
+
* Min: `3`
|
|
171
|
+
* Max: `63`
|
|
172
|
+
* Default: `63`
|
|
173
|
+
* @min 3
|
|
174
|
+
* @max 63
|
|
175
|
+
*/
|
|
176
|
+
maxLength?: number | null;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
export { type CursorPaging, type CursorPagingMetadata, type Cursors, type DomainSuggestion, type SuggestDomainsOptions, type SuggestDomainsRequest, type SuggestDomainsResponse, suggestDomains };
|
|
@@ -1,18 +1,191 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
15
9
|
};
|
|
16
|
-
|
|
17
|
-
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// index.typings.ts
|
|
21
|
+
var index_typings_exports = {};
|
|
22
|
+
__export(index_typings_exports, {
|
|
23
|
+
suggestDomains: () => suggestDomains2
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(index_typings_exports);
|
|
26
|
+
|
|
27
|
+
// src/premium-domains-v2-suggestion-domain-suggestions.universal.ts
|
|
28
|
+
var import_transform_error = require("@wix/sdk-runtime/transform-error");
|
|
29
|
+
var import_rename_all_nested_keys = require("@wix/sdk-runtime/rename-all-nested-keys");
|
|
30
|
+
|
|
31
|
+
// src/premium-domains-v2-suggestion-domain-suggestions.http.ts
|
|
32
|
+
var import_rest_modules = require("@wix/sdk-runtime/rest-modules");
|
|
33
|
+
var import_rest_modules2 = require("@wix/sdk-runtime/rest-modules");
|
|
34
|
+
function resolveComWixpressPremiumDomainSearchSuggestV2DomainSearchServiceUrl(opts) {
|
|
35
|
+
const domainToMappings = {
|
|
36
|
+
"www._base_domain_": [
|
|
37
|
+
{
|
|
38
|
+
srcPath: "/domain-search/v2",
|
|
39
|
+
destPath: "/v2"
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
srcPath: "/v2/suggest-domains",
|
|
43
|
+
destPath: "/v2/suggest-domains"
|
|
44
|
+
}
|
|
45
|
+
],
|
|
46
|
+
"manage._base_domain_": [
|
|
47
|
+
{
|
|
48
|
+
srcPath: "/v2/check-domain-availability",
|
|
49
|
+
destPath: "/v2/check-domain-availability"
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
srcPath: "/v2/suggest-domains",
|
|
53
|
+
destPath: "/v2/suggest-domains"
|
|
54
|
+
}
|
|
55
|
+
],
|
|
56
|
+
"premium._base_domain_": [
|
|
57
|
+
{
|
|
58
|
+
srcPath: "/v2/check-domain-availability",
|
|
59
|
+
destPath: "/v2/check-domain-availability"
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
srcPath: "/v2/suggest-domains",
|
|
63
|
+
destPath: "/v2/suggest-domains"
|
|
64
|
+
}
|
|
65
|
+
],
|
|
66
|
+
"www.wixapis.com": [
|
|
67
|
+
{
|
|
68
|
+
srcPath: "/domain-search/v2",
|
|
69
|
+
destPath: "/v2"
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
srcPath: "/premium/domains/v2/check-domain-availability",
|
|
73
|
+
destPath: "/v2/check-domain-availability"
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
srcPath: "/premium/domains/v2/suggest-domains",
|
|
77
|
+
destPath: "/v2/suggest-domains"
|
|
78
|
+
}
|
|
79
|
+
],
|
|
80
|
+
"editor._base_domain_": [
|
|
81
|
+
{
|
|
82
|
+
srcPath: "/v2/check-domain-availability",
|
|
83
|
+
destPath: "/v2/check-domain-availability"
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
srcPath: "/v2/suggest-domains",
|
|
87
|
+
destPath: "/v2/suggest-domains"
|
|
88
|
+
}
|
|
89
|
+
],
|
|
90
|
+
"blocks._base_domain_": [
|
|
91
|
+
{
|
|
92
|
+
srcPath: "/v2/check-domain-availability",
|
|
93
|
+
destPath: "/v2/check-domain-availability"
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
srcPath: "/v2/suggest-domains",
|
|
97
|
+
destPath: "/v2/suggest-domains"
|
|
98
|
+
}
|
|
99
|
+
],
|
|
100
|
+
"create.editorx": [
|
|
101
|
+
{
|
|
102
|
+
srcPath: "/v2/check-domain-availability",
|
|
103
|
+
destPath: "/v2/check-domain-availability"
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
srcPath: "/v2/suggest-domains",
|
|
107
|
+
destPath: "/v2/suggest-domains"
|
|
108
|
+
}
|
|
109
|
+
],
|
|
110
|
+
"*.dev.wix-code.com": [
|
|
111
|
+
{
|
|
112
|
+
srcPath: "/premium/domains/v2/check-domain-availability",
|
|
113
|
+
destPath: "/v2/check-domain-availability"
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
srcPath: "/premium/domains/v2/suggest-domains",
|
|
117
|
+
destPath: "/v2/suggest-domains"
|
|
118
|
+
}
|
|
119
|
+
],
|
|
120
|
+
_: [
|
|
121
|
+
{
|
|
122
|
+
srcPath: "/premium/domains/v2/check-domain-availability",
|
|
123
|
+
destPath: "/v2/check-domain-availability"
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
srcPath: "/premium/domains/v2/suggest-domains",
|
|
127
|
+
destPath: "/v2/suggest-domains"
|
|
128
|
+
}
|
|
129
|
+
]
|
|
130
|
+
};
|
|
131
|
+
return (0, import_rest_modules2.resolveUrl)(Object.assign(opts, { domainToMappings }));
|
|
132
|
+
}
|
|
133
|
+
var PACKAGE_NAME = "@wix/auto_sdk_domains_domain-suggestions";
|
|
134
|
+
function suggestDomains(payload) {
|
|
135
|
+
function __suggestDomains({ host }) {
|
|
136
|
+
const metadata = {
|
|
137
|
+
entityFqdn: "wix.premium.domains.v2.suggestion",
|
|
138
|
+
method: "GET",
|
|
139
|
+
methodFqn: "com.wixpress.premium.domain.search.suggest.v2.DomainSearchService.SuggestDomains",
|
|
140
|
+
packageName: PACKAGE_NAME,
|
|
141
|
+
url: resolveComWixpressPremiumDomainSearchSuggestV2DomainSearchServiceUrl(
|
|
142
|
+
{ protoPath: "/v2/suggest-domains", data: payload, host }
|
|
143
|
+
),
|
|
144
|
+
params: (0, import_rest_modules.toURLSearchParams)(payload)
|
|
145
|
+
};
|
|
146
|
+
return metadata;
|
|
147
|
+
}
|
|
148
|
+
return __suggestDomains;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
// src/premium-domains-v2-suggestion-domain-suggestions.universal.ts
|
|
152
|
+
async function suggestDomains2(query, options) {
|
|
153
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
154
|
+
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
155
|
+
query,
|
|
156
|
+
tlds: options?.tlds,
|
|
157
|
+
limit: options?.limit,
|
|
158
|
+
paging: options?.paging,
|
|
159
|
+
maxLength: options?.maxLength
|
|
160
|
+
});
|
|
161
|
+
const reqOpts = suggestDomains(payload);
|
|
162
|
+
sideEffects?.onSiteCall?.();
|
|
163
|
+
try {
|
|
164
|
+
const result = await httpClient.request(reqOpts);
|
|
165
|
+
sideEffects?.onSuccess?.(result);
|
|
166
|
+
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
|
|
167
|
+
} catch (err) {
|
|
168
|
+
const transformedError = (0, import_transform_error.transformError)(
|
|
169
|
+
err,
|
|
170
|
+
{
|
|
171
|
+
spreadPathsToArguments: {},
|
|
172
|
+
explicitPathsToArguments: {
|
|
173
|
+
query: "$[0]",
|
|
174
|
+
tlds: "$[1].tlds",
|
|
175
|
+
limit: "$[1].limit",
|
|
176
|
+
paging: "$[1].paging",
|
|
177
|
+
maxLength: "$[1].maxLength"
|
|
178
|
+
},
|
|
179
|
+
singleArgumentUnchanged: false
|
|
180
|
+
},
|
|
181
|
+
["query", "options"]
|
|
182
|
+
);
|
|
183
|
+
sideEffects?.onError?.(err);
|
|
184
|
+
throw transformedError;
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
188
|
+
0 && (module.exports = {
|
|
189
|
+
suggestDomains
|
|
190
|
+
});
|
|
18
191
|
//# sourceMappingURL=index.typings.js.map
|