@01.software/cli 0.17.1 → 0.17.4
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/dist/index.js +206 -34
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1104,6 +1104,17 @@ function registerCrudCommands(program2, getClient2, getFormat2) {
|
|
|
1104
1104
|
|
|
1105
1105
|
// ../../internal/contracts/src/tenant/index.ts
|
|
1106
1106
|
import { z } from "zod";
|
|
1107
|
+
|
|
1108
|
+
// ../../internal/contracts/src/tenant/features.ts
|
|
1109
|
+
var TENANT_CUSTOM_FIELD_TYPES = [
|
|
1110
|
+
"text",
|
|
1111
|
+
"number",
|
|
1112
|
+
"select",
|
|
1113
|
+
"boolean",
|
|
1114
|
+
"date"
|
|
1115
|
+
];
|
|
1116
|
+
|
|
1117
|
+
// ../../internal/contracts/src/tenant/index.ts
|
|
1107
1118
|
var tenantFieldConfigStateSchema = z.object({
|
|
1108
1119
|
hiddenFields: z.array(z.string()),
|
|
1109
1120
|
isHidden: z.boolean()
|
|
@@ -1218,6 +1229,29 @@ var collectionFieldOptionSchema = z.object({
|
|
|
1218
1229
|
label: z.string(),
|
|
1219
1230
|
value: z.string()
|
|
1220
1231
|
}).strict();
|
|
1232
|
+
var collectionCustomFieldRequiredSchema = z.literal(true).optional();
|
|
1233
|
+
var collectionCustomFieldDefinitionSchema = z.discriminatedUnion(
|
|
1234
|
+
"type",
|
|
1235
|
+
[
|
|
1236
|
+
z.object({
|
|
1237
|
+
key: z.string().min(1),
|
|
1238
|
+
type: z.enum(
|
|
1239
|
+
TENANT_CUSTOM_FIELD_TYPES.filter((type) => type !== "select")
|
|
1240
|
+
),
|
|
1241
|
+
required: collectionCustomFieldRequiredSchema
|
|
1242
|
+
}).strict(),
|
|
1243
|
+
z.object({
|
|
1244
|
+
key: z.string().min(1),
|
|
1245
|
+
type: z.literal("select"),
|
|
1246
|
+
required: collectionCustomFieldRequiredSchema,
|
|
1247
|
+
options: z.array(z.string().min(1)).min(1)
|
|
1248
|
+
}).strict()
|
|
1249
|
+
]
|
|
1250
|
+
);
|
|
1251
|
+
var collectionCustomFieldsSchema = z.object({
|
|
1252
|
+
storagePath: z.literal("customData"),
|
|
1253
|
+
definitions: z.array(collectionCustomFieldDefinitionSchema)
|
|
1254
|
+
}).strict();
|
|
1221
1255
|
var collectionFieldSchema = z.lazy(
|
|
1222
1256
|
() => z.object({
|
|
1223
1257
|
name: z.string(),
|
|
@@ -1247,7 +1281,8 @@ var collectionSchemaResponseSchema = z.object({
|
|
|
1247
1281
|
collectionHidden: z.boolean(),
|
|
1248
1282
|
hiddenFields: z.array(z.string())
|
|
1249
1283
|
}).strict(),
|
|
1250
|
-
fields: z.array(collectionFieldSchema)
|
|
1284
|
+
fields: z.array(collectionFieldSchema),
|
|
1285
|
+
customFields: collectionCustomFieldsSchema.optional()
|
|
1251
1286
|
}).strict()
|
|
1252
1287
|
}).strict();
|
|
1253
1288
|
|
|
@@ -1855,9 +1890,74 @@ var createTossPaymentSessionBodySchema = z5.object({
|
|
|
1855
1890
|
provider: z5.literal("toss"),
|
|
1856
1891
|
providerOptions: z5.object({ profile: z5.literal("widget_v2") }).strict()
|
|
1857
1892
|
}).strict();
|
|
1858
|
-
var
|
|
1859
|
-
|
|
1860
|
-
|
|
1893
|
+
var PORTONE_HOSTED_PAYMENT_METHODS = [
|
|
1894
|
+
"CARD_KR",
|
|
1895
|
+
"N_PAY",
|
|
1896
|
+
"KAKAO_PAY",
|
|
1897
|
+
"TOSS_PAY",
|
|
1898
|
+
"CARD_INTERNATIONAL",
|
|
1899
|
+
"PAY_PAL",
|
|
1900
|
+
"UNION_PAY",
|
|
1901
|
+
"ALIPAY_CN",
|
|
1902
|
+
"ALIPAY_HK",
|
|
1903
|
+
"TRUE_MONEY",
|
|
1904
|
+
"DANA",
|
|
1905
|
+
"TOUCH_N_GO",
|
|
1906
|
+
"G_CASH",
|
|
1907
|
+
"WE_CHAT_PAY",
|
|
1908
|
+
"KLARNA",
|
|
1909
|
+
"E_CONTEXT",
|
|
1910
|
+
"GRAB_PAY_MY",
|
|
1911
|
+
"GRAB_PAY_SG",
|
|
1912
|
+
"SHOPEE_PAY_TH",
|
|
1913
|
+
"PAY_PAY",
|
|
1914
|
+
"BPI",
|
|
1915
|
+
"RABBIT_LINE_PAY",
|
|
1916
|
+
"CONVENIENCE_STORE_JP",
|
|
1917
|
+
"AMAZON_PAY",
|
|
1918
|
+
"RAKUTEN_PAY",
|
|
1919
|
+
"D_BARAI",
|
|
1920
|
+
"AU_PAY",
|
|
1921
|
+
"MERPAY"
|
|
1922
|
+
];
|
|
1923
|
+
var portOneHostedPaymentMethodSchema = z5.enum(
|
|
1924
|
+
PORTONE_HOSTED_PAYMENT_METHODS
|
|
1925
|
+
);
|
|
1926
|
+
var PORTONE_STANDARD_PAYMENT_METHODS = ["CARD"];
|
|
1927
|
+
var portOneStandardPaymentMethodSchema = z5.enum(
|
|
1928
|
+
PORTONE_STANDARD_PAYMENT_METHODS
|
|
1929
|
+
);
|
|
1930
|
+
var PORTONE_STANDARD_CURRENCY = "CURRENCY_KRW";
|
|
1931
|
+
var portOneStandardProviderOptionsSchema = z5.object({
|
|
1932
|
+
profile: z5.literal("standard_v2"),
|
|
1933
|
+
paymentMethod: portOneStandardPaymentMethodSchema
|
|
1934
|
+
}).strict();
|
|
1935
|
+
var createPortOnePaymentSessionBodySchema = z5.object({
|
|
1936
|
+
...createPaymentSessionBaseBodyShape,
|
|
1937
|
+
provider: z5.literal("portone"),
|
|
1938
|
+
providerOptions: z5.discriminatedUnion("profile", [
|
|
1939
|
+
z5.object({
|
|
1940
|
+
profile: z5.literal("hosted_v2"),
|
|
1941
|
+
paymentMethod: portOneHostedPaymentMethodSchema
|
|
1942
|
+
}).strict(),
|
|
1943
|
+
portOneStandardProviderOptionsSchema
|
|
1944
|
+
])
|
|
1945
|
+
}).strict();
|
|
1946
|
+
var createPaymentSessionBodySchema = z5.discriminatedUnion("provider", [
|
|
1947
|
+
createTossPaymentSessionBodySchema,
|
|
1948
|
+
createPortOnePaymentSessionBodySchema
|
|
1949
|
+
]);
|
|
1950
|
+
var createPaymentSessionParamsSchema = z5.discriminatedUnion(
|
|
1951
|
+
"provider",
|
|
1952
|
+
[
|
|
1953
|
+
createTossPaymentSessionBodySchema.extend({
|
|
1954
|
+
idempotencyKey: commerceIdempotencyKeySchema
|
|
1955
|
+
}),
|
|
1956
|
+
createPortOnePaymentSessionBodySchema.extend({
|
|
1957
|
+
idempotencyKey: commerceIdempotencyKeySchema
|
|
1958
|
+
})
|
|
1959
|
+
]
|
|
1960
|
+
);
|
|
1861
1961
|
var retrieveBrowserPaymentSessionParamsSchema = z5.object({
|
|
1862
1962
|
paymentSessionId: commerceResourceIdSchema,
|
|
1863
1963
|
checkoutToken: commerceCapabilitySchema
|
|
@@ -1891,6 +1991,20 @@ var confirmTossPaymentSessionBodySchema = z5.object({
|
|
|
1891
1991
|
var confirmTossPaymentSessionParamsSchema = confirmTossPaymentSessionBodySchema.extend({
|
|
1892
1992
|
idempotencyKey: commerceIdempotencyKeySchema
|
|
1893
1993
|
});
|
|
1994
|
+
var PAYMENT_PROVIDER_STATUSES = [
|
|
1995
|
+
"requires_payment_method",
|
|
1996
|
+
"requires_action",
|
|
1997
|
+
"requires_confirmation",
|
|
1998
|
+
"initializing",
|
|
1999
|
+
"processing",
|
|
2000
|
+
"authorized",
|
|
2001
|
+
"canceling",
|
|
2002
|
+
"unknown",
|
|
2003
|
+
"captured",
|
|
2004
|
+
"failed",
|
|
2005
|
+
"canceled"
|
|
2006
|
+
];
|
|
2007
|
+
var paymentProviderStatusSchema = z5.enum(PAYMENT_PROVIDER_STATUSES);
|
|
1894
2008
|
var customPaymentProviderSchema = z5.string().trim().min(1).max(64).regex(/^[a-z0-9][a-z0-9_-]{0,63}$/i, "provider must be a slug");
|
|
1895
2009
|
var customPaymentIdentitySchema = z5.string().trim().min(1);
|
|
1896
2010
|
var customPaymentCurrencyInputSchema = z5.string().trim().min(1).regex(/^[A-Za-z]{3}$/, "currency must be a three-letter ISO 4217 code").transform((currency) => currency.toUpperCase());
|
|
@@ -1907,6 +2021,29 @@ var customPaymentSessionSchema = z5.object({
|
|
|
1907
2021
|
providerSessionId: customPaymentIdentitySchema,
|
|
1908
2022
|
money: moneySchema
|
|
1909
2023
|
}).strict();
|
|
2024
|
+
var customPaymentSessionLookupSchema = z5.union([
|
|
2025
|
+
z5.object({
|
|
2026
|
+
providerSessionId: customPaymentIdentitySchema
|
|
2027
|
+
}).strict(),
|
|
2028
|
+
z5.object({
|
|
2029
|
+
providerPaymentId: customPaymentIdentitySchema
|
|
2030
|
+
}).strict()
|
|
2031
|
+
]);
|
|
2032
|
+
var retrieveCustomPaymentSessionBodySchema = z5.object({
|
|
2033
|
+
provider: customPaymentProviderSchema,
|
|
2034
|
+
by: customPaymentSessionLookupSchema
|
|
2035
|
+
}).strict();
|
|
2036
|
+
var retrievedCustomPaymentSessionSchema = z5.object({
|
|
2037
|
+
id: commerceResourceIdSchema,
|
|
2038
|
+
provider: customPaymentProviderSchema,
|
|
2039
|
+
providerSessionId: customPaymentIdentitySchema,
|
|
2040
|
+
providerPaymentId: customPaymentIdentitySchema.nullable(),
|
|
2041
|
+
status: z5.enum(["pending", "captured", "failed", "canceled"]),
|
|
2042
|
+
providerStatus: paymentProviderStatusSchema,
|
|
2043
|
+
finalizationStatus: z5.enum(["not_ready", "pending", "committed"]),
|
|
2044
|
+
money: moneySchema,
|
|
2045
|
+
orderId: commerceResourceIdSchema.nullable()
|
|
2046
|
+
}).strict();
|
|
1910
2047
|
var confirmCustomPaymentSessionBodySchema = z5.object({
|
|
1911
2048
|
provider: customPaymentProviderSchema,
|
|
1912
2049
|
providerSessionId: customPaymentIdentitySchema,
|
|
@@ -1922,7 +2059,7 @@ var confirmCustomPaymentSessionResponseSchema = z5.object({
|
|
|
1922
2059
|
status: z5.literal("paid"),
|
|
1923
2060
|
alreadyConfirmed: z5.boolean().optional()
|
|
1924
2061
|
}).strict();
|
|
1925
|
-
var
|
|
2062
|
+
var tossPaymentNextActionSchema = z5.object({
|
|
1926
2063
|
type: z5.literal("toss_widget"),
|
|
1927
2064
|
clientKey: z5.string().min(1).max(255),
|
|
1928
2065
|
paymentMethodVariantKey: z5.string().min(1).max(255),
|
|
@@ -1933,6 +2070,34 @@ var paymentNextActionSchema = z5.object({
|
|
|
1933
2070
|
customerName: z5.string().min(1).max(200).optional(),
|
|
1934
2071
|
customerEmail: z5.string().email().max(254).optional()
|
|
1935
2072
|
}).strict();
|
|
2073
|
+
var portOnePaymentNextActionSchema = z5.object({
|
|
2074
|
+
type: z5.literal("portone_checkout"),
|
|
2075
|
+
checkoutUrl: z5.string().url().startsWith("https://").max(2048).refine((value) => {
|
|
2076
|
+
const url = new URL(value);
|
|
2077
|
+
return url.username === "" && url.password === "";
|
|
2078
|
+
}, "checkoutUrl must not contain embedded credentials")
|
|
2079
|
+
}).strict();
|
|
2080
|
+
var portOneSdkPaymentNextActionSchema = z5.object({
|
|
2081
|
+
type: z5.literal("portone_sdk"),
|
|
2082
|
+
version: z5.literal("v2"),
|
|
2083
|
+
storeId: z5.string().min(1).max(255),
|
|
2084
|
+
channelKey: z5.string().min(1).max(255),
|
|
2085
|
+
paymentId: z5.string().regex(/^[A-Za-z0-9]{6,40}$/),
|
|
2086
|
+
orderName: z5.string().min(1).max(200),
|
|
2087
|
+
totalAmount: z5.number().int().positive().max(Number.MAX_SAFE_INTEGER),
|
|
2088
|
+
currency: z5.literal(PORTONE_STANDARD_CURRENCY),
|
|
2089
|
+
payMethod: portOneStandardPaymentMethodSchema,
|
|
2090
|
+
redirectUrl: z5.string().url().max(2048).refine((value) => {
|
|
2091
|
+
const url = new URL(value);
|
|
2092
|
+
const loopback = url.protocol === "http:" && (url.hostname === "localhost" || url.hostname === "127.0.0.1");
|
|
2093
|
+
return (url.protocol === "https:" || loopback) && !url.username && !url.password;
|
|
2094
|
+
}, "redirectUrl must be HTTPS (or development loopback) without embedded credentials")
|
|
2095
|
+
}).strict();
|
|
2096
|
+
var paymentNextActionSchema = z5.discriminatedUnion("type", [
|
|
2097
|
+
tossPaymentNextActionSchema,
|
|
2098
|
+
portOnePaymentNextActionSchema,
|
|
2099
|
+
portOneSdkPaymentNextActionSchema
|
|
2100
|
+
]);
|
|
1936
2101
|
var PAYMENT_SESSION_ROLES = [
|
|
1937
2102
|
"active",
|
|
1938
2103
|
"canonical_candidate",
|
|
@@ -1941,20 +2106,6 @@ var PAYMENT_SESSION_ROLES = [
|
|
|
1941
2106
|
"historical"
|
|
1942
2107
|
];
|
|
1943
2108
|
var paymentSessionRoleSchema = z5.enum(PAYMENT_SESSION_ROLES);
|
|
1944
|
-
var PAYMENT_PROVIDER_STATUSES = [
|
|
1945
|
-
"requires_payment_method",
|
|
1946
|
-
"requires_action",
|
|
1947
|
-
"requires_confirmation",
|
|
1948
|
-
"initializing",
|
|
1949
|
-
"processing",
|
|
1950
|
-
"authorized",
|
|
1951
|
-
"canceling",
|
|
1952
|
-
"unknown",
|
|
1953
|
-
"captured",
|
|
1954
|
-
"failed",
|
|
1955
|
-
"canceled"
|
|
1956
|
-
];
|
|
1957
|
-
var paymentProviderStatusSchema = z5.enum(PAYMENT_PROVIDER_STATUSES);
|
|
1958
2109
|
var PAYMENT_RECONCILIATION_REASONS = [
|
|
1959
2110
|
"provider_outcome_unknown",
|
|
1960
2111
|
"local_commit_ambiguous",
|
|
@@ -2144,17 +2295,24 @@ function stateSchemas(nextAction) {
|
|
|
2144
2295
|
})
|
|
2145
2296
|
];
|
|
2146
2297
|
}
|
|
2147
|
-
function providerSessionSchemas(action) {
|
|
2298
|
+
function providerSessionSchemas(provider, action) {
|
|
2148
2299
|
return stateSchemas(action).map(
|
|
2149
2300
|
(state) => z5.object({
|
|
2150
2301
|
...paymentSessionBaseShape,
|
|
2151
|
-
provider: z5.literal(
|
|
2302
|
+
provider: z5.literal(provider),
|
|
2152
2303
|
...state.shape
|
|
2153
2304
|
}).strict()
|
|
2154
2305
|
);
|
|
2155
2306
|
}
|
|
2156
2307
|
var publicPaymentSessionVariants = [
|
|
2157
|
-
...providerSessionSchemas(
|
|
2308
|
+
...providerSessionSchemas("toss", tossPaymentNextActionSchema),
|
|
2309
|
+
...providerSessionSchemas(
|
|
2310
|
+
"portone",
|
|
2311
|
+
z5.union([
|
|
2312
|
+
portOnePaymentNextActionSchema,
|
|
2313
|
+
portOneSdkPaymentNextActionSchema
|
|
2314
|
+
])
|
|
2315
|
+
)
|
|
2158
2316
|
];
|
|
2159
2317
|
var publicPaymentSessionSchema = z5.union(publicPaymentSessionVariants);
|
|
2160
2318
|
var CreatePaymentSessionParamsSchema = createPaymentSessionParamsSchema;
|
|
@@ -2209,9 +2367,10 @@ var checkoutAmountsSchema = z6.object({
|
|
|
2209
2367
|
});
|
|
2210
2368
|
}
|
|
2211
2369
|
});
|
|
2370
|
+
var CHECKOUT_PAYMENT_SESSION_PROVIDERS = ["toss", "portone"];
|
|
2212
2371
|
var checkoutPaymentSessionRefSchema = z6.object({
|
|
2213
2372
|
id: z6.string().min(1),
|
|
2214
|
-
provider: z6.
|
|
2373
|
+
provider: z6.enum(CHECKOUT_PAYMENT_SESSION_PROVIDERS),
|
|
2215
2374
|
providerStatus: paymentProviderStatusSchema
|
|
2216
2375
|
}).strict();
|
|
2217
2376
|
var openCheckoutPaymentStateSchema = z6.object({
|
|
@@ -3119,6 +3278,10 @@ function registerStockCommands(program2, getClient2, getFormat2) {
|
|
|
3119
3278
|
}
|
|
3120
3279
|
|
|
3121
3280
|
// src/commands/transaction.ts
|
|
3281
|
+
function paymentProvider(value) {
|
|
3282
|
+
if (value === "toss" || value === "portone") return value;
|
|
3283
|
+
throw new Error("payment provider must be toss or portone");
|
|
3284
|
+
}
|
|
3122
3285
|
function registerCommerceSessionCommands(program2, getClient2, getFormat2) {
|
|
3123
3286
|
const checkout = program2.command("checkout").description("Checkout management");
|
|
3124
3287
|
checkout.command("create").description("Create a Checkout from a server-authoritative Cart").option("--data-stdin", "Read capability and customer JSON from stdin").option("--data-file <path>", "Read capability and customer JSON from file").option("--dry-run", "Validate inputs without executing").action(async (opts) => {
|
|
@@ -3180,20 +3343,23 @@ function registerCommerceSessionCommands(program2, getClient2, getFormat2) {
|
|
|
3180
3343
|
);
|
|
3181
3344
|
return;
|
|
3182
3345
|
}
|
|
3183
|
-
|
|
3184
|
-
|
|
3185
|
-
|
|
3186
|
-
);
|
|
3346
|
+
const paymentSessions = getClient2().commerce.paymentSessions;
|
|
3347
|
+
const result = data.provider === "portone" ? await paymentSessions.createPortOne(data) : await paymentSessions.create(data);
|
|
3348
|
+
printResult(result, getFormat2());
|
|
3187
3349
|
} catch (error) {
|
|
3188
3350
|
exitWithError(error);
|
|
3189
3351
|
}
|
|
3190
3352
|
});
|
|
3191
|
-
sessions.command("retrieve <paymentSessionId>").description("Retrieve a PaymentSession").
|
|
3353
|
+
sessions.command("retrieve <paymentSessionId>").description("Retrieve a PaymentSession").option(
|
|
3354
|
+
"--provider <provider>",
|
|
3355
|
+
"Payment provider (toss or portone)",
|
|
3356
|
+
"toss"
|
|
3357
|
+
).action(async (paymentSessionId, opts) => {
|
|
3192
3358
|
try {
|
|
3359
|
+
const provider = paymentProvider(opts.provider);
|
|
3360
|
+
const paymentSessions = getClient2().commerce.paymentSessions;
|
|
3193
3361
|
printResult(
|
|
3194
|
-
await
|
|
3195
|
-
paymentSessionId
|
|
3196
|
-
}),
|
|
3362
|
+
provider === "portone" ? await paymentSessions.retrievePortOne({ paymentSessionId }) : await paymentSessions.retrieve({ paymentSessionId }),
|
|
3197
3363
|
getFormat2()
|
|
3198
3364
|
);
|
|
3199
3365
|
} catch (error) {
|
|
@@ -3203,6 +3369,10 @@ function registerCommerceSessionCommands(program2, getClient2, getFormat2) {
|
|
|
3203
3369
|
sessions.command("cancel").description("Cancel a PaymentSession and release its payment slot").option("--data-stdin", "Read session ID and idempotency key from stdin").option(
|
|
3204
3370
|
"--data-file <path>",
|
|
3205
3371
|
"Read session ID and idempotency key from file"
|
|
3372
|
+
).option(
|
|
3373
|
+
"--provider <provider>",
|
|
3374
|
+
"Payment provider (toss or portone)",
|
|
3375
|
+
"toss"
|
|
3206
3376
|
).option("--dry-run", "Validate inputs without executing").action(async (opts) => {
|
|
3207
3377
|
try {
|
|
3208
3378
|
const data = parseWithSchema(
|
|
@@ -3210,6 +3380,7 @@ function registerCommerceSessionCommands(program2, getClient2, getFormat2) {
|
|
|
3210
3380
|
"payment-session cancel",
|
|
3211
3381
|
CancelServerPaymentSessionParamsSchema
|
|
3212
3382
|
);
|
|
3383
|
+
const provider = paymentProvider(opts.provider);
|
|
3213
3384
|
if (opts.dryRun) {
|
|
3214
3385
|
printResult(
|
|
3215
3386
|
sensitiveDryRunResult("payment-session cancel"),
|
|
@@ -3217,8 +3388,9 @@ function registerCommerceSessionCommands(program2, getClient2, getFormat2) {
|
|
|
3217
3388
|
);
|
|
3218
3389
|
return;
|
|
3219
3390
|
}
|
|
3391
|
+
const paymentSessions = getClient2().commerce.paymentSessions;
|
|
3220
3392
|
printResult(
|
|
3221
|
-
await
|
|
3393
|
+
provider === "portone" ? await paymentSessions.cancelPortOne(data) : await paymentSessions.cancel(data),
|
|
3222
3394
|
getFormat2()
|
|
3223
3395
|
);
|
|
3224
3396
|
} catch (error) {
|
|
@@ -3384,7 +3556,7 @@ import { randomBytes as randomBytes2 } from "crypto";
|
|
|
3384
3556
|
import { createServer } from "http";
|
|
3385
3557
|
import { execFile, exec } from "child_process";
|
|
3386
3558
|
import { platform } from "os";
|
|
3387
|
-
import { URL } from "url";
|
|
3559
|
+
import { URL as URL2 } from "url";
|
|
3388
3560
|
import pc2 from "picocolors";
|
|
3389
3561
|
var WEB_URL = process.env.SOFTWARE_WEB_URL || "https://01.software";
|
|
3390
3562
|
var TIMEOUT_MS = 3 * 60 * 1e3;
|
|
@@ -3477,7 +3649,7 @@ function startAuthServer(options) {
|
|
|
3477
3649
|
res.writeHead(400).end();
|
|
3478
3650
|
return;
|
|
3479
3651
|
}
|
|
3480
|
-
const url = new
|
|
3652
|
+
const url = new URL2(req.url, `http://localhost`);
|
|
3481
3653
|
if (url.pathname !== "/callback" || req.method !== "GET") {
|
|
3482
3654
|
res.writeHead(404).end();
|
|
3483
3655
|
return;
|