@thirdweb-dev/service-utils 0.9.13 → 0.9.14
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/cjs/cf-worker/index.js +25 -25
- package/dist/cjs/cf-worker/index.js.map +1 -1
- package/dist/cjs/cf-worker/usage.js +7 -7
- package/dist/cjs/cf-worker/usage.js.map +1 -1
- package/dist/cjs/cf-worker/usageV2.js +2 -2
- package/dist/cjs/cf-worker/usageV2.js.map +1 -1
- package/dist/cjs/core/api.js +1 -1
- package/dist/cjs/core/api.js.map +1 -1
- package/dist/cjs/core/authorize/client.js +6 -6
- package/dist/cjs/core/authorize/client.js.map +1 -1
- package/dist/cjs/core/authorize/index.js +12 -12
- package/dist/cjs/core/authorize/index.js.map +1 -1
- package/dist/cjs/core/authorize/service.js +7 -7
- package/dist/cjs/core/authorize/service.js.map +1 -1
- package/dist/cjs/core/rateLimit/index.js +7 -7
- package/dist/cjs/core/rateLimit/index.js.map +1 -1
- package/dist/cjs/core/rateLimit/strategies/sliding-window.js +3 -3
- package/dist/cjs/core/rateLimit/strategies/sliding-window.js.map +1 -1
- package/dist/cjs/core/services.js +51 -51
- package/dist/cjs/core/services.js.map +1 -1
- package/dist/cjs/core/usage.js +53 -52
- package/dist/cjs/core/usage.js.map +1 -1
- package/dist/cjs/index.js +5 -5
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/mocks.js +60 -59
- package/dist/cjs/mocks.js.map +1 -1
- package/dist/cjs/node/index.js +25 -25
- package/dist/cjs/node/index.js.map +1 -1
- package/dist/cjs/node/kafka.js +6 -6
- package/dist/cjs/node/kafka.js.map +1 -1
- package/dist/cjs/node/usageV2.js +8 -8
- package/dist/cjs/node/usageV2.js.map +1 -1
- package/dist/esm/cf-worker/index.js +25 -25
- package/dist/esm/cf-worker/index.js.map +1 -1
- package/dist/esm/cf-worker/usage.js +7 -7
- package/dist/esm/cf-worker/usage.js.map +1 -1
- package/dist/esm/cf-worker/usageV2.js +2 -2
- package/dist/esm/cf-worker/usageV2.js.map +1 -1
- package/dist/esm/core/api.js +1 -1
- package/dist/esm/core/api.js.map +1 -1
- package/dist/esm/core/authorize/client.js +6 -6
- package/dist/esm/core/authorize/client.js.map +1 -1
- package/dist/esm/core/authorize/index.js +12 -12
- package/dist/esm/core/authorize/index.js.map +1 -1
- package/dist/esm/core/authorize/service.js +7 -7
- package/dist/esm/core/authorize/service.js.map +1 -1
- package/dist/esm/core/rateLimit/index.js +7 -7
- package/dist/esm/core/rateLimit/index.js.map +1 -1
- package/dist/esm/core/rateLimit/strategies/sliding-window.js +3 -3
- package/dist/esm/core/rateLimit/strategies/sliding-window.js.map +1 -1
- package/dist/esm/core/services.js +51 -51
- package/dist/esm/core/services.js.map +1 -1
- package/dist/esm/core/usage.js +53 -52
- package/dist/esm/core/usage.js.map +1 -1
- package/dist/esm/index.js +2 -2
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/mocks.js +60 -59
- package/dist/esm/mocks.js.map +1 -1
- package/dist/esm/node/index.js +25 -25
- package/dist/esm/node/index.js.map +1 -1
- package/dist/esm/node/kafka.js +6 -6
- package/dist/esm/node/kafka.js.map +1 -1
- package/dist/esm/node/usageV2.js +8 -8
- package/dist/esm/node/usageV2.js.map +1 -1
- package/dist/types/cf-worker/index.d.ts +3 -3
- package/dist/types/cf-worker/index.d.ts.map +1 -1
- package/dist/types/cf-worker/usage.d.ts.map +1 -1
- package/dist/types/core/api.d.ts +4 -0
- package/dist/types/core/api.d.ts.map +1 -1
- package/dist/types/core/authorize/client.d.ts.map +1 -1
- package/dist/types/core/authorize/index.d.ts.map +1 -1
- package/dist/types/core/services.d.ts +122 -122
- package/dist/types/core/services.d.ts.map +1 -1
- package/dist/types/core/usage.d.ts +143 -141
- package/dist/types/core/usage.d.ts.map +1 -1
- package/dist/types/index.d.ts +3 -3
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/mocks.d.ts.map +1 -1
- package/dist/types/node/index.d.ts +4 -4
- package/dist/types/node/index.d.ts.map +1 -1
- package/dist/types/node/usageV2.d.ts.map +1 -1
- package/package.json +44 -43
@@ -3,85 +3,85 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.SERVICES = exports.SERVICE_NAMES = exports.SERVICE_DEFINITIONS = void 0;
|
4
4
|
exports.getServiceByName = getServiceByName;
|
5
5
|
exports.SERVICE_DEFINITIONS = {
|
6
|
-
|
7
|
-
name: "storage",
|
8
|
-
title: "Storage",
|
9
|
-
description: "IPFS Upload and Download",
|
10
|
-
actions: [
|
11
|
-
{
|
12
|
-
name: "read",
|
13
|
-
title: "Download",
|
14
|
-
description: "Download a file from Storage",
|
15
|
-
},
|
16
|
-
{
|
17
|
-
name: "write",
|
18
|
-
title: "Upload",
|
19
|
-
description: "Upload a file to Storage",
|
20
|
-
},
|
21
|
-
],
|
22
|
-
},
|
23
|
-
rpc: {
|
24
|
-
name: "rpc",
|
25
|
-
title: "RPC",
|
26
|
-
description: "Accelerated RPC Edge",
|
6
|
+
bundler: {
|
27
7
|
// all actions allowed
|
28
8
|
actions: [],
|
29
|
-
|
30
|
-
bundler: {
|
9
|
+
description: "Bundler & Paymaster services",
|
31
10
|
name: "bundler",
|
32
11
|
title: "Account Abstraction",
|
33
|
-
description: "Bundler & Paymaster services",
|
34
|
-
// all actions allowed
|
35
|
-
actions: [],
|
36
12
|
},
|
37
|
-
|
38
|
-
name: "relayer",
|
39
|
-
title: "Gasless Relayer",
|
40
|
-
description: "Enable gasless transactions",
|
13
|
+
chainsaw: {
|
41
14
|
// all actions allowed
|
42
15
|
actions: [],
|
16
|
+
description: "Indexed data for any EVM chain",
|
17
|
+
name: "chainsaw",
|
18
|
+
title: "Chainsaw",
|
43
19
|
},
|
44
20
|
embeddedWallets: {
|
45
|
-
name: "embeddedWallets",
|
46
|
-
title: "In-App Wallets",
|
47
|
-
description: "E-mail and social login wallets for easy web3 onboarding",
|
48
21
|
// all actions allowed
|
49
22
|
actions: [],
|
23
|
+
description: "E-mail and social login wallets for easy web3 onboarding",
|
24
|
+
name: "embeddedWallets",
|
25
|
+
title: "Wallets",
|
50
26
|
},
|
51
|
-
|
52
|
-
name: "pay",
|
53
|
-
title: "Universal Bridge",
|
54
|
-
description: "Bridge, swap, and purchase cryptocurrencies and execute transactions with any fiat or tokens via cross-chain routing",
|
27
|
+
engineCloud: {
|
55
28
|
// all actions allowed
|
56
29
|
actions: [],
|
30
|
+
description: "Transaction API and Server wallets with high transaction throughput and low latency",
|
31
|
+
name: "engineCloud",
|
32
|
+
title: "Transactions",
|
57
33
|
},
|
58
|
-
|
59
|
-
name: "chainsaw",
|
60
|
-
title: "Chainsaw",
|
61
|
-
description: "Indexed data for any EVM chain",
|
34
|
+
insight: {
|
62
35
|
// all actions allowed
|
63
36
|
actions: [],
|
64
|
-
|
65
|
-
insight: {
|
37
|
+
description: "Indexed data for any EVM chain",
|
66
38
|
name: "insight",
|
67
39
|
title: "Insight",
|
68
|
-
description: "Indexed data for any EVM chain",
|
69
|
-
// all actions allowed
|
70
|
-
actions: [],
|
71
40
|
},
|
72
41
|
nebula: {
|
42
|
+
// all actions allowed
|
43
|
+
actions: [],
|
44
|
+
description: "Advanced blockchain reasoning and execution capabilities with AI",
|
73
45
|
name: "nebula",
|
74
46
|
title: "Nebula",
|
75
|
-
|
47
|
+
},
|
48
|
+
pay: {
|
76
49
|
// all actions allowed
|
77
50
|
actions: [],
|
51
|
+
description: "Bridge, swap, and purchase cryptocurrencies and execute transactions with any fiat or tokens via cross-chain routing",
|
52
|
+
name: "pay",
|
53
|
+
title: "Universal Bridge",
|
78
54
|
},
|
79
|
-
|
80
|
-
name: "engineCloud",
|
81
|
-
title: "Engine Cloud",
|
82
|
-
description: "Transaction API and Server wallets with high transaction throughput and low latency",
|
55
|
+
relayer: {
|
83
56
|
// all actions allowed
|
84
57
|
actions: [],
|
58
|
+
description: "Enable gasless transactions",
|
59
|
+
name: "relayer",
|
60
|
+
title: "Gasless Relayer",
|
61
|
+
},
|
62
|
+
rpc: {
|
63
|
+
// all actions allowed
|
64
|
+
actions: [],
|
65
|
+
description: "Accelerated RPC Edge",
|
66
|
+
name: "rpc",
|
67
|
+
title: "RPC",
|
68
|
+
},
|
69
|
+
storage: {
|
70
|
+
actions: [
|
71
|
+
{
|
72
|
+
description: "Download a file from Storage",
|
73
|
+
name: "read",
|
74
|
+
title: "Download",
|
75
|
+
},
|
76
|
+
{
|
77
|
+
description: "Upload a file to Storage",
|
78
|
+
name: "write",
|
79
|
+
title: "Upload",
|
80
|
+
},
|
81
|
+
],
|
82
|
+
description: "IPFS Upload and Download",
|
83
|
+
name: "storage",
|
84
|
+
title: "Storage",
|
85
85
|
},
|
86
86
|
};
|
87
87
|
exports.SERVICE_NAMES = Object.keys(exports.SERVICE_DEFINITIONS);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"services.js","sourceRoot":"","sources":["../../../src/core/services.ts"],"names":[],"mappings":";;;
|
1
|
+
{"version":3,"file":"services.js","sourceRoot":"","sources":["../../../src/core/services.ts"],"names":[],"mappings":";;;AAwGA,4CAEC;AA1GY,QAAA,mBAAmB,GAAG;IACjC,OAAO,EAAE;QACP,sBAAsB;QACtB,OAAO,EAAE,EAAE;QACX,WAAW,EAAE,8BAA8B;QAC3C,IAAI,EAAE,SAAS;QACf,KAAK,EAAE,qBAAqB;KAC7B;IACD,QAAQ,EAAE;QACR,sBAAsB;QACtB,OAAO,EAAE,EAAE;QACX,WAAW,EAAE,gCAAgC;QAC7C,IAAI,EAAE,UAAU;QAChB,KAAK,EAAE,UAAU;KAClB;IACD,eAAe,EAAE;QACf,sBAAsB;QACtB,OAAO,EAAE,EAAE;QACX,WAAW,EAAE,0DAA0D;QACvE,IAAI,EAAE,iBAAiB;QACvB,KAAK,EAAE,SAAS;KACjB;IAED,WAAW,EAAE;QACX,sBAAsB;QACtB,OAAO,EAAE,EAAE;QACX,WAAW,EACT,qFAAqF;QACvF,IAAI,EAAE,aAAa;QACnB,KAAK,EAAE,c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core/usage.js
CHANGED
@@ -2,51 +2,39 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.usageEventSchema = void 0;
|
4
4
|
const zod_1 = require("zod");
|
5
|
+
/** @deprecated - Use UsageV2Event instead */
|
5
6
|
exports.usageEventSchema = zod_1.z.object({
|
6
|
-
source: zod_1.z.string(),
|
7
|
-
action: zod_1.z.string(),
|
8
7
|
/**
|
9
8
|
* The following fields are optional.
|
10
9
|
*/
|
11
10
|
accountId: zod_1.z.string().optional(),
|
12
|
-
|
11
|
+
action: zod_1.z.string(),
|
12
|
+
amountUSDCents: zod_1.z.number().nonnegative().optional(),
|
13
|
+
amountWei: zod_1.z.string().optional(),
|
13
14
|
apiKeyId: zod_1.z.string().optional(),
|
14
|
-
|
15
|
-
clientId: zod_1.z.string().optional(),
|
16
|
-
walletAddress: zod_1.z.string().optional(),
|
17
|
-
walletType: zod_1.z.string().optional(),
|
15
|
+
authenticationMethod: zod_1.z.string().optional(),
|
18
16
|
chainId: zod_1.z.number().int().positive().optional(),
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
fileCid: zod_1.z.string().optional(),
|
23
|
-
evmMethod: zod_1.z.string().optional(),
|
24
|
-
userOpHash: zod_1.z.string().optional(),
|
25
|
-
gasLimit: zod_1.z.number().nonnegative().optional(),
|
26
|
-
gasPricePerUnit: zod_1.z.string().optional(),
|
27
|
-
transactionFeeUsd: zod_1.z.number().optional(),
|
28
|
-
transactionHash: zod_1.z.string().optional(),
|
29
|
-
sdkName: zod_1.z.string().optional(),
|
30
|
-
sdkVersion: zod_1.z.string().optional(),
|
31
|
-
sdkPlatform: zod_1.z.string().optional(),
|
32
|
-
sdkOS: zod_1.z.string().optional(),
|
33
|
-
productName: zod_1.z.string().optional(),
|
34
|
-
transactionValue: zod_1.z.string().optional(),
|
35
|
-
pathname: zod_1.z.string().optional(),
|
17
|
+
chainName: zod_1.z.string().optional(),
|
18
|
+
clientId: zod_1.z.string().optional(),
|
19
|
+
completionTokens: zod_1.z.number().int().nonnegative().optional(),
|
36
20
|
contractAddress: zod_1.z.string().optional(),
|
21
|
+
creatorWalletAddress: zod_1.z.string().optional(),
|
22
|
+
dstChainId: zod_1.z.number().optional(),
|
23
|
+
dstChainName: zod_1.z.string().optional(),
|
24
|
+
dstTokenAddress: zod_1.z.string().optional(),
|
25
|
+
dstTokenSymbol: zod_1.z.string().optional(),
|
26
|
+
// Used to identify the ecosystem that the an ecosystem wallet belongs too
|
27
|
+
ecosystemId: zod_1.z.string().optional(),
|
28
|
+
ecosystemPartnerId: zod_1.z.string().optional(),
|
37
29
|
errorCode: zod_1.z.string().optional(),
|
38
|
-
|
39
|
-
|
30
|
+
evmMethod: zod_1.z.string().optional(),
|
31
|
+
evmRequestParams: zod_1.z.string().optional(),
|
40
32
|
extension: zod_1.z.string().optional(),
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
swapId: zod_1.z.string().optional(),
|
47
|
-
tokenAddress: zod_1.z.string().optional(),
|
48
|
-
amountWei: zod_1.z.string().optional(),
|
49
|
-
amountUSDCents: zod_1.z.number().nonnegative().optional(),
|
33
|
+
fileCid: zod_1.z.string().optional(),
|
34
|
+
fileSize: zod_1.z.number().int().nonnegative().optional(),
|
35
|
+
functionName: zod_1.z.string().optional(),
|
36
|
+
gasLimit: zod_1.z.number().nonnegative().optional(),
|
37
|
+
gasPricePerUnit: zod_1.z.string().optional(),
|
50
38
|
httpMethod: zod_1.z
|
51
39
|
.enum([
|
52
40
|
"GET",
|
@@ -60,26 +48,39 @@ exports.usageEventSchema = zod_1.z.object({
|
|
60
48
|
"TRACE",
|
61
49
|
])
|
62
50
|
.optional(),
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
chainName: zod_1.z.string().optional(),
|
68
|
-
tokenSymbol: zod_1.z.string().optional(),
|
69
|
-
dstChainId: zod_1.z.number().optional(),
|
70
|
-
dstTokenAddress: zod_1.z.string().optional(),
|
71
|
-
dstChainName: zod_1.z.string().optional(),
|
72
|
-
dstTokenSymbol: zod_1.z.string().optional(),
|
51
|
+
httpStatusCode: zod_1.z.number().int().nonnegative().optional(),
|
52
|
+
isClientEvent: zod_1.z.boolean().optional(),
|
53
|
+
mimeType: zod_1.z.string().optional(),
|
54
|
+
modelName: zod_1.z.string().optional(),
|
73
55
|
msLatency: zod_1.z.number().optional(),
|
74
|
-
|
75
|
-
|
56
|
+
msSinceQueue: zod_1.z.number().nonnegative().optional(),
|
57
|
+
msSinceSend: zod_1.z.number().nonnegative().optional(),
|
58
|
+
msTotalDuration: zod_1.z.number().nonnegative().optional(),
|
76
59
|
onRampId: zod_1.z.string().optional(),
|
77
|
-
|
78
|
-
|
60
|
+
pathname: zod_1.z.string().optional(),
|
61
|
+
policyId: zod_1.z.string().optional(),
|
62
|
+
productName: zod_1.z.string().optional(),
|
79
63
|
promptTokens: zod_1.z.number().int().nonnegative().optional(),
|
80
|
-
|
81
|
-
|
82
|
-
sessionId: zod_1.z.string().optional(),
|
64
|
+
provider: zod_1.z.string().optional(),
|
65
|
+
providerIp: zod_1.z.string().optional(),
|
83
66
|
requestId: zod_1.z.string().optional(),
|
67
|
+
retryCount: zod_1.z.number().int().nonnegative().optional(),
|
68
|
+
sdkName: zod_1.z.string().optional(),
|
69
|
+
sdkOS: zod_1.z.string().optional(),
|
70
|
+
sdkPlatform: zod_1.z.string().optional(),
|
71
|
+
sdkVersion: zod_1.z.string().optional(),
|
72
|
+
secondaryProvider: zod_1.z.string().optional(),
|
73
|
+
sessionId: zod_1.z.string().optional(),
|
74
|
+
source: zod_1.z.string(),
|
75
|
+
swapId: zod_1.z.string().optional(),
|
76
|
+
toAmountUSDCents: zod_1.z.number().optional(),
|
77
|
+
tokenAddress: zod_1.z.string().optional(),
|
78
|
+
tokenSymbol: zod_1.z.string().optional(),
|
79
|
+
transactionFeeUsd: zod_1.z.number().optional(),
|
80
|
+
transactionHash: zod_1.z.string().optional(),
|
81
|
+
transactionValue: zod_1.z.string().optional(),
|
82
|
+
userOpHash: zod_1.z.string().optional(),
|
83
|
+
walletAddress: zod_1.z.string().optional(),
|
84
|
+
walletType: zod_1.z.string().optional(),
|
84
85
|
});
|
85
86
|
//# sourceMappingURL=usage.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"usage.js","sourceRoot":"","sources":["../../../src/core/usage.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;
|
1
|
+
{"version":3,"file":"usage.js","sourceRoot":"","sources":["../../../src/core/usage.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAExB,6CAA6C;AAChC,QAAA,gBAAgB,GAAG,OAAC,CAAC,MAAM,CAAC;IACvC;;OAEG;IAEH,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAChC,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE;IAClB,cAAc,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,WAAW,EAAE,CAAC,QAAQ,EAAE;IACnD,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAChC,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC/B,oBAAoB,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC3C,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;IAC/C,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAChC,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC/B,gBAAgB,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE,CAAC,QAAQ,EAAE;IAC3D,eAAe,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACtC,oBAAoB,EAAE,OAAC,CAAC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AC,QAAQ,EAAE;IAC9B,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC5B,WAAW,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAClC,UAAU,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACjC,iBAAiB,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACxC,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAChC,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE;IAClB,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC7B,gBAAgB,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACvC,YAAY,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACnC,WAAW,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAClC,iBAAiB,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACxC,eAAe,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACtC,gBAAgB,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACvC,UAAU,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACjC,aAAa,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACpC,UAAU,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAClC,CAAC,CAAC"}
|
package/dist/cjs/index.js
CHANGED
@@ -1,16 +1,16 @@
|
|
1
1
|
"use strict";
|
2
|
+
// Exports the public service definitions.
|
2
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.
|
4
|
+
exports.rateLimitSlidingWindow = exports.rateLimit = exports.authorizeDomain = exports.authorizeBundleId = exports.fetchTeamAndProject = void 0;
|
4
5
|
const tslib_1 = require("tslib");
|
5
|
-
// Exports the public service definitions.
|
6
|
-
tslib_1.__exportStar(require("./core/services.js"), exports);
|
7
6
|
var api_js_1 = require("./core/api.js");
|
8
7
|
Object.defineProperty(exports, "fetchTeamAndProject", { enumerable: true, get: function () { return api_js_1.fetchTeamAndProject; } });
|
9
8
|
var client_js_1 = require("./core/authorize/client.js");
|
10
9
|
Object.defineProperty(exports, "authorizeBundleId", { enumerable: true, get: function () { return client_js_1.authorizeBundleId; } });
|
11
10
|
Object.defineProperty(exports, "authorizeDomain", { enumerable: true, get: function () { return client_js_1.authorizeDomain; } });
|
12
|
-
var sliding_window_js_1 = require("./core/rateLimit/strategies/sliding-window.js");
|
13
|
-
Object.defineProperty(exports, "rateLimitSlidingWindow", { enumerable: true, get: function () { return sliding_window_js_1.rateLimitSlidingWindow; } });
|
14
11
|
var index_js_1 = require("./core/rateLimit/index.js");
|
15
12
|
Object.defineProperty(exports, "rateLimit", { enumerable: true, get: function () { return index_js_1.rateLimit; } });
|
13
|
+
var sliding_window_js_1 = require("./core/rateLimit/strategies/sliding-window.js");
|
14
|
+
Object.defineProperty(exports, "rateLimitSlidingWindow", { enumerable: true, get: function () { return sliding_window_js_1.rateLimitSlidingWindow; } });
|
15
|
+
tslib_1.__exportStar(require("./core/services.js"), exports);
|
16
16
|
//# sourceMappingURL=index.js.map
|
package/dist/cjs/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA,0CAA0C;;;;AAe1C,wCAAoD;AAA3C,6GAAA,mBAAmB,OAAA;AAC5B,wDAAgF;AAAvE,8GAAA,iBAAiB,OAAA;AAAE,4GAAA,eAAe,OAAA;AAC3C,sDAAsD;AAA7C,qGAAA,SAAS,OAAA;AAElB,mFAAuF;AAA9E,2HAAA,sBAAsB,OAAA;AAC/B,6DAAmC"}
|
package/dist/cjs/mocks.js
CHANGED
@@ -2,90 +2,57 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.validBundlerServiceConfig = exports.validServiceConfig = exports.validTeamAndProjectResponse = exports.validTeamResponse = exports.validProjectResponse = void 0;
|
4
4
|
exports.validProjectResponse = {
|
5
|
+
bundleIds: [],
|
6
|
+
createdAt: new Date("2024-06-01").toISOString(),
|
7
|
+
domains: ["example.com", "*.example.com"],
|
5
8
|
id: "1",
|
9
|
+
image: "https://example.com/image.png",
|
10
|
+
lastAccessedAt: new Date("2024-06-01").toISOString(),
|
11
|
+
name: "test-project",
|
6
12
|
publishableKey: "your-api-key",
|
7
|
-
|
8
|
-
|
9
|
-
|
13
|
+
secretKeys: [
|
14
|
+
{
|
15
|
+
createdAt: new Date("2024-06-01").toISOString(),
|
16
|
+
hash: "1234567890123456789012345678901234567890123456789012345678901234",
|
17
|
+
masked: "foo...lorem",
|
18
|
+
updatedAt: new Date("2024-06-01").toISOString(),
|
19
|
+
},
|
20
|
+
],
|
10
21
|
services: [
|
11
22
|
{
|
12
|
-
name: "storage",
|
13
23
|
actions: ["read", "write"],
|
24
|
+
name: "storage",
|
14
25
|
},
|
15
26
|
{
|
16
|
-
name: "rpc",
|
17
27
|
actions: [],
|
28
|
+
name: "rpc",
|
18
29
|
},
|
19
30
|
{
|
20
|
-
name: "bundler",
|
21
31
|
actions: [],
|
22
32
|
allowedChainIds: [1, 2, 3],
|
33
|
+
name: "bundler",
|
23
34
|
},
|
24
35
|
],
|
36
|
+
slug: "test-project",
|
25
37
|
teamId: "1",
|
26
|
-
createdAt: new Date("2024-06-01").toISOString(),
|
27
38
|
updatedAt: new Date("2024-06-01").toISOString(),
|
28
|
-
|
29
|
-
name: "test-project",
|
30
|
-
slug: "test-project",
|
31
|
-
image: "https://example.com/image.png",
|
32
|
-
secretKeys: [
|
33
|
-
{
|
34
|
-
hash: "1234567890123456789012345678901234567890123456789012345678901234",
|
35
|
-
masked: "foo...lorem",
|
36
|
-
createdAt: new Date("2024-06-01").toISOString(),
|
37
|
-
updatedAt: new Date("2024-06-01").toISOString(),
|
38
|
-
},
|
39
|
-
],
|
39
|
+
walletAddresses: ["creator-address"],
|
40
40
|
};
|
41
41
|
exports.validTeamResponse = {
|
42
|
-
id: "1",
|
43
|
-
name: "test-team",
|
44
|
-
slug: "test-team",
|
45
|
-
image: "https://example.com/image.png",
|
46
|
-
createdAt: new Date("2024-06-01").toISOString(),
|
47
|
-
updatedAt: new Date("2024-06-01").toISOString(),
|
48
|
-
billingPlan: "free",
|
49
|
-
supportPlan: "free",
|
50
42
|
billingEmail: "test@example.com",
|
43
|
+
billingPlan: "free",
|
51
44
|
billingStatus: "noPayment",
|
52
45
|
canCreatePublicChains: false,
|
53
|
-
enabledScopes: ["storage", "rpc", "bundler"],
|
54
|
-
isOnboarded: true,
|
55
|
-
verifiedDomain: null,
|
56
46
|
capabilities: {
|
57
|
-
rpc: {
|
58
|
-
enabled: true,
|
59
|
-
rateLimit: 1000,
|
60
|
-
},
|
61
|
-
insight: {
|
62
|
-
enabled: true,
|
63
|
-
rateLimit: 1000,
|
64
|
-
webhooks: true,
|
65
|
-
},
|
66
|
-
storage: {
|
67
|
-
enabled: true,
|
68
|
-
download: {
|
69
|
-
rateLimit: 1000,
|
70
|
-
},
|
71
|
-
upload: {
|
72
|
-
totalFileSizeBytesLimit: 1_000_000_000,
|
73
|
-
rateLimit: 1000,
|
74
|
-
},
|
75
|
-
},
|
76
|
-
nebula: {
|
77
|
-
enabled: true,
|
78
|
-
rateLimit: 1000,
|
79
|
-
},
|
80
47
|
bundler: {
|
81
48
|
enabled: true,
|
82
49
|
mainnetEnabled: true,
|
83
50
|
rateLimit: 1000,
|
84
51
|
},
|
85
52
|
embeddedWallets: {
|
86
|
-
enabled: true,
|
87
53
|
customAuth: true,
|
88
54
|
customBranding: true,
|
55
|
+
enabled: true,
|
89
56
|
sms: {
|
90
57
|
domestic: true,
|
91
58
|
international: true,
|
@@ -96,6 +63,15 @@ exports.validTeamResponse = {
|
|
96
63
|
mainnetEnabled: true,
|
97
64
|
rateLimit: 100,
|
98
65
|
},
|
66
|
+
insight: {
|
67
|
+
enabled: true,
|
68
|
+
rateLimit: 1000,
|
69
|
+
webhooks: true,
|
70
|
+
},
|
71
|
+
nebula: {
|
72
|
+
enabled: true,
|
73
|
+
rateLimit: 1000,
|
74
|
+
},
|
99
75
|
pay: {
|
100
76
|
enabled: true,
|
101
77
|
rateLimit: 1000,
|
@@ -105,24 +81,49 @@ exports.validTeamResponse = {
|
|
105
81
|
ecosystemWallets: true,
|
106
82
|
seats: true,
|
107
83
|
},
|
84
|
+
rpc: {
|
85
|
+
enabled: true,
|
86
|
+
rateLimit: 1000,
|
87
|
+
},
|
88
|
+
storage: {
|
89
|
+
download: {
|
90
|
+
rateLimit: 1000,
|
91
|
+
},
|
92
|
+
enabled: true,
|
93
|
+
upload: {
|
94
|
+
rateLimit: 1000,
|
95
|
+
totalFileSizeBytesLimit: 1_000_000_000,
|
96
|
+
},
|
97
|
+
},
|
108
98
|
},
|
99
|
+
createdAt: new Date("2024-06-01").toISOString(),
|
100
|
+
dedicatedSupportChannel: null,
|
101
|
+
enabledScopes: ["storage", "rpc", "bundler"],
|
102
|
+
id: "1",
|
103
|
+
image: "https://example.com/image.png",
|
104
|
+
isOnboarded: true,
|
105
|
+
name: "test-team",
|
109
106
|
planCancellationDate: null,
|
107
|
+
slug: "test-team",
|
108
|
+
supportPlan: "free",
|
110
109
|
unthreadCustomerId: null,
|
110
|
+
updatedAt: new Date("2024-06-01").toISOString(),
|
111
|
+
verifiedDomain: null,
|
111
112
|
};
|
112
113
|
exports.validTeamAndProjectResponse = {
|
113
|
-
team: exports.validTeamResponse,
|
114
|
-
project: exports.validProjectResponse,
|
115
114
|
authMethod: "publishableKey",
|
115
|
+
project: exports.validProjectResponse,
|
116
|
+
team: exports.validTeamResponse,
|
116
117
|
};
|
117
118
|
exports.validServiceConfig = {
|
118
119
|
apiUrl: "https://api.example.com",
|
119
|
-
serviceScope: "storage",
|
120
|
-
serviceApiKey: "service-api-key",
|
121
120
|
serviceAction: "read",
|
121
|
+
serviceApiKey: "service-api-key",
|
122
|
+
serviceScope: "storage",
|
122
123
|
};
|
123
124
|
exports.validBundlerServiceConfig = {
|
124
125
|
apiUrl: "https://api.example.com",
|
125
|
-
serviceScope: "bundler",
|
126
126
|
serviceApiKey: "service-api-key",
|
127
|
+
serviceScope: "bundler",
|
127
128
|
};
|
128
129
|
//# sourceMappingURL=mocks.js.map
|
package/dist/cjs/mocks.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"mocks.js","sourceRoot":"","sources":["../../src/mocks.ts"],"names":[],"mappings":";;;AAOa,QAAA,oBAAoB,GAAoB;IACnD,EAAE,EAAE
|
1
|
+
{"version":3,"file":"mocks.js","sourceRoot":"","sources":["../../src/mocks.ts"],"names":[],"mappings":";;;AAOa,QAAA,oBAAoB,GAAoB;IACnD,SAAS,EAAE,EAAE;IACb,SAAS,EAAE,IAAI,IAAI,CAAC,YAAY,CAAC,CAAC,WAAW,EAAE;IAC/C,OAAO,EAAE,CAAC,aAAa,EAAE,eAAe,CAAC;IACzC,EAAE,EAAE,GAAG;IACP,KAAK,EAAE,+BAA+B;IACtC,cAAc,EAAE,IAAI,IAAI,CAAC,YAAY,CAAC,CAAC,WAAW,EAAE;IACpD,IAAI,EAAE,cAAc;IACpB,cAAc,EAAE,cAAc;IAC9B,UAAU,EAAE;QACV;YACE,SAAS,EAAE,IAAI,IAAI,CAAC,YAAY,CAAC,CAAC,WAAW,EAAE;YAC/C,IAAI,EAAE,kEAAkE;YACxE,MAAM,EAAE,aAAa;YACrB,SAAS,EAAE,IAAI,IAAI,CAAC,YAAY,CAAC,CAAC,WAAW,EAAE;SAChD;KACF;IACD,QAAQ,EAAE;QACR;YACE,OAAO,EAAE,CAAC,MAAM,EAAE,OAAO,C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EAAE,IAAI;YACb,SAAS,EAAE,IAAI;SAChB;QACD,OAAO,EAAE;YACP,QAAQ,EAAE;gBACR,SAAS,EAAE,IAAI;aAChB;YACD,OAAO,EAAE,IAAI;YACb,MAAM,EAAE;gBACN,SAAS,EAAE,IAAI;gBACf,uBAAuB,EAAE,aAAa;aACvC;SACF;KACF;IACD,SAAS,EAAE,IAAI,IAAI,CAAC,YAAY,CAAC,CAAC,WAAW,EAAE;IAC/C,uBAAuB,EAAE,IAAI;IAC7B,aAAa,EAAE,CAAC,SAAS,EAAE,KAAK,EAAE,SAAS,CAAC;IAC5C,EAAE,EAAE,GAAG;IACP,KAAK,EAAE,+BAA+B;IACtC,WAAW,EAAE,IAAI;IACjB,IAAI,EAAE,WAAW;IACjB,oBAAoB,EAAE,IAAI;IAC1B,IAAI,EAAE,WAAW;IACjB,WAAW,EAAE,MAAM;IACnB,kBAAkB,EAAE,IAAI;IACxB,SAAS,EAAE,IAAI,IAAI,CAAC,YAAY,CAAC,CAAC,WAAW,EAAE;IAC/C,cAAc,EAAE,IAAI;CACrB,CAAC;AAEW,QAAA,2BAA2B,GAA2B;IACjE,UAAU,EAAE,gBAAgB;IAC5B,OAAO,EAAE,4BAAoB;IAC7B,IAAI,EAAE,yBAAiB;CACxB,CAAC;AAEW,QAAA,kBAAkB,GAAsB;IACnD,MAAM,EAAE,yBAAyB;IACjC,aAAa,EAAE,MAAM;IACrB,aAAa,EAAE,iBAAiB;IAChC,YAAY,EAAE,SAAS;CACxB,CAAC;AAEW,QAAA,yBAAyB,GAAsB;IAC1D,MAAM,EAAE,yBAAyB;IACjC,aAAa,EAAE,iBAAiB;IAChC,YAAY,EAAE,SAAS;CACxB,CAAC"}
|
package/dist/cjs/node/index.js
CHANGED
@@ -7,12 +7,12 @@ exports.logHttpRequest = logHttpRequest;
|
|
7
7
|
const tslib_1 = require("tslib");
|
8
8
|
const node_crypto_1 = require("node:crypto");
|
9
9
|
const index_js_1 = require("../core/authorize/index.js");
|
10
|
-
tslib_1.__exportStar(require("./kafka.js"), exports);
|
11
|
-
tslib_1.__exportStar(require("./usageV2.js"), exports);
|
12
|
-
tslib_1.__exportStar(require("../core/usage.js"), exports);
|
13
|
-
tslib_1.__exportStar(require("../core/usageV2.js"), exports);
|
14
10
|
tslib_1.__exportStar(require("../core/rateLimit/index.js"), exports);
|
15
11
|
tslib_1.__exportStar(require("../core/services.js"), exports);
|
12
|
+
tslib_1.__exportStar(require("../core/usage.js"), exports);
|
13
|
+
tslib_1.__exportStar(require("../core/usageV2.js"), exports);
|
14
|
+
tslib_1.__exportStar(require("./kafka.js"), exports);
|
15
|
+
tslib_1.__exportStar(require("./usageV2.js"), exports);
|
16
16
|
async function authorizeNode(authInput, serviceConfig, cacheOptions) {
|
17
17
|
let authData;
|
18
18
|
try {
|
@@ -22,16 +22,16 @@ async function authorizeNode(authInput, serviceConfig, cacheOptions) {
|
|
22
22
|
if (e instanceof Error && e.message === "KEY_CONFLICT") {
|
23
23
|
return {
|
24
24
|
authorized: false,
|
25
|
-
status: 400,
|
26
|
-
errorMessage: "Please pass either a client id or a secret key.",
|
27
25
|
errorCode: "KEY_CONFLICT",
|
26
|
+
errorMessage: "Please pass either a client id or a secret key.",
|
27
|
+
status: 400,
|
28
28
|
};
|
29
29
|
}
|
30
30
|
return {
|
31
31
|
authorized: false,
|
32
|
-
status: 500,
|
33
|
-
errorMessage: "Internal Server Error",
|
34
32
|
errorCode: "INTERNAL_SERVER_ERROR",
|
33
|
+
errorMessage: "Internal Server Error",
|
34
|
+
status: 500,
|
35
35
|
};
|
36
36
|
}
|
37
37
|
return await (0, index_js_1.authorize)(authData, serviceConfig, cacheOptions);
|
@@ -123,17 +123,17 @@ function extractAuthorizationData(authInput) {
|
|
123
123
|
teamId = getHeader(headers, "x-team-id");
|
124
124
|
}
|
125
125
|
return {
|
126
|
-
|
127
|
-
incomingServiceApiKeyHash,
|
128
|
-
jwt,
|
129
|
-
hashedJWT: jwt ? hashSecretKey(jwt) : null,
|
130
|
-
secretKeyHash,
|
131
|
-
secretKey,
|
126
|
+
bundleId,
|
132
127
|
clientId,
|
133
128
|
ecosystemId,
|
134
129
|
ecosystemPartnerId,
|
130
|
+
hashedJWT: jwt ? hashSecretKey(jwt) : null,
|
131
|
+
incomingServiceApiKey,
|
132
|
+
incomingServiceApiKeyHash,
|
133
|
+
jwt,
|
135
134
|
origin,
|
136
|
-
|
135
|
+
secretKey,
|
136
|
+
secretKeyHash,
|
137
137
|
targetAddress: authInput.targetAddress,
|
138
138
|
teamId: authInput.teamId ?? teamId ?? undefined,
|
139
139
|
useWalletAuth,
|
@@ -144,23 +144,23 @@ function hashSecretKey(secretKey) {
|
|
144
144
|
}
|
145
145
|
function logHttpRequest({ clientId, req, res, isAuthed, statusMessage, latencyMs, }) {
|
146
146
|
try {
|
147
|
-
const authorizationData = extractAuthorizationData({
|
147
|
+
const authorizationData = extractAuthorizationData({ clientId, req });
|
148
148
|
const headers = req.headers;
|
149
149
|
console.log(JSON.stringify({
|
150
|
-
|
151
|
-
pathname: req.url,
|
152
|
-
hasSecretKey: !!authorizationData.secretKey,
|
150
|
+
clientId: authorizationData.clientId,
|
153
151
|
hasClientId: !!authorizationData.clientId,
|
154
152
|
hasJwt: !!authorizationData.jwt,
|
155
|
-
|
153
|
+
hasSecretKey: !!authorizationData.secretKey,
|
156
154
|
isAuthed,
|
157
|
-
|
158
|
-
|
155
|
+
latencyMs,
|
156
|
+
method: req.method,
|
157
|
+
os: getHeader(headers, "x-sdk-os"),
|
158
|
+
pathname: req.url,
|
159
|
+
platform: getHeader(headers, "x-sdk-platform"),
|
159
160
|
sdkName: getHeader(headers, "x-sdk-name"),
|
160
161
|
sdkVersion: getHeader(headers, "x-sdk-version"),
|
161
|
-
|
162
|
-
|
163
|
-
latencyMs,
|
162
|
+
status: res.statusCode,
|
163
|
+
statusMessage,
|
164
164
|
}));
|
165
165
|
}
|
166
166
|
catch { }
|