@stackframe/stack-shared 2.8.11 → 2.8.12
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/CHANGELOG.md +6 -0
- package/dist/config/{schema.d.cts → schema.d.mts} +35 -35
- package/dist/config/schema.d.ts +32 -32
- package/dist/config/schema.js +1 -1
- package/dist/{crud.d.cts → crud.d.mts} +1 -1
- package/dist/esm/interface/clientInterface.js +8 -6
- package/dist/esm/interface/clientInterface.js.map +1 -1
- package/dist/esm/interface/crud/project-api-keys.js +20 -15
- package/dist/esm/interface/crud/project-api-keys.js.map +1 -1
- package/dist/esm/interface/crud/projects.js +3 -2
- package/dist/esm/interface/crud/projects.js.map +1 -1
- package/dist/esm/interface/serverInterface.js +28 -2
- package/dist/esm/interface/serverInterface.js.map +1 -1
- package/dist/esm/known-errors.js +28 -1
- package/dist/esm/known-errors.js.map +1 -1
- package/dist/esm/schema-fields.js +2 -0
- package/dist/esm/schema-fields.js.map +1 -1
- package/dist/esm/utils/errors.js +4 -0
- package/dist/esm/utils/errors.js.map +1 -1
- package/dist/esm/utils/hashes.js +1 -1
- package/dist/esm/utils/hashes.js.map +1 -1
- package/dist/esm/utils/promises.js +1 -1
- package/dist/esm/utils/promises.js.map +1 -1
- package/dist/helpers/password.d.mts +11 -0
- package/dist/helpers/{production-mode.d.cts → production-mode.d.mts} +3 -3
- package/dist/hooks/use-async-callback.js +1 -1
- package/dist/hooks/{use-async-external-store.d.cts → use-async-external-store.d.mts} +1 -1
- package/dist/index.d.mts +30 -0
- package/dist/interface/{adminInterface.d.cts → adminInterface.d.mts} +26 -26
- package/dist/interface/{clientInterface.d.cts → clientInterface.d.mts} +18 -18
- package/dist/interface/clientInterface.js +8 -6
- package/dist/interface/clientInterface.js.map +1 -1
- package/dist/interface/crud/{contact-channels.d.cts → contact-channels.d.mts} +2 -2
- package/dist/interface/crud/{current-user.d.cts → current-user.d.mts} +2 -2
- package/dist/interface/crud/{email-templates.d.cts → email-templates.d.mts} +2 -2
- package/dist/interface/crud/{emails.d.cts → emails.d.mts} +2 -2
- package/dist/interface/crud/emails.js +1 -1
- package/dist/interface/crud/{internal-api-keys.d.cts → internal-api-keys.d.mts} +2 -2
- package/dist/interface/crud/{oauth.d.cts → oauth.d.mts} +2 -2
- package/dist/interface/crud/{project-api-keys.d.cts → project-api-keys.d.mts} +12 -2
- package/dist/interface/crud/project-api-keys.d.ts +10 -0
- package/dist/interface/crud/project-api-keys.js +20 -15
- package/dist/interface/crud/project-api-keys.js.map +1 -1
- package/dist/interface/crud/{project-permissions.d.cts → project-permissions.d.mts} +2 -2
- package/dist/interface/crud/project-permissions.js +1 -1
- package/dist/interface/crud/{projects.d.cts → projects.d.mts} +2 -2
- package/dist/interface/crud/projects.js +4 -3
- package/dist/interface/crud/projects.js.map +1 -1
- package/dist/interface/crud/{sessions.d.cts → sessions.d.mts} +2 -2
- package/dist/interface/crud/{svix-token.d.cts → svix-token.d.mts} +2 -2
- package/dist/interface/crud/{team-invitation-details.d.cts → team-invitation-details.d.mts} +2 -2
- package/dist/interface/crud/team-invitation-details.js +1 -1
- package/dist/interface/crud/{team-invitation.d.cts → team-invitation.d.mts} +2 -2
- package/dist/interface/crud/team-invitation.js +1 -1
- package/dist/interface/crud/{team-member-profiles.d.cts → team-member-profiles.d.mts} +2 -2
- package/dist/interface/crud/team-member-profiles.js +1 -1
- package/dist/interface/crud/{team-memberships.d.cts → team-memberships.d.mts} +2 -2
- package/dist/interface/crud/{team-permissions.d.cts → team-permissions.d.mts} +2 -2
- package/dist/interface/crud/team-permissions.js +1 -1
- package/dist/interface/crud/{teams.d.cts → teams.d.mts} +2 -2
- package/dist/interface/crud/teams.js +1 -1
- package/dist/interface/crud/{users.d.cts → users.d.mts} +2 -2
- package/dist/interface/crud/users.js +1 -1
- package/dist/interface/{serverInterface.d.cts → serverInterface.d.mts} +23 -21
- package/dist/interface/serverInterface.d.ts +2 -0
- package/dist/interface/serverInterface.js +28 -2
- package/dist/interface/serverInterface.js.map +1 -1
- package/dist/{known-errors.d.cts → known-errors.d.mts} +11 -3
- package/dist/known-errors.d.ts +8 -0
- package/dist/known-errors.js +28 -1
- package/dist/known-errors.js.map +1 -1
- package/dist/{schema-fields.d.cts → schema-fields.d.mts} +2 -1
- package/dist/schema-fields.d.ts +2 -1
- package/dist/schema-fields.js +4 -1
- package/dist/schema-fields.js.map +1 -1
- package/dist/sessions.js +1 -1
- package/dist/utils/api-keys.js +1 -1
- package/dist/utils/{caches.d.cts → caches.d.mts} +2 -2
- package/dist/utils/{errors.d.cts → errors.d.mts} +4 -2
- package/dist/utils/errors.d.ts +2 -0
- package/dist/utils/errors.js +4 -0
- package/dist/utils/errors.js.map +1 -1
- package/dist/utils/fs.js +2 -2
- package/dist/utils/hashes.js +6 -6
- package/dist/utils/hashes.js.map +1 -1
- package/dist/utils/ips.js +1 -1
- package/dist/utils/{json.d.cts → json.d.mts} +1 -1
- package/dist/utils/jwt.js +3 -3
- package/dist/utils/{promises.d.cts → promises.d.mts} +1 -1
- package/dist/utils/promises.js +1 -1
- package/dist/utils/promises.js.map +1 -1
- package/dist/utils/react.js +1 -1
- package/dist/utils/{stores.d.cts → stores.d.mts} +3 -3
- package/package.json +9 -6
- package/dist/helpers/password.d.cts +0 -11
- package/dist/index.d.cts +0 -30
- /package/dist/config/{format.d.cts → format.d.mts} +0 -0
- /package/dist/{global.d.d.cts → global.d.d.mts} +0 -0
- /package/dist/hooks/{use-async-callback.d.cts → use-async-callback.d.mts} +0 -0
- /package/dist/hooks/{use-hash.d.cts → use-hash.d.mts} +0 -0
- /package/dist/hooks/{use-strict-memo.d.cts → use-strict-memo.d.mts} +0 -0
- /package/dist/interface/{webhooks.d.cts → webhooks.d.mts} +0 -0
- /package/dist/{sessions.d.cts → sessions.d.mts} +0 -0
- /package/dist/utils/{api-keys.d.cts → api-keys.d.mts} +0 -0
- /package/dist/utils/{arrays.d.cts → arrays.d.mts} +0 -0
- /package/dist/utils/{base64.d.cts → base64.d.mts} +0 -0
- /package/dist/utils/{booleans.d.cts → booleans.d.mts} +0 -0
- /package/dist/utils/{browser-compat.d.cts → browser-compat.d.mts} +0 -0
- /package/dist/utils/{bytes.d.cts → bytes.d.mts} +0 -0
- /package/dist/utils/{compile-time.d.cts → compile-time.d.mts} +0 -0
- /package/dist/utils/{crypto.d.cts → crypto.d.mts} +0 -0
- /package/dist/utils/{dates.d.cts → dates.d.mts} +0 -0
- /package/dist/utils/{dom.d.cts → dom.d.mts} +0 -0
- /package/dist/utils/{env.d.cts → env.d.mts} +0 -0
- /package/dist/utils/{fs.d.cts → fs.d.mts} +0 -0
- /package/dist/utils/{functions.d.cts → functions.d.mts} +0 -0
- /package/dist/utils/{geo.d.cts → geo.d.mts} +0 -0
- /package/dist/utils/{globals.d.cts → globals.d.mts} +0 -0
- /package/dist/utils/{hashes.d.cts → hashes.d.mts} +0 -0
- /package/dist/utils/{html.d.cts → html.d.mts} +0 -0
- /package/dist/utils/{http.d.cts → http.d.mts} +0 -0
- /package/dist/utils/{ips.d.cts → ips.d.mts} +0 -0
- /package/dist/utils/{jwt.d.cts → jwt.d.mts} +0 -0
- /package/dist/utils/{locks.d.cts → locks.d.mts} +0 -0
- /package/dist/utils/{maps.d.cts → maps.d.mts} +0 -0
- /package/dist/utils/{math.d.cts → math.d.mts} +0 -0
- /package/dist/utils/{node-http.d.cts → node-http.d.mts} +0 -0
- /package/dist/utils/{numbers.d.cts → numbers.d.mts} +0 -0
- /package/dist/utils/{oauth.d.cts → oauth.d.mts} +0 -0
- /package/dist/utils/{objects.d.cts → objects.d.mts} +0 -0
- /package/dist/utils/{passkey.d.cts → passkey.d.mts} +0 -0
- /package/dist/utils/{proxies.d.cts → proxies.d.mts} +0 -0
- /package/dist/utils/{react.d.cts → react.d.mts} +0 -0
- /package/dist/utils/{results.d.cts → results.d.mts} +0 -0
- /package/dist/utils/{sentry.d.cts → sentry.d.mts} +0 -0
- /package/dist/utils/{strings.d.cts → strings.d.mts} +0 -0
- /package/dist/utils/{strings.nicify.test.d.cts → strings.nicify.test.d.mts} +0 -0
- /package/dist/utils/{types.d.cts → types.d.mts} +0 -0
- /package/dist/utils/{unicode.d.cts → unicode.d.mts} +0 -0
- /package/dist/utils/{urls.d.cts → urls.d.mts} +0 -0
- /package/dist/utils/{uuids.d.cts → uuids.d.mts} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as yup from 'yup';
|
|
2
|
-
import { DeepMerge, DeepPartial } from '../utils/objects.
|
|
3
|
-
import { PrettifyType } from '../utils/types.
|
|
4
|
-
import { NormalizesTo, Config } from './format.
|
|
2
|
+
import { DeepMerge, DeepPartial } from '../utils/objects.mjs';
|
|
3
|
+
import { PrettifyType } from '../utils/types.mjs';
|
|
4
|
+
import { NormalizesTo, Config } from './format.mjs';
|
|
5
5
|
|
|
6
6
|
declare const configLevels: readonly ["project", "branch", "environment", "organization"];
|
|
7
7
|
type ConfigLevel = typeof configLevels[number];
|
|
@@ -13,7 +13,7 @@ declare const branchConfigSchema: yup.ObjectSchema<{} & {
|
|
|
13
13
|
rbac: {
|
|
14
14
|
permissions?: Record<string, {
|
|
15
15
|
description?: string | undefined;
|
|
16
|
-
scope?: "
|
|
16
|
+
scope?: "project" | "team" | undefined;
|
|
17
17
|
containedPermissionIds?: Record<string, true | undefined> | undefined;
|
|
18
18
|
} | undefined> | undefined;
|
|
19
19
|
defaultPermissions?: {
|
|
@@ -31,18 +31,18 @@ declare const branchConfigSchema: yup.ObjectSchema<{} & {
|
|
|
31
31
|
} | undefined;
|
|
32
32
|
apiKeys: {
|
|
33
33
|
enabled?: {
|
|
34
|
-
user?: boolean | undefined;
|
|
35
34
|
team?: boolean | undefined;
|
|
35
|
+
user?: boolean | undefined;
|
|
36
36
|
} | undefined;
|
|
37
37
|
} | undefined;
|
|
38
38
|
domains: {
|
|
39
39
|
allowLocalhost?: boolean | undefined;
|
|
40
40
|
} | undefined;
|
|
41
41
|
auth: {
|
|
42
|
+
allowSignUp?: boolean | undefined;
|
|
42
43
|
password?: {
|
|
43
44
|
allowSignIn?: boolean | undefined;
|
|
44
45
|
} | undefined;
|
|
45
|
-
allowSignUp?: boolean | undefined;
|
|
46
46
|
otp?: {
|
|
47
47
|
allowSignIn?: boolean | undefined;
|
|
48
48
|
} | undefined;
|
|
@@ -52,8 +52,8 @@ declare const branchConfigSchema: yup.ObjectSchema<{} & {
|
|
|
52
52
|
oauth?: {
|
|
53
53
|
accountMergeStrategy?: "link_method" | "raise_error" | "allow_duplicates" | undefined;
|
|
54
54
|
providers?: Record<string, {
|
|
55
|
-
type?: "google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin" | "apple" | "x" | undefined;
|
|
56
55
|
allowSignIn?: boolean | undefined;
|
|
56
|
+
type?: "google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin" | "apple" | "x" | undefined;
|
|
57
57
|
allowConnectedAccounts?: boolean | undefined;
|
|
58
58
|
}> | undefined;
|
|
59
59
|
} | undefined;
|
|
@@ -106,7 +106,7 @@ declare const environmentConfigSchema: yup.ObjectSchema<{
|
|
|
106
106
|
rbac: {
|
|
107
107
|
permissions?: Record<string, {
|
|
108
108
|
description?: string | undefined;
|
|
109
|
-
scope?: "
|
|
109
|
+
scope?: "project" | "team" | undefined;
|
|
110
110
|
containedPermissionIds?: Record<string, true | undefined> | undefined;
|
|
111
111
|
} | undefined> | undefined;
|
|
112
112
|
defaultPermissions?: {
|
|
@@ -124,8 +124,8 @@ declare const environmentConfigSchema: yup.ObjectSchema<{
|
|
|
124
124
|
} | undefined;
|
|
125
125
|
apiKeys: {
|
|
126
126
|
enabled?: {
|
|
127
|
-
user?: boolean | undefined;
|
|
128
127
|
team?: boolean | undefined;
|
|
128
|
+
user?: boolean | undefined;
|
|
129
129
|
} | undefined;
|
|
130
130
|
} | undefined;
|
|
131
131
|
domains: (Omit<{
|
|
@@ -137,10 +137,10 @@ declare const environmentConfigSchema: yup.ObjectSchema<{
|
|
|
137
137
|
}> | undefined;
|
|
138
138
|
}) | undefined;
|
|
139
139
|
auth: (Omit<{
|
|
140
|
+
allowSignUp?: boolean | undefined;
|
|
140
141
|
password?: {
|
|
141
142
|
allowSignIn?: boolean | undefined;
|
|
142
143
|
} | undefined;
|
|
143
|
-
allowSignUp?: boolean | undefined;
|
|
144
144
|
otp?: {
|
|
145
145
|
allowSignIn?: boolean | undefined;
|
|
146
146
|
} | undefined;
|
|
@@ -150,8 +150,8 @@ declare const environmentConfigSchema: yup.ObjectSchema<{
|
|
|
150
150
|
oauth?: {
|
|
151
151
|
accountMergeStrategy?: "link_method" | "raise_error" | "allow_duplicates" | undefined;
|
|
152
152
|
providers?: Record<string, {
|
|
153
|
-
type?: "google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin" | "apple" | "x" | undefined;
|
|
154
153
|
allowSignIn?: boolean | undefined;
|
|
154
|
+
type?: "google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin" | "apple" | "x" | undefined;
|
|
155
155
|
allowConnectedAccounts?: boolean | undefined;
|
|
156
156
|
}> | undefined;
|
|
157
157
|
} | undefined;
|
|
@@ -159,18 +159,18 @@ declare const environmentConfigSchema: yup.ObjectSchema<{
|
|
|
159
159
|
oauth?: (Omit<{
|
|
160
160
|
accountMergeStrategy?: "link_method" | "raise_error" | "allow_duplicates" | undefined;
|
|
161
161
|
providers?: Record<string, {
|
|
162
|
-
type?: "google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin" | "apple" | "x" | undefined;
|
|
163
162
|
allowSignIn?: boolean | undefined;
|
|
163
|
+
type?: "google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin" | "apple" | "x" | undefined;
|
|
164
164
|
allowConnectedAccounts?: boolean | undefined;
|
|
165
165
|
}> | undefined;
|
|
166
166
|
}, never> & {
|
|
167
167
|
providers?: Record<string, {
|
|
168
|
-
type?: "google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin" | "apple" | "x" | undefined;
|
|
169
|
-
clientId?: string | undefined;
|
|
170
|
-
clientSecret?: string | undefined;
|
|
171
168
|
allowSignIn?: boolean | undefined;
|
|
169
|
+
type?: "google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin" | "apple" | "x" | undefined;
|
|
172
170
|
allowConnectedAccounts?: boolean | undefined;
|
|
173
171
|
isShared?: boolean | undefined;
|
|
172
|
+
clientId?: string | undefined;
|
|
173
|
+
clientSecret?: string | undefined;
|
|
174
174
|
facebookConfigId?: string | undefined;
|
|
175
175
|
microsoftTenantId?: string | undefined;
|
|
176
176
|
}> | undefined;
|
|
@@ -178,21 +178,21 @@ declare const environmentConfigSchema: yup.ObjectSchema<{
|
|
|
178
178
|
}) | undefined;
|
|
179
179
|
emails: Omit<{}, never> & {
|
|
180
180
|
server: {
|
|
181
|
+
password?: string | undefined;
|
|
182
|
+
isShared?: boolean | undefined;
|
|
181
183
|
host?: string | undefined;
|
|
182
184
|
port?: number | undefined;
|
|
183
185
|
username?: string | undefined;
|
|
184
|
-
password?: string | undefined;
|
|
185
|
-
isShared?: boolean | undefined;
|
|
186
186
|
senderName?: string | undefined;
|
|
187
187
|
senderEmail?: string | undefined;
|
|
188
188
|
};
|
|
189
189
|
};
|
|
190
190
|
} & {
|
|
191
191
|
auth: (Omit<{
|
|
192
|
+
allowSignUp?: boolean | undefined;
|
|
192
193
|
password?: {
|
|
193
194
|
allowSignIn?: boolean | undefined;
|
|
194
195
|
} | undefined;
|
|
195
|
-
allowSignUp?: boolean | undefined;
|
|
196
196
|
otp?: {
|
|
197
197
|
allowSignIn?: boolean | undefined;
|
|
198
198
|
} | undefined;
|
|
@@ -202,8 +202,8 @@ declare const environmentConfigSchema: yup.ObjectSchema<{
|
|
|
202
202
|
oauth?: {
|
|
203
203
|
accountMergeStrategy?: "link_method" | "raise_error" | "allow_duplicates" | undefined;
|
|
204
204
|
providers?: Record<string, {
|
|
205
|
-
type?: "google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin" | "apple" | "x" | undefined;
|
|
206
205
|
allowSignIn?: boolean | undefined;
|
|
206
|
+
type?: "google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin" | "apple" | "x" | undefined;
|
|
207
207
|
allowConnectedAccounts?: boolean | undefined;
|
|
208
208
|
}> | undefined;
|
|
209
209
|
} | undefined;
|
|
@@ -211,18 +211,18 @@ declare const environmentConfigSchema: yup.ObjectSchema<{
|
|
|
211
211
|
oauth?: (Omit<{
|
|
212
212
|
accountMergeStrategy?: "link_method" | "raise_error" | "allow_duplicates" | undefined;
|
|
213
213
|
providers?: Record<string, {
|
|
214
|
-
type?: "google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin" | "apple" | "x" | undefined;
|
|
215
214
|
allowSignIn?: boolean | undefined;
|
|
215
|
+
type?: "google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin" | "apple" | "x" | undefined;
|
|
216
216
|
allowConnectedAccounts?: boolean | undefined;
|
|
217
217
|
}> | undefined;
|
|
218
218
|
}, never> & {
|
|
219
219
|
providers?: Record<string, {
|
|
220
|
-
type?: "google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin" | "apple" | "x" | undefined;
|
|
221
|
-
clientId?: string | undefined;
|
|
222
|
-
clientSecret?: string | undefined;
|
|
223
220
|
allowSignIn?: boolean | undefined;
|
|
221
|
+
type?: "google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin" | "apple" | "x" | undefined;
|
|
224
222
|
allowConnectedAccounts?: boolean | undefined;
|
|
225
223
|
isShared?: boolean | undefined;
|
|
224
|
+
clientId?: string | undefined;
|
|
225
|
+
clientSecret?: string | undefined;
|
|
226
226
|
facebookConfigId?: string | undefined;
|
|
227
227
|
microsoftTenantId?: string | undefined;
|
|
228
228
|
}> | undefined;
|
|
@@ -230,11 +230,11 @@ declare const environmentConfigSchema: yup.ObjectSchema<{
|
|
|
230
230
|
}) | undefined;
|
|
231
231
|
emails: Omit<{}, never> & {
|
|
232
232
|
server: {
|
|
233
|
+
password?: string | undefined;
|
|
234
|
+
isShared?: boolean | undefined;
|
|
233
235
|
host?: string | undefined;
|
|
234
236
|
port?: number | undefined;
|
|
235
237
|
username?: string | undefined;
|
|
236
|
-
password?: string | undefined;
|
|
237
|
-
isShared?: boolean | undefined;
|
|
238
238
|
senderName?: string | undefined;
|
|
239
239
|
senderEmail?: string | undefined;
|
|
240
240
|
};
|
|
@@ -403,7 +403,7 @@ declare const organizationConfigSchema: yup.ObjectSchema<{
|
|
|
403
403
|
rbac: {
|
|
404
404
|
permissions?: Record<string, {
|
|
405
405
|
description?: string | undefined;
|
|
406
|
-
scope?: "
|
|
406
|
+
scope?: "project" | "team" | undefined;
|
|
407
407
|
containedPermissionIds?: Record<string, true | undefined> | undefined;
|
|
408
408
|
} | undefined> | undefined;
|
|
409
409
|
defaultPermissions?: {
|
|
@@ -421,8 +421,8 @@ declare const organizationConfigSchema: yup.ObjectSchema<{
|
|
|
421
421
|
} | undefined;
|
|
422
422
|
apiKeys: {
|
|
423
423
|
enabled?: {
|
|
424
|
-
user?: boolean | undefined;
|
|
425
424
|
team?: boolean | undefined;
|
|
425
|
+
user?: boolean | undefined;
|
|
426
426
|
} | undefined;
|
|
427
427
|
} | undefined;
|
|
428
428
|
domains: (Omit<{
|
|
@@ -434,10 +434,10 @@ declare const organizationConfigSchema: yup.ObjectSchema<{
|
|
|
434
434
|
}> | undefined;
|
|
435
435
|
}) | undefined;
|
|
436
436
|
auth: (Omit<{
|
|
437
|
+
allowSignUp?: boolean | undefined;
|
|
437
438
|
password?: {
|
|
438
439
|
allowSignIn?: boolean | undefined;
|
|
439
440
|
} | undefined;
|
|
440
|
-
allowSignUp?: boolean | undefined;
|
|
441
441
|
otp?: {
|
|
442
442
|
allowSignIn?: boolean | undefined;
|
|
443
443
|
} | undefined;
|
|
@@ -447,8 +447,8 @@ declare const organizationConfigSchema: yup.ObjectSchema<{
|
|
|
447
447
|
oauth?: {
|
|
448
448
|
accountMergeStrategy?: "link_method" | "raise_error" | "allow_duplicates" | undefined;
|
|
449
449
|
providers?: Record<string, {
|
|
450
|
-
type?: "google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin" | "apple" | "x" | undefined;
|
|
451
450
|
allowSignIn?: boolean | undefined;
|
|
451
|
+
type?: "google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin" | "apple" | "x" | undefined;
|
|
452
452
|
allowConnectedAccounts?: boolean | undefined;
|
|
453
453
|
}> | undefined;
|
|
454
454
|
} | undefined;
|
|
@@ -456,18 +456,18 @@ declare const organizationConfigSchema: yup.ObjectSchema<{
|
|
|
456
456
|
oauth?: (Omit<{
|
|
457
457
|
accountMergeStrategy?: "link_method" | "raise_error" | "allow_duplicates" | undefined;
|
|
458
458
|
providers?: Record<string, {
|
|
459
|
-
type?: "google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin" | "apple" | "x" | undefined;
|
|
460
459
|
allowSignIn?: boolean | undefined;
|
|
460
|
+
type?: "google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin" | "apple" | "x" | undefined;
|
|
461
461
|
allowConnectedAccounts?: boolean | undefined;
|
|
462
462
|
}> | undefined;
|
|
463
463
|
}, never> & {
|
|
464
464
|
providers?: Record<string, {
|
|
465
|
-
type?: "google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin" | "apple" | "x" | undefined;
|
|
466
|
-
clientId?: string | undefined;
|
|
467
|
-
clientSecret?: string | undefined;
|
|
468
465
|
allowSignIn?: boolean | undefined;
|
|
466
|
+
type?: "google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin" | "apple" | "x" | undefined;
|
|
469
467
|
allowConnectedAccounts?: boolean | undefined;
|
|
470
468
|
isShared?: boolean | undefined;
|
|
469
|
+
clientId?: string | undefined;
|
|
470
|
+
clientSecret?: string | undefined;
|
|
471
471
|
facebookConfigId?: string | undefined;
|
|
472
472
|
microsoftTenantId?: string | undefined;
|
|
473
473
|
}> | undefined;
|
|
@@ -475,11 +475,11 @@ declare const organizationConfigSchema: yup.ObjectSchema<{
|
|
|
475
475
|
}) | undefined;
|
|
476
476
|
emails: Omit<{}, never> & {
|
|
477
477
|
server: {
|
|
478
|
+
password?: string | undefined;
|
|
479
|
+
isShared?: boolean | undefined;
|
|
478
480
|
host?: string | undefined;
|
|
479
481
|
port?: number | undefined;
|
|
480
482
|
username?: string | undefined;
|
|
481
|
-
password?: string | undefined;
|
|
482
|
-
isShared?: boolean | undefined;
|
|
483
483
|
senderName?: string | undefined;
|
|
484
484
|
senderEmail?: string | undefined;
|
|
485
485
|
};
|
package/dist/config/schema.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ declare const branchConfigSchema: yup.ObjectSchema<{} & {
|
|
|
13
13
|
rbac: {
|
|
14
14
|
permissions?: Record<string, {
|
|
15
15
|
description?: string | undefined;
|
|
16
|
-
scope?: "
|
|
16
|
+
scope?: "project" | "team" | undefined;
|
|
17
17
|
containedPermissionIds?: Record<string, true | undefined> | undefined;
|
|
18
18
|
} | undefined> | undefined;
|
|
19
19
|
defaultPermissions?: {
|
|
@@ -31,18 +31,18 @@ declare const branchConfigSchema: yup.ObjectSchema<{} & {
|
|
|
31
31
|
} | undefined;
|
|
32
32
|
apiKeys: {
|
|
33
33
|
enabled?: {
|
|
34
|
-
user?: boolean | undefined;
|
|
35
34
|
team?: boolean | undefined;
|
|
35
|
+
user?: boolean | undefined;
|
|
36
36
|
} | undefined;
|
|
37
37
|
} | undefined;
|
|
38
38
|
domains: {
|
|
39
39
|
allowLocalhost?: boolean | undefined;
|
|
40
40
|
} | undefined;
|
|
41
41
|
auth: {
|
|
42
|
+
allowSignUp?: boolean | undefined;
|
|
42
43
|
password?: {
|
|
43
44
|
allowSignIn?: boolean | undefined;
|
|
44
45
|
} | undefined;
|
|
45
|
-
allowSignUp?: boolean | undefined;
|
|
46
46
|
otp?: {
|
|
47
47
|
allowSignIn?: boolean | undefined;
|
|
48
48
|
} | undefined;
|
|
@@ -52,8 +52,8 @@ declare const branchConfigSchema: yup.ObjectSchema<{} & {
|
|
|
52
52
|
oauth?: {
|
|
53
53
|
accountMergeStrategy?: "link_method" | "raise_error" | "allow_duplicates" | undefined;
|
|
54
54
|
providers?: Record<string, {
|
|
55
|
-
type?: "google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin" | "apple" | "x" | undefined;
|
|
56
55
|
allowSignIn?: boolean | undefined;
|
|
56
|
+
type?: "google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin" | "apple" | "x" | undefined;
|
|
57
57
|
allowConnectedAccounts?: boolean | undefined;
|
|
58
58
|
}> | undefined;
|
|
59
59
|
} | undefined;
|
|
@@ -106,7 +106,7 @@ declare const environmentConfigSchema: yup.ObjectSchema<{
|
|
|
106
106
|
rbac: {
|
|
107
107
|
permissions?: Record<string, {
|
|
108
108
|
description?: string | undefined;
|
|
109
|
-
scope?: "
|
|
109
|
+
scope?: "project" | "team" | undefined;
|
|
110
110
|
containedPermissionIds?: Record<string, true | undefined> | undefined;
|
|
111
111
|
} | undefined> | undefined;
|
|
112
112
|
defaultPermissions?: {
|
|
@@ -124,8 +124,8 @@ declare const environmentConfigSchema: yup.ObjectSchema<{
|
|
|
124
124
|
} | undefined;
|
|
125
125
|
apiKeys: {
|
|
126
126
|
enabled?: {
|
|
127
|
-
user?: boolean | undefined;
|
|
128
127
|
team?: boolean | undefined;
|
|
128
|
+
user?: boolean | undefined;
|
|
129
129
|
} | undefined;
|
|
130
130
|
} | undefined;
|
|
131
131
|
domains: (Omit<{
|
|
@@ -137,10 +137,10 @@ declare const environmentConfigSchema: yup.ObjectSchema<{
|
|
|
137
137
|
}> | undefined;
|
|
138
138
|
}) | undefined;
|
|
139
139
|
auth: (Omit<{
|
|
140
|
+
allowSignUp?: boolean | undefined;
|
|
140
141
|
password?: {
|
|
141
142
|
allowSignIn?: boolean | undefined;
|
|
142
143
|
} | undefined;
|
|
143
|
-
allowSignUp?: boolean | undefined;
|
|
144
144
|
otp?: {
|
|
145
145
|
allowSignIn?: boolean | undefined;
|
|
146
146
|
} | undefined;
|
|
@@ -150,8 +150,8 @@ declare const environmentConfigSchema: yup.ObjectSchema<{
|
|
|
150
150
|
oauth?: {
|
|
151
151
|
accountMergeStrategy?: "link_method" | "raise_error" | "allow_duplicates" | undefined;
|
|
152
152
|
providers?: Record<string, {
|
|
153
|
-
type?: "google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin" | "apple" | "x" | undefined;
|
|
154
153
|
allowSignIn?: boolean | undefined;
|
|
154
|
+
type?: "google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin" | "apple" | "x" | undefined;
|
|
155
155
|
allowConnectedAccounts?: boolean | undefined;
|
|
156
156
|
}> | undefined;
|
|
157
157
|
} | undefined;
|
|
@@ -159,18 +159,18 @@ declare const environmentConfigSchema: yup.ObjectSchema<{
|
|
|
159
159
|
oauth?: (Omit<{
|
|
160
160
|
accountMergeStrategy?: "link_method" | "raise_error" | "allow_duplicates" | undefined;
|
|
161
161
|
providers?: Record<string, {
|
|
162
|
-
type?: "google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin" | "apple" | "x" | undefined;
|
|
163
162
|
allowSignIn?: boolean | undefined;
|
|
163
|
+
type?: "google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin" | "apple" | "x" | undefined;
|
|
164
164
|
allowConnectedAccounts?: boolean | undefined;
|
|
165
165
|
}> | undefined;
|
|
166
166
|
}, never> & {
|
|
167
167
|
providers?: Record<string, {
|
|
168
|
-
type?: "google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin" | "apple" | "x" | undefined;
|
|
169
|
-
clientId?: string | undefined;
|
|
170
|
-
clientSecret?: string | undefined;
|
|
171
168
|
allowSignIn?: boolean | undefined;
|
|
169
|
+
type?: "google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin" | "apple" | "x" | undefined;
|
|
172
170
|
allowConnectedAccounts?: boolean | undefined;
|
|
173
171
|
isShared?: boolean | undefined;
|
|
172
|
+
clientId?: string | undefined;
|
|
173
|
+
clientSecret?: string | undefined;
|
|
174
174
|
facebookConfigId?: string | undefined;
|
|
175
175
|
microsoftTenantId?: string | undefined;
|
|
176
176
|
}> | undefined;
|
|
@@ -178,21 +178,21 @@ declare const environmentConfigSchema: yup.ObjectSchema<{
|
|
|
178
178
|
}) | undefined;
|
|
179
179
|
emails: Omit<{}, never> & {
|
|
180
180
|
server: {
|
|
181
|
+
password?: string | undefined;
|
|
182
|
+
isShared?: boolean | undefined;
|
|
181
183
|
host?: string | undefined;
|
|
182
184
|
port?: number | undefined;
|
|
183
185
|
username?: string | undefined;
|
|
184
|
-
password?: string | undefined;
|
|
185
|
-
isShared?: boolean | undefined;
|
|
186
186
|
senderName?: string | undefined;
|
|
187
187
|
senderEmail?: string | undefined;
|
|
188
188
|
};
|
|
189
189
|
};
|
|
190
190
|
} & {
|
|
191
191
|
auth: (Omit<{
|
|
192
|
+
allowSignUp?: boolean | undefined;
|
|
192
193
|
password?: {
|
|
193
194
|
allowSignIn?: boolean | undefined;
|
|
194
195
|
} | undefined;
|
|
195
|
-
allowSignUp?: boolean | undefined;
|
|
196
196
|
otp?: {
|
|
197
197
|
allowSignIn?: boolean | undefined;
|
|
198
198
|
} | undefined;
|
|
@@ -202,8 +202,8 @@ declare const environmentConfigSchema: yup.ObjectSchema<{
|
|
|
202
202
|
oauth?: {
|
|
203
203
|
accountMergeStrategy?: "link_method" | "raise_error" | "allow_duplicates" | undefined;
|
|
204
204
|
providers?: Record<string, {
|
|
205
|
-
type?: "google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin" | "apple" | "x" | undefined;
|
|
206
205
|
allowSignIn?: boolean | undefined;
|
|
206
|
+
type?: "google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin" | "apple" | "x" | undefined;
|
|
207
207
|
allowConnectedAccounts?: boolean | undefined;
|
|
208
208
|
}> | undefined;
|
|
209
209
|
} | undefined;
|
|
@@ -211,18 +211,18 @@ declare const environmentConfigSchema: yup.ObjectSchema<{
|
|
|
211
211
|
oauth?: (Omit<{
|
|
212
212
|
accountMergeStrategy?: "link_method" | "raise_error" | "allow_duplicates" | undefined;
|
|
213
213
|
providers?: Record<string, {
|
|
214
|
-
type?: "google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin" | "apple" | "x" | undefined;
|
|
215
214
|
allowSignIn?: boolean | undefined;
|
|
215
|
+
type?: "google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin" | "apple" | "x" | undefined;
|
|
216
216
|
allowConnectedAccounts?: boolean | undefined;
|
|
217
217
|
}> | undefined;
|
|
218
218
|
}, never> & {
|
|
219
219
|
providers?: Record<string, {
|
|
220
|
-
type?: "google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin" | "apple" | "x" | undefined;
|
|
221
|
-
clientId?: string | undefined;
|
|
222
|
-
clientSecret?: string | undefined;
|
|
223
220
|
allowSignIn?: boolean | undefined;
|
|
221
|
+
type?: "google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin" | "apple" | "x" | undefined;
|
|
224
222
|
allowConnectedAccounts?: boolean | undefined;
|
|
225
223
|
isShared?: boolean | undefined;
|
|
224
|
+
clientId?: string | undefined;
|
|
225
|
+
clientSecret?: string | undefined;
|
|
226
226
|
facebookConfigId?: string | undefined;
|
|
227
227
|
microsoftTenantId?: string | undefined;
|
|
228
228
|
}> | undefined;
|
|
@@ -230,11 +230,11 @@ declare const environmentConfigSchema: yup.ObjectSchema<{
|
|
|
230
230
|
}) | undefined;
|
|
231
231
|
emails: Omit<{}, never> & {
|
|
232
232
|
server: {
|
|
233
|
+
password?: string | undefined;
|
|
234
|
+
isShared?: boolean | undefined;
|
|
233
235
|
host?: string | undefined;
|
|
234
236
|
port?: number | undefined;
|
|
235
237
|
username?: string | undefined;
|
|
236
|
-
password?: string | undefined;
|
|
237
|
-
isShared?: boolean | undefined;
|
|
238
238
|
senderName?: string | undefined;
|
|
239
239
|
senderEmail?: string | undefined;
|
|
240
240
|
};
|
|
@@ -403,7 +403,7 @@ declare const organizationConfigSchema: yup.ObjectSchema<{
|
|
|
403
403
|
rbac: {
|
|
404
404
|
permissions?: Record<string, {
|
|
405
405
|
description?: string | undefined;
|
|
406
|
-
scope?: "
|
|
406
|
+
scope?: "project" | "team" | undefined;
|
|
407
407
|
containedPermissionIds?: Record<string, true | undefined> | undefined;
|
|
408
408
|
} | undefined> | undefined;
|
|
409
409
|
defaultPermissions?: {
|
|
@@ -421,8 +421,8 @@ declare const organizationConfigSchema: yup.ObjectSchema<{
|
|
|
421
421
|
} | undefined;
|
|
422
422
|
apiKeys: {
|
|
423
423
|
enabled?: {
|
|
424
|
-
user?: boolean | undefined;
|
|
425
424
|
team?: boolean | undefined;
|
|
425
|
+
user?: boolean | undefined;
|
|
426
426
|
} | undefined;
|
|
427
427
|
} | undefined;
|
|
428
428
|
domains: (Omit<{
|
|
@@ -434,10 +434,10 @@ declare const organizationConfigSchema: yup.ObjectSchema<{
|
|
|
434
434
|
}> | undefined;
|
|
435
435
|
}) | undefined;
|
|
436
436
|
auth: (Omit<{
|
|
437
|
+
allowSignUp?: boolean | undefined;
|
|
437
438
|
password?: {
|
|
438
439
|
allowSignIn?: boolean | undefined;
|
|
439
440
|
} | undefined;
|
|
440
|
-
allowSignUp?: boolean | undefined;
|
|
441
441
|
otp?: {
|
|
442
442
|
allowSignIn?: boolean | undefined;
|
|
443
443
|
} | undefined;
|
|
@@ -447,8 +447,8 @@ declare const organizationConfigSchema: yup.ObjectSchema<{
|
|
|
447
447
|
oauth?: {
|
|
448
448
|
accountMergeStrategy?: "link_method" | "raise_error" | "allow_duplicates" | undefined;
|
|
449
449
|
providers?: Record<string, {
|
|
450
|
-
type?: "google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin" | "apple" | "x" | undefined;
|
|
451
450
|
allowSignIn?: boolean | undefined;
|
|
451
|
+
type?: "google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin" | "apple" | "x" | undefined;
|
|
452
452
|
allowConnectedAccounts?: boolean | undefined;
|
|
453
453
|
}> | undefined;
|
|
454
454
|
} | undefined;
|
|
@@ -456,18 +456,18 @@ declare const organizationConfigSchema: yup.ObjectSchema<{
|
|
|
456
456
|
oauth?: (Omit<{
|
|
457
457
|
accountMergeStrategy?: "link_method" | "raise_error" | "allow_duplicates" | undefined;
|
|
458
458
|
providers?: Record<string, {
|
|
459
|
-
type?: "google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin" | "apple" | "x" | undefined;
|
|
460
459
|
allowSignIn?: boolean | undefined;
|
|
460
|
+
type?: "google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin" | "apple" | "x" | undefined;
|
|
461
461
|
allowConnectedAccounts?: boolean | undefined;
|
|
462
462
|
}> | undefined;
|
|
463
463
|
}, never> & {
|
|
464
464
|
providers?: Record<string, {
|
|
465
|
-
type?: "google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin" | "apple" | "x" | undefined;
|
|
466
|
-
clientId?: string | undefined;
|
|
467
|
-
clientSecret?: string | undefined;
|
|
468
465
|
allowSignIn?: boolean | undefined;
|
|
466
|
+
type?: "google" | "github" | "microsoft" | "spotify" | "facebook" | "discord" | "gitlab" | "bitbucket" | "linkedin" | "apple" | "x" | undefined;
|
|
469
467
|
allowConnectedAccounts?: boolean | undefined;
|
|
470
468
|
isShared?: boolean | undefined;
|
|
469
|
+
clientId?: string | undefined;
|
|
470
|
+
clientSecret?: string | undefined;
|
|
471
471
|
facebookConfigId?: string | undefined;
|
|
472
472
|
microsoftTenantId?: string | undefined;
|
|
473
473
|
}> | undefined;
|
|
@@ -475,11 +475,11 @@ declare const organizationConfigSchema: yup.ObjectSchema<{
|
|
|
475
475
|
}) | undefined;
|
|
476
476
|
emails: Omit<{}, never> & {
|
|
477
477
|
server: {
|
|
478
|
+
password?: string | undefined;
|
|
479
|
+
isShared?: boolean | undefined;
|
|
478
480
|
host?: string | undefined;
|
|
479
481
|
port?: number | undefined;
|
|
480
482
|
username?: string | undefined;
|
|
481
|
-
password?: string | undefined;
|
|
482
|
-
isShared?: boolean | undefined;
|
|
483
483
|
senderName?: string | undefined;
|
|
484
484
|
senderEmail?: string | undefined;
|
|
485
485
|
};
|
package/dist/config/schema.js
CHANGED
|
@@ -42,7 +42,7 @@ __export(schema_exports, {
|
|
|
42
42
|
projectConfigSchema: () => projectConfigSchema
|
|
43
43
|
});
|
|
44
44
|
module.exports = __toCommonJS(schema_exports);
|
|
45
|
-
var schemaFields = __toESM(require("../schema-fields")
|
|
45
|
+
var schemaFields = __toESM(require("../schema-fields"));
|
|
46
46
|
var import_schema_fields = require("../schema-fields");
|
|
47
47
|
var import_oauth = require("../utils/oauth");
|
|
48
48
|
var import_objects = require("../utils/objects");
|
|
@@ -953,7 +953,7 @@ var StackClientInterface = class {
|
|
|
953
953
|
const response = await this._processResponse(rawResponse);
|
|
954
954
|
if (response.status === "error") {
|
|
955
955
|
const error = response.error;
|
|
956
|
-
if (
|
|
956
|
+
if (KnownErrors.RefreshTokenError.isInstance(error)) {
|
|
957
957
|
return null;
|
|
958
958
|
}
|
|
959
959
|
throw error;
|
|
@@ -993,7 +993,7 @@ var StackClientInterface = class {
|
|
|
993
993
|
return Result.ok(await this.sendClientRequest(path, requestOptions, tokenStoreOrNull));
|
|
994
994
|
} catch (e) {
|
|
995
995
|
for (const errorType of errorsToCatch) {
|
|
996
|
-
if (e
|
|
996
|
+
if (errorType.isInstance(e)) {
|
|
997
997
|
return Result.error(e);
|
|
998
998
|
}
|
|
999
999
|
}
|
|
@@ -1050,6 +1050,8 @@ var StackClientInterface = class {
|
|
|
1050
1050
|
* the case (I haven't actually tested.)
|
|
1051
1051
|
*/
|
|
1052
1052
|
"X-Stack-Random-Nonce": generateSecureRandomString(),
|
|
1053
|
+
// don't show a warning when proxying the API through ngrok (only relevant if the API url is an ngrok site)
|
|
1054
|
+
"ngrok-skip-browser-warning": "true",
|
|
1053
1055
|
...this.options.extraRequestHeaders,
|
|
1054
1056
|
...options.headers
|
|
1055
1057
|
},
|
|
@@ -1075,14 +1077,14 @@ var StackClientInterface = class {
|
|
|
1075
1077
|
}
|
|
1076
1078
|
const processedRes = await this._processResponse(rawRes);
|
|
1077
1079
|
if (processedRes.status === "error") {
|
|
1078
|
-
if (processedRes.error
|
|
1080
|
+
if (KnownErrors.InvalidAccessToken.isInstance(processedRes.error)) {
|
|
1079
1081
|
if (!tokenObj) {
|
|
1080
1082
|
throw new StackAssertionError("Received invalid access token, but session is not logged in", { tokenObj, processedRes });
|
|
1081
1083
|
}
|
|
1082
1084
|
session.markAccessTokenExpired(tokenObj.accessToken);
|
|
1083
1085
|
return Result.error(processedRes.error);
|
|
1084
1086
|
}
|
|
1085
|
-
if (adminSession && (
|
|
1087
|
+
if (adminSession && (KnownErrors.InvalidAdminAccessToken.isInstance(processedRes.error) || KnownErrors.ApiKeyNotFound.isInstance(processedRes.error))) {
|
|
1086
1088
|
if (!adminTokenObj) {
|
|
1087
1089
|
throw new StackAssertionError("Received invalid admin access token, but admin session is not logged in", { adminTokenObj, processedRes });
|
|
1088
1090
|
}
|
|
@@ -1615,7 +1617,7 @@ var StackClientInterface = class {
|
|
|
1615
1617
|
[KnownErrors.RefreshTokenError]
|
|
1616
1618
|
);
|
|
1617
1619
|
if (resOrError.status === "error") {
|
|
1618
|
-
if (resOrError.error
|
|
1620
|
+
if (KnownErrors.RefreshTokenError.isInstance(resOrError.error)) {
|
|
1619
1621
|
} else {
|
|
1620
1622
|
throw new StackAssertionError("Unexpected error", { error: resOrError.error });
|
|
1621
1623
|
}
|
|
@@ -1632,7 +1634,7 @@ var StackClientInterface = class {
|
|
|
1632
1634
|
[KnownErrors.CannotGetOwnUserWithoutUser]
|
|
1633
1635
|
);
|
|
1634
1636
|
if (responseOrError.status === "error") {
|
|
1635
|
-
if (responseOrError.error
|
|
1637
|
+
if (KnownErrors.CannotGetOwnUserWithoutUser.isInstance(responseOrError.error)) {
|
|
1636
1638
|
return null;
|
|
1637
1639
|
} else {
|
|
1638
1640
|
throw new StackAssertionError("Unexpected uncaught error", { cause: responseOrError.error });
|