@steamsets/client-ts 0.14.28 → 0.15.0
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/FUNCTIONS.md +4 -4
- package/README.md +83 -30
- package/docs/sdks/account/README.md +254 -98
- package/docs/sdks/internal/README.md +224 -68
- package/docs/sdks/settings/README.md +197 -41
- package/docs/sdks/steamsets/README.md +78 -0
- package/funcs/accountAccountV1SettingsEmailSendVerification.d.ts +10 -0
- package/funcs/accountAccountV1SettingsEmailSendVerification.d.ts.map +1 -0
- package/funcs/{settingsSendEmailVerification.js → accountAccountV1SettingsEmailSendVerification.js} +7 -7
- package/funcs/accountAccountV1SettingsEmailSendVerification.js.map +1 -0
- package/funcs/{accountSendEmailVerification.d.ts → accountAccountV1SettingsEmailSubscribe.d.ts} +2 -2
- package/funcs/accountAccountV1SettingsEmailSubscribe.d.ts.map +1 -0
- package/funcs/accountAccountV1SettingsEmailSubscribe.js +113 -0
- package/funcs/accountAccountV1SettingsEmailSubscribe.js.map +1 -0
- package/funcs/accountAccountV1SettingsEmailVerify.d.ts +11 -0
- package/funcs/accountAccountV1SettingsEmailVerify.d.ts.map +1 -0
- package/funcs/{accountVerifyEmail.js → accountAccountV1SettingsEmailVerify.js} +6 -6
- package/funcs/accountAccountV1SettingsEmailVerify.js.map +1 -0
- package/funcs/{accountVerifyEmail.d.ts → accountAccountV1SettingsUpdateRole.d.ts} +2 -2
- package/funcs/accountAccountV1SettingsUpdateRole.d.ts.map +1 -0
- package/funcs/accountAccountV1SettingsUpdateRole.js +113 -0
- package/funcs/accountAccountV1SettingsUpdateRole.js.map +1 -0
- package/funcs/internalAccountV1SettingsEmailSendVerification.d.ts +10 -0
- package/funcs/internalAccountV1SettingsEmailSendVerification.d.ts.map +1 -0
- package/funcs/{internalSendEmailVerification.js → internalAccountV1SettingsEmailSendVerification.js} +7 -7
- package/funcs/internalAccountV1SettingsEmailSendVerification.js.map +1 -0
- package/funcs/{internalSendEmailVerification.d.ts → internalAccountV1SettingsEmailSubscribe.d.ts} +2 -2
- package/funcs/internalAccountV1SettingsEmailSubscribe.d.ts.map +1 -0
- package/funcs/internalAccountV1SettingsEmailSubscribe.js +113 -0
- package/funcs/internalAccountV1SettingsEmailSubscribe.js.map +1 -0
- package/funcs/internalAccountV1SettingsEmailVerify.d.ts +11 -0
- package/funcs/internalAccountV1SettingsEmailVerify.d.ts.map +1 -0
- package/funcs/{settingsVerifyEmail.js → internalAccountV1SettingsEmailVerify.js} +6 -6
- package/funcs/internalAccountV1SettingsEmailVerify.js.map +1 -0
- package/funcs/{internalVerifyEmail.d.ts → internalAccountV1SettingsUpdateRole.d.ts} +2 -2
- package/funcs/internalAccountV1SettingsUpdateRole.d.ts.map +1 -0
- package/funcs/internalAccountV1SettingsUpdateRole.js +113 -0
- package/funcs/internalAccountV1SettingsUpdateRole.js.map +1 -0
- package/funcs/{settingsVerifyEmail.d.ts → resendWebhook.d.ts} +2 -4
- package/funcs/resendWebhook.d.ts.map +1 -0
- package/funcs/resendWebhook.js +114 -0
- package/funcs/resendWebhook.js.map +1 -0
- package/funcs/settingsAccountV1SettingsEmailSendVerification.d.ts +10 -0
- package/funcs/settingsAccountV1SettingsEmailSendVerification.d.ts.map +1 -0
- package/funcs/{accountSendEmailVerification.js → settingsAccountV1SettingsEmailSendVerification.js} +7 -7
- package/funcs/settingsAccountV1SettingsEmailSendVerification.js.map +1 -0
- package/funcs/{settingsSendEmailVerification.d.ts → settingsAccountV1SettingsEmailSubscribe.d.ts} +2 -2
- package/funcs/settingsAccountV1SettingsEmailSubscribe.d.ts.map +1 -0
- package/funcs/settingsAccountV1SettingsEmailSubscribe.js +113 -0
- package/funcs/settingsAccountV1SettingsEmailSubscribe.js.map +1 -0
- package/funcs/settingsAccountV1SettingsEmailVerify.d.ts +11 -0
- package/funcs/settingsAccountV1SettingsEmailVerify.d.ts.map +1 -0
- package/funcs/{internalVerifyEmail.js → settingsAccountV1SettingsEmailVerify.js} +6 -6
- package/funcs/settingsAccountV1SettingsEmailVerify.js.map +1 -0
- package/funcs/settingsAccountV1SettingsUpdateRole.d.ts +11 -0
- package/funcs/settingsAccountV1SettingsUpdateRole.d.ts.map +1 -0
- package/funcs/settingsAccountV1SettingsUpdateRole.js +113 -0
- package/funcs/settingsAccountV1SettingsUpdateRole.js.map +1 -0
- package/jsr.json +1 -1
- package/lib/config.d.ts +2 -2
- package/lib/config.js +2 -2
- package/lib/config.js.map +1 -1
- package/models/components/errormodel.d.ts +63 -0
- package/models/components/errormodel.d.ts.map +1 -0
- package/models/components/errormodel.js +81 -0
- package/models/components/errormodel.js.map +1 -0
- package/models/components/index.d.ts +3 -0
- package/models/components/index.d.ts.map +1 -1
- package/models/components/index.js +3 -0
- package/models/components/index.js.map +1 -1
- package/models/components/v1accountinforesponsebody.d.ts +8 -0
- package/models/components/v1accountinforesponsebody.d.ts.map +1 -1
- package/models/components/v1accountinforesponsebody.js +3 -0
- package/models/components/v1accountinforesponsebody.js.map +1 -1
- package/models/components/v1emailsubscriptionrequestbody.d.ts +37 -0
- package/models/components/v1emailsubscriptionrequestbody.d.ts.map +1 -0
- package/models/components/v1emailsubscriptionrequestbody.js +61 -0
- package/models/components/v1emailsubscriptionrequestbody.js.map +1 -0
- package/models/components/v1getsettingsbody.d.ts +5 -0
- package/models/components/v1getsettingsbody.d.ts.map +1 -1
- package/models/components/v1getsettingsbody.js +2 -0
- package/models/components/v1getsettingsbody.js.map +1 -1
- package/models/components/v1updaterolerequestbody.d.ts +76 -0
- package/models/components/v1updaterolerequestbody.d.ts.map +1 -0
- package/models/components/v1updaterolerequestbody.js +85 -0
- package/models/components/v1updaterolerequestbody.js.map +1 -0
- package/models/components/v1updatesettingsrequestbody.d.ts +0 -49
- package/models/components/v1updatesettingsrequestbody.d.ts.map +1 -1
- package/models/components/v1updatesettingsrequestbody.js +1 -29
- package/models/components/v1updatesettingsrequestbody.js.map +1 -1
- package/models/operations/accountv1settingsemailsendverification.d.ts +61 -0
- package/models/operations/{accountv1settingssendemailverification.d.ts.map → accountv1settingsemailsendverification.d.ts.map} +1 -1
- package/models/operations/accountv1settingsemailsendverification.js +108 -0
- package/models/operations/{accountv1settingssendemailverification.js.map → accountv1settingsemailsendverification.js.map} +1 -1
- package/models/operations/accountv1settingsemailsubscribe.d.ts +63 -0
- package/models/operations/accountv1settingsemailsubscribe.d.ts.map +1 -0
- package/models/operations/accountv1settingsemailsubscribe.js +112 -0
- package/models/operations/accountv1settingsemailsubscribe.js.map +1 -0
- package/models/operations/accountv1settingsemailverify.d.ts +36 -0
- package/models/operations/accountv1settingsemailverify.d.ts.map +1 -0
- package/models/operations/accountv1settingsemailverify.js +73 -0
- package/models/operations/accountv1settingsemailverify.js.map +1 -0
- package/models/operations/accountv1settingsupdaterole.d.ts +36 -0
- package/models/operations/{accountv1settingsverfyemail.d.ts.map → accountv1settingsupdaterole.d.ts.map} +1 -1
- package/models/operations/{accountv1settingsverfyemail.js → accountv1settingsupdaterole.js} +17 -17
- package/models/operations/{accountv1settingsverfyemail.js.map → accountv1settingsupdaterole.js.map} +1 -1
- package/models/operations/index.d.ts +5 -2
- package/models/operations/index.d.ts.map +1 -1
- package/models/operations/index.js +5 -2
- package/models/operations/index.js.map +1 -1
- package/models/operations/resendwebhook.d.ts +66 -0
- package/models/operations/resendwebhook.d.ts.map +1 -0
- package/models/operations/resendwebhook.js +130 -0
- package/models/operations/resendwebhook.js.map +1 -0
- package/package.json +1 -1
- package/sdk/account.d.ts +4 -2
- package/sdk/account.d.ts.map +1 -1
- package/sdk/account.js +16 -8
- package/sdk/account.js.map +1 -1
- package/sdk/internal.d.ts +4 -2
- package/sdk/internal.d.ts.map +1 -1
- package/sdk/internal.js +16 -8
- package/sdk/internal.js.map +1 -1
- package/sdk/sdk.d.ts +5 -3
- package/sdk/sdk.d.ts.map +1 -1
- package/sdk/sdk.js +8 -3
- package/sdk/sdk.js.map +1 -1
- package/sdk/settings.d.ts +4 -2
- package/sdk/settings.d.ts.map +1 -1
- package/sdk/settings.js +15 -7
- package/sdk/settings.js.map +1 -1
- package/src/funcs/{internalSendEmailVerification.ts → accountAccountV1SettingsEmailSendVerification.ts} +8 -8
- package/src/funcs/accountAccountV1SettingsEmailSubscribe.ts +160 -0
- package/src/funcs/{settingsVerifyEmail.ts → accountAccountV1SettingsEmailVerify.ts} +6 -6
- package/src/funcs/accountAccountV1SettingsUpdateRole.ts +149 -0
- package/src/funcs/{accountSendEmailVerification.ts → internalAccountV1SettingsEmailSendVerification.ts} +8 -8
- package/src/funcs/internalAccountV1SettingsEmailSubscribe.ts +160 -0
- package/src/funcs/{internalVerifyEmail.ts → internalAccountV1SettingsEmailVerify.ts} +6 -6
- package/src/funcs/internalAccountV1SettingsUpdateRole.ts +149 -0
- package/src/funcs/resendWebhook.ts +153 -0
- package/src/funcs/{settingsSendEmailVerification.ts → settingsAccountV1SettingsEmailSendVerification.ts} +8 -8
- package/src/funcs/settingsAccountV1SettingsEmailSubscribe.ts +160 -0
- package/src/funcs/{accountVerifyEmail.ts → settingsAccountV1SettingsEmailVerify.ts} +6 -6
- package/src/funcs/settingsAccountV1SettingsUpdateRole.ts +149 -0
- package/src/lib/config.ts +2 -2
- package/src/models/components/errormodel.ts +122 -0
- package/src/models/components/index.ts +3 -0
- package/src/models/components/v1accountinforesponsebody.ts +10 -0
- package/src/models/components/v1emailsubscriptionrequestbody.ts +78 -0
- package/src/models/components/v1getsettingsbody.ts +7 -0
- package/src/models/components/v1updaterolerequestbody.ts +109 -0
- package/src/models/components/v1updatesettingsrequestbody.ts +0 -47
- package/src/models/operations/{accountv1settingssendemailverification.ts → accountv1settingsemailsendverification.ts} +46 -46
- package/src/models/operations/accountv1settingsemailsubscribe.ts +174 -0
- package/src/models/operations/accountv1settingsemailverify.ts +87 -0
- package/src/models/operations/{accountv1settingsverfyemail.ts → accountv1settingsupdaterole.ts} +22 -22
- package/src/models/operations/index.ts +5 -2
- package/src/models/operations/resendwebhook.ts +179 -0
- package/src/sdk/account.ts +45 -21
- package/src/sdk/internal.ts +45 -21
- package/src/sdk/sdk.ts +20 -6
- package/src/sdk/settings.ts +41 -17
- package/funcs/accountSendEmailVerification.d.ts.map +0 -1
- package/funcs/accountSendEmailVerification.js.map +0 -1
- package/funcs/accountVerifyEmail.d.ts.map +0 -1
- package/funcs/accountVerifyEmail.js.map +0 -1
- package/funcs/internalSendEmailVerification.d.ts.map +0 -1
- package/funcs/internalSendEmailVerification.js.map +0 -1
- package/funcs/internalVerifyEmail.d.ts.map +0 -1
- package/funcs/internalVerifyEmail.js.map +0 -1
- package/funcs/settingsSendEmailVerification.d.ts.map +0 -1
- package/funcs/settingsSendEmailVerification.js.map +0 -1
- package/funcs/settingsVerifyEmail.d.ts.map +0 -1
- package/funcs/settingsVerifyEmail.js.map +0 -1
- package/models/operations/accountv1settingssendemailverification.d.ts +0 -61
- package/models/operations/accountv1settingssendemailverification.js +0 -108
- package/models/operations/accountv1settingsverfyemail.d.ts +0 -36
package/sdk/settings.js
CHANGED
|
@@ -4,25 +4,33 @@
|
|
|
4
4
|
*/
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.Settings = void 0;
|
|
7
|
+
const settingsAccountV1SettingsEmailSendVerification_js_1 = require("../funcs/settingsAccountV1SettingsEmailSendVerification.js");
|
|
8
|
+
const settingsAccountV1SettingsEmailSubscribe_js_1 = require("../funcs/settingsAccountV1SettingsEmailSubscribe.js");
|
|
9
|
+
const settingsAccountV1SettingsEmailVerify_js_1 = require("../funcs/settingsAccountV1SettingsEmailVerify.js");
|
|
10
|
+
const settingsAccountV1SettingsUpdateRole_js_1 = require("../funcs/settingsAccountV1SettingsUpdateRole.js");
|
|
7
11
|
const settingsGet_js_1 = require("../funcs/settingsGet.js");
|
|
8
|
-
const settingsSendEmailVerification_js_1 = require("../funcs/settingsSendEmailVerification.js");
|
|
9
12
|
const settingsUpdate_js_1 = require("../funcs/settingsUpdate.js");
|
|
10
|
-
const settingsVerifyEmail_js_1 = require("../funcs/settingsVerifyEmail.js");
|
|
11
13
|
const sdks_js_1 = require("../lib/sdks.js");
|
|
12
14
|
const fp_js_1 = require("../types/fp.js");
|
|
13
15
|
class Settings extends sdks_js_1.ClientSDK {
|
|
16
|
+
async accountV1SettingsEmailSendVerification(request, options) {
|
|
17
|
+
return (0, fp_js_1.unwrapAsync)((0, settingsAccountV1SettingsEmailSendVerification_js_1.settingsAccountV1SettingsEmailSendVerification)(this, request, options));
|
|
18
|
+
}
|
|
19
|
+
async accountV1SettingsEmailSubscribe(request, options) {
|
|
20
|
+
return (0, fp_js_1.unwrapAsync)((0, settingsAccountV1SettingsEmailSubscribe_js_1.settingsAccountV1SettingsEmailSubscribe)(this, request, options));
|
|
21
|
+
}
|
|
22
|
+
async accountV1SettingsEmailVerify(request, options) {
|
|
23
|
+
return (0, fp_js_1.unwrapAsync)((0, settingsAccountV1SettingsEmailVerify_js_1.settingsAccountV1SettingsEmailVerify)(this, request, options));
|
|
24
|
+
}
|
|
14
25
|
async get(options) {
|
|
15
26
|
return (0, fp_js_1.unwrapAsync)((0, settingsGet_js_1.settingsGet)(this, options));
|
|
16
27
|
}
|
|
17
|
-
async
|
|
18
|
-
return (0, fp_js_1.unwrapAsync)((0,
|
|
28
|
+
async accountV1SettingsUpdateRole(request, options) {
|
|
29
|
+
return (0, fp_js_1.unwrapAsync)((0, settingsAccountV1SettingsUpdateRole_js_1.settingsAccountV1SettingsUpdateRole)(this, request, options));
|
|
19
30
|
}
|
|
20
31
|
async update(request, options) {
|
|
21
32
|
return (0, fp_js_1.unwrapAsync)((0, settingsUpdate_js_1.settingsUpdate)(this, request, options));
|
|
22
33
|
}
|
|
23
|
-
async verifyEmail(request, options) {
|
|
24
|
-
return (0, fp_js_1.unwrapAsync)((0, settingsVerifyEmail_js_1.settingsVerifyEmail)(this, request, options));
|
|
25
|
-
}
|
|
26
34
|
}
|
|
27
35
|
exports.Settings = Settings;
|
|
28
36
|
//# sourceMappingURL=settings.js.map
|
package/sdk/settings.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"settings.js","sourceRoot":"","sources":["../src/sdk/settings.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH,4DAAsD;AACtD,
|
|
1
|
+
{"version":3,"file":"settings.js","sourceRoot":"","sources":["../src/sdk/settings.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH,kIAA4H;AAC5H,oHAA8G;AAC9G,8GAAwG;AACxG,4GAAsG;AACtG,4DAAsD;AACtD,kEAA4D;AAC5D,4CAA2D;AAG3D,0CAA6C;AAE7C,MAAa,QAAS,SAAQ,mBAAS;IACrC,KAAK,CAAC,sCAAsC,CAC1C,OAAiE,EACjE,OAAwB;QAExB,OAAO,IAAA,mBAAW,EAAC,IAAA,kGAA8C,EAC/D,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED,KAAK,CAAC,+BAA+B,CACnC,OAA0D,EAC1D,OAAwB;QAExB,OAAO,IAAA,mBAAW,EAAC,IAAA,oFAAuC,EACxD,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED,KAAK,CAAC,4BAA4B,CAChC,OAA4C,EAC5C,OAAwB;QAExB,OAAO,IAAA,mBAAW,EAAC,IAAA,8EAAoC,EACrD,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED,KAAK,CAAC,GAAG,CACP,OAAwB;QAExB,OAAO,IAAA,mBAAW,EAAC,IAAA,4BAAW,EAC5B,IAAI,EACJ,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED,KAAK,CAAC,2BAA2B,CAC/B,OAA2C,EAC3C,OAAwB;QAExB,OAAO,IAAA,mBAAW,EAAC,IAAA,4EAAmC,EACpD,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED,KAAK,CAAC,MAAM,CACV,OAAkD,EAClD,OAAwB;QAExB,OAAO,IAAA,mBAAW,EAAC,IAAA,kCAAc,EAC/B,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;CACF;AAhED,4BAgEC"}
|
|
@@ -23,13 +23,13 @@ import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
|
23
23
|
import * as operations from "../models/operations/index.js";
|
|
24
24
|
import { Result } from "../types/fp.js";
|
|
25
25
|
|
|
26
|
-
export async function
|
|
26
|
+
export async function accountAccountV1SettingsEmailSendVerification(
|
|
27
27
|
client: SteamSetsCore,
|
|
28
|
-
request: operations.
|
|
28
|
+
request: operations.AccountV1SettingsEmailSendVerificationRequest,
|
|
29
29
|
options?: RequestOptions,
|
|
30
30
|
): Promise<
|
|
31
31
|
Result<
|
|
32
|
-
operations.
|
|
32
|
+
operations.AccountV1SettingsEmailSendVerificationResponse,
|
|
33
33
|
| errors.ErrorModel
|
|
34
34
|
| errors.ErrorModel
|
|
35
35
|
| SDKError
|
|
@@ -44,7 +44,7 @@ export async function internalSendEmailVerification(
|
|
|
44
44
|
const parsed = safeParse(
|
|
45
45
|
request,
|
|
46
46
|
(value) =>
|
|
47
|
-
operations.
|
|
47
|
+
operations.AccountV1SettingsEmailSendVerificationRequest$outboundSchema
|
|
48
48
|
.parse(value),
|
|
49
49
|
"Input validation failed",
|
|
50
50
|
);
|
|
@@ -54,7 +54,7 @@ export async function internalSendEmailVerification(
|
|
|
54
54
|
const payload = parsed.value;
|
|
55
55
|
const body = null;
|
|
56
56
|
|
|
57
|
-
const path = pathToFunc("/account.v1.AccountService/
|
|
57
|
+
const path = pathToFunc("/account.v1.AccountService/EmailSendVerification")();
|
|
58
58
|
|
|
59
59
|
const headers = new Headers(compactMap({
|
|
60
60
|
Accept: "application/problem+json",
|
|
@@ -70,7 +70,7 @@ export async function internalSendEmailVerification(
|
|
|
70
70
|
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
71
71
|
|
|
72
72
|
const context = {
|
|
73
|
-
operationID: "account.v1.settings.send-
|
|
73
|
+
operationID: "account.v1.settings.email-send-verification",
|
|
74
74
|
oAuth2Scopes: [],
|
|
75
75
|
|
|
76
76
|
resolvedSecurity: requestSecurity,
|
|
@@ -123,7 +123,7 @@ export async function internalSendEmailVerification(
|
|
|
123
123
|
};
|
|
124
124
|
|
|
125
125
|
const [result] = await M.match<
|
|
126
|
-
operations.
|
|
126
|
+
operations.AccountV1SettingsEmailSendVerificationResponse,
|
|
127
127
|
| errors.ErrorModel
|
|
128
128
|
| errors.ErrorModel
|
|
129
129
|
| SDKError
|
|
@@ -136,7 +136,7 @@ export async function internalSendEmailVerification(
|
|
|
136
136
|
>(
|
|
137
137
|
M.nil(
|
|
138
138
|
204,
|
|
139
|
-
operations.
|
|
139
|
+
operations.AccountV1SettingsEmailSendVerificationResponse$inboundSchema,
|
|
140
140
|
{ hdrs: true },
|
|
141
141
|
),
|
|
142
142
|
M.jsonErr([404, 422, 429], errors.ErrorModel$inboundSchema, {
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { SteamSetsCore } from "../core.js";
|
|
6
|
+
import { encodeJSON, encodeSimple } from "../lib/encodings.js";
|
|
7
|
+
import * as M from "../lib/matchers.js";
|
|
8
|
+
import { compactMap } from "../lib/primitives.js";
|
|
9
|
+
import { safeParse } from "../lib/schemas.js";
|
|
10
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
11
|
+
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
12
|
+
import { pathToFunc } from "../lib/url.js";
|
|
13
|
+
import {
|
|
14
|
+
ConnectionError,
|
|
15
|
+
InvalidRequestError,
|
|
16
|
+
RequestAbortedError,
|
|
17
|
+
RequestTimeoutError,
|
|
18
|
+
UnexpectedClientError,
|
|
19
|
+
} from "../models/errors/httpclienterrors.js";
|
|
20
|
+
import * as errors from "../models/errors/index.js";
|
|
21
|
+
import { SDKError } from "../models/errors/sdkerror.js";
|
|
22
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
23
|
+
import * as operations from "../models/operations/index.js";
|
|
24
|
+
import { Result } from "../types/fp.js";
|
|
25
|
+
|
|
26
|
+
export async function accountAccountV1SettingsEmailSubscribe(
|
|
27
|
+
client: SteamSetsCore,
|
|
28
|
+
request: operations.AccountV1SettingsEmailSubscribeRequest,
|
|
29
|
+
options?: RequestOptions,
|
|
30
|
+
): Promise<
|
|
31
|
+
Result<
|
|
32
|
+
operations.AccountV1SettingsEmailSubscribeResponse,
|
|
33
|
+
| errors.ErrorModel
|
|
34
|
+
| errors.ErrorModel
|
|
35
|
+
| SDKError
|
|
36
|
+
| SDKValidationError
|
|
37
|
+
| UnexpectedClientError
|
|
38
|
+
| InvalidRequestError
|
|
39
|
+
| RequestAbortedError
|
|
40
|
+
| RequestTimeoutError
|
|
41
|
+
| ConnectionError
|
|
42
|
+
>
|
|
43
|
+
> {
|
|
44
|
+
const parsed = safeParse(
|
|
45
|
+
request,
|
|
46
|
+
(value) =>
|
|
47
|
+
operations.AccountV1SettingsEmailSubscribeRequest$outboundSchema.parse(
|
|
48
|
+
value,
|
|
49
|
+
),
|
|
50
|
+
"Input validation failed",
|
|
51
|
+
);
|
|
52
|
+
if (!parsed.ok) {
|
|
53
|
+
return parsed;
|
|
54
|
+
}
|
|
55
|
+
const payload = parsed.value;
|
|
56
|
+
const body = encodeJSON("body", payload.V1EmailSubscriptionRequestBody, {
|
|
57
|
+
explode: true,
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
const path = pathToFunc("/account.v1.AccountService/EmailSubscription")();
|
|
61
|
+
|
|
62
|
+
const headers = new Headers(compactMap({
|
|
63
|
+
"Content-Type": "application/json",
|
|
64
|
+
Accept: "application/problem+json",
|
|
65
|
+
"X-Forwarded-For": encodeSimple(
|
|
66
|
+
"X-Forwarded-For",
|
|
67
|
+
payload["X-Forwarded-For"],
|
|
68
|
+
{ explode: false, charEncoding: "none" },
|
|
69
|
+
),
|
|
70
|
+
}));
|
|
71
|
+
|
|
72
|
+
const secConfig = await extractSecurity(client._options.token);
|
|
73
|
+
const securityInput = secConfig == null ? {} : { token: secConfig };
|
|
74
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
75
|
+
|
|
76
|
+
const context = {
|
|
77
|
+
operationID: "account.v1.settings.email-subscribe",
|
|
78
|
+
oAuth2Scopes: [],
|
|
79
|
+
|
|
80
|
+
resolvedSecurity: requestSecurity,
|
|
81
|
+
|
|
82
|
+
securitySource: client._options.token,
|
|
83
|
+
retryConfig: options?.retries
|
|
84
|
+
|| client._options.retryConfig
|
|
85
|
+
|| {
|
|
86
|
+
strategy: "backoff",
|
|
87
|
+
backoff: {
|
|
88
|
+
initialInterval: 500,
|
|
89
|
+
maxInterval: 5000,
|
|
90
|
+
exponent: 1.5,
|
|
91
|
+
maxElapsedTime: 60000,
|
|
92
|
+
},
|
|
93
|
+
retryConnectionErrors: true,
|
|
94
|
+
}
|
|
95
|
+
|| { strategy: "none" },
|
|
96
|
+
retryCodes: options?.retryCodes || ["501", "502", "503", "504"],
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
const requestRes = client._createRequest(context, {
|
|
100
|
+
security: requestSecurity,
|
|
101
|
+
method: "POST",
|
|
102
|
+
baseURL: options?.serverURL,
|
|
103
|
+
path: path,
|
|
104
|
+
headers: headers,
|
|
105
|
+
body: body,
|
|
106
|
+
uaHeader: "x-speakeasy-user-agent",
|
|
107
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
108
|
+
}, options);
|
|
109
|
+
if (!requestRes.ok) {
|
|
110
|
+
return requestRes;
|
|
111
|
+
}
|
|
112
|
+
const req = requestRes.value;
|
|
113
|
+
|
|
114
|
+
const doResult = await client._do(req, {
|
|
115
|
+
context,
|
|
116
|
+
errorCodes: ["422", "429", "4XX", "500", "5XX"],
|
|
117
|
+
retryConfig: context.retryConfig,
|
|
118
|
+
retryCodes: context.retryCodes,
|
|
119
|
+
});
|
|
120
|
+
if (!doResult.ok) {
|
|
121
|
+
return doResult;
|
|
122
|
+
}
|
|
123
|
+
const response = doResult.value;
|
|
124
|
+
|
|
125
|
+
const responseFields = {
|
|
126
|
+
HttpMeta: { Response: response, Request: req },
|
|
127
|
+
};
|
|
128
|
+
|
|
129
|
+
const [result] = await M.match<
|
|
130
|
+
operations.AccountV1SettingsEmailSubscribeResponse,
|
|
131
|
+
| errors.ErrorModel
|
|
132
|
+
| errors.ErrorModel
|
|
133
|
+
| SDKError
|
|
134
|
+
| SDKValidationError
|
|
135
|
+
| UnexpectedClientError
|
|
136
|
+
| InvalidRequestError
|
|
137
|
+
| RequestAbortedError
|
|
138
|
+
| RequestTimeoutError
|
|
139
|
+
| ConnectionError
|
|
140
|
+
>(
|
|
141
|
+
M.nil(
|
|
142
|
+
204,
|
|
143
|
+
operations.AccountV1SettingsEmailSubscribeResponse$inboundSchema,
|
|
144
|
+
{ hdrs: true },
|
|
145
|
+
),
|
|
146
|
+
M.jsonErr([422, 429], errors.ErrorModel$inboundSchema, {
|
|
147
|
+
ctype: "application/problem+json",
|
|
148
|
+
}),
|
|
149
|
+
M.jsonErr(500, errors.ErrorModel$inboundSchema, {
|
|
150
|
+
ctype: "application/problem+json",
|
|
151
|
+
}),
|
|
152
|
+
M.fail("4XX"),
|
|
153
|
+
M.fail("5XX"),
|
|
154
|
+
)(response, req, { extraFields: responseFields });
|
|
155
|
+
if (!result.ok) {
|
|
156
|
+
return result;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
return result;
|
|
160
|
+
}
|
|
@@ -24,13 +24,13 @@ import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
|
24
24
|
import * as operations from "../models/operations/index.js";
|
|
25
25
|
import { Result } from "../types/fp.js";
|
|
26
26
|
|
|
27
|
-
export async function
|
|
27
|
+
export async function accountAccountV1SettingsEmailVerify(
|
|
28
28
|
client: SteamSetsCore,
|
|
29
29
|
request: components.V1VerifyEmailRequestBody,
|
|
30
30
|
options?: RequestOptions,
|
|
31
31
|
): Promise<
|
|
32
32
|
Result<
|
|
33
|
-
operations.
|
|
33
|
+
operations.AccountV1SettingsEmailVerifyResponse,
|
|
34
34
|
| errors.ErrorModel
|
|
35
35
|
| errors.ErrorModel
|
|
36
36
|
| SDKError
|
|
@@ -53,7 +53,7 @@ export async function settingsVerifyEmail(
|
|
|
53
53
|
const payload = parsed.value;
|
|
54
54
|
const body = encodeJSON("body", payload, { explode: true });
|
|
55
55
|
|
|
56
|
-
const path = pathToFunc("/account.v1.AccountService/
|
|
56
|
+
const path = pathToFunc("/account.v1.AccountService/EmailVerify")();
|
|
57
57
|
|
|
58
58
|
const headers = new Headers(compactMap({
|
|
59
59
|
"Content-Type": "application/json",
|
|
@@ -65,7 +65,7 @@ export async function settingsVerifyEmail(
|
|
|
65
65
|
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
66
66
|
|
|
67
67
|
const context = {
|
|
68
|
-
operationID: "account.v1.settings.
|
|
68
|
+
operationID: "account.v1.settings.email-verify",
|
|
69
69
|
oAuth2Scopes: [],
|
|
70
70
|
|
|
71
71
|
resolvedSecurity: requestSecurity,
|
|
@@ -118,7 +118,7 @@ export async function settingsVerifyEmail(
|
|
|
118
118
|
};
|
|
119
119
|
|
|
120
120
|
const [result] = await M.match<
|
|
121
|
-
operations.
|
|
121
|
+
operations.AccountV1SettingsEmailVerifyResponse,
|
|
122
122
|
| errors.ErrorModel
|
|
123
123
|
| errors.ErrorModel
|
|
124
124
|
| SDKError
|
|
@@ -129,7 +129,7 @@ export async function settingsVerifyEmail(
|
|
|
129
129
|
| RequestTimeoutError
|
|
130
130
|
| ConnectionError
|
|
131
131
|
>(
|
|
132
|
-
M.nil(204, operations.
|
|
132
|
+
M.nil(204, operations.AccountV1SettingsEmailVerifyResponse$inboundSchema, {
|
|
133
133
|
hdrs: true,
|
|
134
134
|
}),
|
|
135
135
|
M.jsonErr([404, 422, 429], errors.ErrorModel$inboundSchema, {
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { SteamSetsCore } from "../core.js";
|
|
6
|
+
import { encodeJSON } from "../lib/encodings.js";
|
|
7
|
+
import * as M from "../lib/matchers.js";
|
|
8
|
+
import { compactMap } from "../lib/primitives.js";
|
|
9
|
+
import { safeParse } from "../lib/schemas.js";
|
|
10
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
11
|
+
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
12
|
+
import { pathToFunc } from "../lib/url.js";
|
|
13
|
+
import * as components from "../models/components/index.js";
|
|
14
|
+
import {
|
|
15
|
+
ConnectionError,
|
|
16
|
+
InvalidRequestError,
|
|
17
|
+
RequestAbortedError,
|
|
18
|
+
RequestTimeoutError,
|
|
19
|
+
UnexpectedClientError,
|
|
20
|
+
} from "../models/errors/httpclienterrors.js";
|
|
21
|
+
import * as errors from "../models/errors/index.js";
|
|
22
|
+
import { SDKError } from "../models/errors/sdkerror.js";
|
|
23
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
24
|
+
import * as operations from "../models/operations/index.js";
|
|
25
|
+
import { Result } from "../types/fp.js";
|
|
26
|
+
|
|
27
|
+
export async function accountAccountV1SettingsUpdateRole(
|
|
28
|
+
client: SteamSetsCore,
|
|
29
|
+
request: components.V1UpdateRoleRequestBody,
|
|
30
|
+
options?: RequestOptions,
|
|
31
|
+
): Promise<
|
|
32
|
+
Result<
|
|
33
|
+
operations.AccountV1SettingsUpdateRoleResponse,
|
|
34
|
+
| errors.ErrorModel
|
|
35
|
+
| errors.ErrorModel
|
|
36
|
+
| SDKError
|
|
37
|
+
| SDKValidationError
|
|
38
|
+
| UnexpectedClientError
|
|
39
|
+
| InvalidRequestError
|
|
40
|
+
| RequestAbortedError
|
|
41
|
+
| RequestTimeoutError
|
|
42
|
+
| ConnectionError
|
|
43
|
+
>
|
|
44
|
+
> {
|
|
45
|
+
const parsed = safeParse(
|
|
46
|
+
request,
|
|
47
|
+
(value) => components.V1UpdateRoleRequestBody$outboundSchema.parse(value),
|
|
48
|
+
"Input validation failed",
|
|
49
|
+
);
|
|
50
|
+
if (!parsed.ok) {
|
|
51
|
+
return parsed;
|
|
52
|
+
}
|
|
53
|
+
const payload = parsed.value;
|
|
54
|
+
const body = encodeJSON("body", payload, { explode: true });
|
|
55
|
+
|
|
56
|
+
const path = pathToFunc("/account.v1.AccountService/UpdateRole")();
|
|
57
|
+
|
|
58
|
+
const headers = new Headers(compactMap({
|
|
59
|
+
"Content-Type": "application/json",
|
|
60
|
+
Accept: "application/problem+json",
|
|
61
|
+
}));
|
|
62
|
+
|
|
63
|
+
const secConfig = await extractSecurity(client._options.token);
|
|
64
|
+
const securityInput = secConfig == null ? {} : { token: secConfig };
|
|
65
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
66
|
+
|
|
67
|
+
const context = {
|
|
68
|
+
operationID: "account.v1.settings.update-role",
|
|
69
|
+
oAuth2Scopes: [],
|
|
70
|
+
|
|
71
|
+
resolvedSecurity: requestSecurity,
|
|
72
|
+
|
|
73
|
+
securitySource: client._options.token,
|
|
74
|
+
retryConfig: options?.retries
|
|
75
|
+
|| client._options.retryConfig
|
|
76
|
+
|| {
|
|
77
|
+
strategy: "backoff",
|
|
78
|
+
backoff: {
|
|
79
|
+
initialInterval: 500,
|
|
80
|
+
maxInterval: 5000,
|
|
81
|
+
exponent: 1.5,
|
|
82
|
+
maxElapsedTime: 60000,
|
|
83
|
+
},
|
|
84
|
+
retryConnectionErrors: true,
|
|
85
|
+
}
|
|
86
|
+
|| { strategy: "none" },
|
|
87
|
+
retryCodes: options?.retryCodes || ["501", "502", "503", "504"],
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
const requestRes = client._createRequest(context, {
|
|
91
|
+
security: requestSecurity,
|
|
92
|
+
method: "POST",
|
|
93
|
+
baseURL: options?.serverURL,
|
|
94
|
+
path: path,
|
|
95
|
+
headers: headers,
|
|
96
|
+
body: body,
|
|
97
|
+
uaHeader: "x-speakeasy-user-agent",
|
|
98
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
99
|
+
}, options);
|
|
100
|
+
if (!requestRes.ok) {
|
|
101
|
+
return requestRes;
|
|
102
|
+
}
|
|
103
|
+
const req = requestRes.value;
|
|
104
|
+
|
|
105
|
+
const doResult = await client._do(req, {
|
|
106
|
+
context,
|
|
107
|
+
errorCodes: ["422", "429", "4XX", "500", "5XX"],
|
|
108
|
+
retryConfig: context.retryConfig,
|
|
109
|
+
retryCodes: context.retryCodes,
|
|
110
|
+
});
|
|
111
|
+
if (!doResult.ok) {
|
|
112
|
+
return doResult;
|
|
113
|
+
}
|
|
114
|
+
const response = doResult.value;
|
|
115
|
+
|
|
116
|
+
const responseFields = {
|
|
117
|
+
HttpMeta: { Response: response, Request: req },
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
const [result] = await M.match<
|
|
121
|
+
operations.AccountV1SettingsUpdateRoleResponse,
|
|
122
|
+
| errors.ErrorModel
|
|
123
|
+
| errors.ErrorModel
|
|
124
|
+
| SDKError
|
|
125
|
+
| SDKValidationError
|
|
126
|
+
| UnexpectedClientError
|
|
127
|
+
| InvalidRequestError
|
|
128
|
+
| RequestAbortedError
|
|
129
|
+
| RequestTimeoutError
|
|
130
|
+
| ConnectionError
|
|
131
|
+
>(
|
|
132
|
+
M.nil(204, operations.AccountV1SettingsUpdateRoleResponse$inboundSchema, {
|
|
133
|
+
hdrs: true,
|
|
134
|
+
}),
|
|
135
|
+
M.jsonErr([422, 429], errors.ErrorModel$inboundSchema, {
|
|
136
|
+
ctype: "application/problem+json",
|
|
137
|
+
}),
|
|
138
|
+
M.jsonErr(500, errors.ErrorModel$inboundSchema, {
|
|
139
|
+
ctype: "application/problem+json",
|
|
140
|
+
}),
|
|
141
|
+
M.fail("4XX"),
|
|
142
|
+
M.fail("5XX"),
|
|
143
|
+
)(response, req, { extraFields: responseFields });
|
|
144
|
+
if (!result.ok) {
|
|
145
|
+
return result;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
return result;
|
|
149
|
+
}
|
|
@@ -23,13 +23,13 @@ import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
|
23
23
|
import * as operations from "../models/operations/index.js";
|
|
24
24
|
import { Result } from "../types/fp.js";
|
|
25
25
|
|
|
26
|
-
export async function
|
|
26
|
+
export async function internalAccountV1SettingsEmailSendVerification(
|
|
27
27
|
client: SteamSetsCore,
|
|
28
|
-
request: operations.
|
|
28
|
+
request: operations.AccountV1SettingsEmailSendVerificationRequest,
|
|
29
29
|
options?: RequestOptions,
|
|
30
30
|
): Promise<
|
|
31
31
|
Result<
|
|
32
|
-
operations.
|
|
32
|
+
operations.AccountV1SettingsEmailSendVerificationResponse,
|
|
33
33
|
| errors.ErrorModel
|
|
34
34
|
| errors.ErrorModel
|
|
35
35
|
| SDKError
|
|
@@ -44,7 +44,7 @@ export async function accountSendEmailVerification(
|
|
|
44
44
|
const parsed = safeParse(
|
|
45
45
|
request,
|
|
46
46
|
(value) =>
|
|
47
|
-
operations.
|
|
47
|
+
operations.AccountV1SettingsEmailSendVerificationRequest$outboundSchema
|
|
48
48
|
.parse(value),
|
|
49
49
|
"Input validation failed",
|
|
50
50
|
);
|
|
@@ -54,7 +54,7 @@ export async function accountSendEmailVerification(
|
|
|
54
54
|
const payload = parsed.value;
|
|
55
55
|
const body = null;
|
|
56
56
|
|
|
57
|
-
const path = pathToFunc("/account.v1.AccountService/
|
|
57
|
+
const path = pathToFunc("/account.v1.AccountService/EmailSendVerification")();
|
|
58
58
|
|
|
59
59
|
const headers = new Headers(compactMap({
|
|
60
60
|
Accept: "application/problem+json",
|
|
@@ -70,7 +70,7 @@ export async function accountSendEmailVerification(
|
|
|
70
70
|
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
71
71
|
|
|
72
72
|
const context = {
|
|
73
|
-
operationID: "account.v1.settings.send-
|
|
73
|
+
operationID: "account.v1.settings.email-send-verification",
|
|
74
74
|
oAuth2Scopes: [],
|
|
75
75
|
|
|
76
76
|
resolvedSecurity: requestSecurity,
|
|
@@ -123,7 +123,7 @@ export async function accountSendEmailVerification(
|
|
|
123
123
|
};
|
|
124
124
|
|
|
125
125
|
const [result] = await M.match<
|
|
126
|
-
operations.
|
|
126
|
+
operations.AccountV1SettingsEmailSendVerificationResponse,
|
|
127
127
|
| errors.ErrorModel
|
|
128
128
|
| errors.ErrorModel
|
|
129
129
|
| SDKError
|
|
@@ -136,7 +136,7 @@ export async function accountSendEmailVerification(
|
|
|
136
136
|
>(
|
|
137
137
|
M.nil(
|
|
138
138
|
204,
|
|
139
|
-
operations.
|
|
139
|
+
operations.AccountV1SettingsEmailSendVerificationResponse$inboundSchema,
|
|
140
140
|
{ hdrs: true },
|
|
141
141
|
),
|
|
142
142
|
M.jsonErr([404, 422, 429], errors.ErrorModel$inboundSchema, {
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { SteamSetsCore } from "../core.js";
|
|
6
|
+
import { encodeJSON, encodeSimple } from "../lib/encodings.js";
|
|
7
|
+
import * as M from "../lib/matchers.js";
|
|
8
|
+
import { compactMap } from "../lib/primitives.js";
|
|
9
|
+
import { safeParse } from "../lib/schemas.js";
|
|
10
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
11
|
+
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
12
|
+
import { pathToFunc } from "../lib/url.js";
|
|
13
|
+
import {
|
|
14
|
+
ConnectionError,
|
|
15
|
+
InvalidRequestError,
|
|
16
|
+
RequestAbortedError,
|
|
17
|
+
RequestTimeoutError,
|
|
18
|
+
UnexpectedClientError,
|
|
19
|
+
} from "../models/errors/httpclienterrors.js";
|
|
20
|
+
import * as errors from "../models/errors/index.js";
|
|
21
|
+
import { SDKError } from "../models/errors/sdkerror.js";
|
|
22
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
23
|
+
import * as operations from "../models/operations/index.js";
|
|
24
|
+
import { Result } from "../types/fp.js";
|
|
25
|
+
|
|
26
|
+
export async function internalAccountV1SettingsEmailSubscribe(
|
|
27
|
+
client: SteamSetsCore,
|
|
28
|
+
request: operations.AccountV1SettingsEmailSubscribeRequest,
|
|
29
|
+
options?: RequestOptions,
|
|
30
|
+
): Promise<
|
|
31
|
+
Result<
|
|
32
|
+
operations.AccountV1SettingsEmailSubscribeResponse,
|
|
33
|
+
| errors.ErrorModel
|
|
34
|
+
| errors.ErrorModel
|
|
35
|
+
| SDKError
|
|
36
|
+
| SDKValidationError
|
|
37
|
+
| UnexpectedClientError
|
|
38
|
+
| InvalidRequestError
|
|
39
|
+
| RequestAbortedError
|
|
40
|
+
| RequestTimeoutError
|
|
41
|
+
| ConnectionError
|
|
42
|
+
>
|
|
43
|
+
> {
|
|
44
|
+
const parsed = safeParse(
|
|
45
|
+
request,
|
|
46
|
+
(value) =>
|
|
47
|
+
operations.AccountV1SettingsEmailSubscribeRequest$outboundSchema.parse(
|
|
48
|
+
value,
|
|
49
|
+
),
|
|
50
|
+
"Input validation failed",
|
|
51
|
+
);
|
|
52
|
+
if (!parsed.ok) {
|
|
53
|
+
return parsed;
|
|
54
|
+
}
|
|
55
|
+
const payload = parsed.value;
|
|
56
|
+
const body = encodeJSON("body", payload.V1EmailSubscriptionRequestBody, {
|
|
57
|
+
explode: true,
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
const path = pathToFunc("/account.v1.AccountService/EmailSubscription")();
|
|
61
|
+
|
|
62
|
+
const headers = new Headers(compactMap({
|
|
63
|
+
"Content-Type": "application/json",
|
|
64
|
+
Accept: "application/problem+json",
|
|
65
|
+
"X-Forwarded-For": encodeSimple(
|
|
66
|
+
"X-Forwarded-For",
|
|
67
|
+
payload["X-Forwarded-For"],
|
|
68
|
+
{ explode: false, charEncoding: "none" },
|
|
69
|
+
),
|
|
70
|
+
}));
|
|
71
|
+
|
|
72
|
+
const secConfig = await extractSecurity(client._options.token);
|
|
73
|
+
const securityInput = secConfig == null ? {} : { token: secConfig };
|
|
74
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
75
|
+
|
|
76
|
+
const context = {
|
|
77
|
+
operationID: "account.v1.settings.email-subscribe",
|
|
78
|
+
oAuth2Scopes: [],
|
|
79
|
+
|
|
80
|
+
resolvedSecurity: requestSecurity,
|
|
81
|
+
|
|
82
|
+
securitySource: client._options.token,
|
|
83
|
+
retryConfig: options?.retries
|
|
84
|
+
|| client._options.retryConfig
|
|
85
|
+
|| {
|
|
86
|
+
strategy: "backoff",
|
|
87
|
+
backoff: {
|
|
88
|
+
initialInterval: 500,
|
|
89
|
+
maxInterval: 5000,
|
|
90
|
+
exponent: 1.5,
|
|
91
|
+
maxElapsedTime: 60000,
|
|
92
|
+
},
|
|
93
|
+
retryConnectionErrors: true,
|
|
94
|
+
}
|
|
95
|
+
|| { strategy: "none" },
|
|
96
|
+
retryCodes: options?.retryCodes || ["501", "502", "503", "504"],
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
const requestRes = client._createRequest(context, {
|
|
100
|
+
security: requestSecurity,
|
|
101
|
+
method: "POST",
|
|
102
|
+
baseURL: options?.serverURL,
|
|
103
|
+
path: path,
|
|
104
|
+
headers: headers,
|
|
105
|
+
body: body,
|
|
106
|
+
uaHeader: "x-speakeasy-user-agent",
|
|
107
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
108
|
+
}, options);
|
|
109
|
+
if (!requestRes.ok) {
|
|
110
|
+
return requestRes;
|
|
111
|
+
}
|
|
112
|
+
const req = requestRes.value;
|
|
113
|
+
|
|
114
|
+
const doResult = await client._do(req, {
|
|
115
|
+
context,
|
|
116
|
+
errorCodes: ["422", "429", "4XX", "500", "5XX"],
|
|
117
|
+
retryConfig: context.retryConfig,
|
|
118
|
+
retryCodes: context.retryCodes,
|
|
119
|
+
});
|
|
120
|
+
if (!doResult.ok) {
|
|
121
|
+
return doResult;
|
|
122
|
+
}
|
|
123
|
+
const response = doResult.value;
|
|
124
|
+
|
|
125
|
+
const responseFields = {
|
|
126
|
+
HttpMeta: { Response: response, Request: req },
|
|
127
|
+
};
|
|
128
|
+
|
|
129
|
+
const [result] = await M.match<
|
|
130
|
+
operations.AccountV1SettingsEmailSubscribeResponse,
|
|
131
|
+
| errors.ErrorModel
|
|
132
|
+
| errors.ErrorModel
|
|
133
|
+
| SDKError
|
|
134
|
+
| SDKValidationError
|
|
135
|
+
| UnexpectedClientError
|
|
136
|
+
| InvalidRequestError
|
|
137
|
+
| RequestAbortedError
|
|
138
|
+
| RequestTimeoutError
|
|
139
|
+
| ConnectionError
|
|
140
|
+
>(
|
|
141
|
+
M.nil(
|
|
142
|
+
204,
|
|
143
|
+
operations.AccountV1SettingsEmailSubscribeResponse$inboundSchema,
|
|
144
|
+
{ hdrs: true },
|
|
145
|
+
),
|
|
146
|
+
M.jsonErr([422, 429], errors.ErrorModel$inboundSchema, {
|
|
147
|
+
ctype: "application/problem+json",
|
|
148
|
+
}),
|
|
149
|
+
M.jsonErr(500, errors.ErrorModel$inboundSchema, {
|
|
150
|
+
ctype: "application/problem+json",
|
|
151
|
+
}),
|
|
152
|
+
M.fail("4XX"),
|
|
153
|
+
M.fail("5XX"),
|
|
154
|
+
)(response, req, { extraFields: responseFields });
|
|
155
|
+
if (!result.ok) {
|
|
156
|
+
return result;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
return result;
|
|
160
|
+
}
|