@thirdweb-dev/service-utils 0.4.30 → 0.4.31-nightly-73af67aad1f0b3f8d93ad6b38975770e8aed6208-20240608032553
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/cf-worker/dist/thirdweb-dev-service-utils-cf-worker.cjs.dev.js +6 -6
- package/cf-worker/dist/thirdweb-dev-service-utils-cf-worker.cjs.prod.js +6 -6
- package/cf-worker/dist/thirdweb-dev-service-utils-cf-worker.esm.js +3 -3
- package/dist/client-43ffd386.cjs.prod.js +203 -0
- package/dist/client-8a85ab05.esm.js +195 -0
- package/dist/client-e805236b.cjs.dev.js +203 -0
- package/dist/declarations/src/core/authorize/client.d.ts +8 -0
- package/dist/declarations/src/core/authorize/client.d.ts.map +1 -1
- package/dist/declarations/src/index.d.ts +1 -0
- package/dist/declarations/src/index.d.ts.map +1 -1
- package/dist/declarations/src/node/index.d.ts +2 -3
- package/dist/declarations/src/node/index.d.ts.map +1 -1
- package/dist/{index-1fdaaa60.cjs.dev.js → index-0d9dbeb2.cjs.dev.js} +3 -111
- package/dist/{index-1216f784.esm.js → index-8cff5ac3.esm.js} +2 -110
- package/dist/{index-9b21f405.cjs.prod.js → index-fecf7702.cjs.prod.js} +3 -111
- package/dist/thirdweb-dev-service-utils.cjs.dev.js +7 -5
- package/dist/thirdweb-dev-service-utils.cjs.prod.js +7 -5
- package/dist/thirdweb-dev-service-utils.esm.js +1 -1
- package/node/dist/thirdweb-dev-service-utils-node.cjs.dev.js +6 -6
- package/node/dist/thirdweb-dev-service-utils-node.cjs.prod.js +6 -6
- package/node/dist/thirdweb-dev-service-utils-node.esm.js +3 -3
- package/package.json +1 -1
- package/dist/services-5ebf68d5.esm.js +0 -65
- package/dist/services-628562db.cjs.prod.js +0 -70
- package/dist/services-97e0f9a0.cjs.dev.js +0 -70
@@ -1,12 +1,11 @@
|
|
1
1
|
/// <reference types="node" />
|
2
|
-
import type { ServerResponse } from "node:http";
|
3
|
-
import type { IncomingMessage } from "node:http";
|
2
|
+
import type { IncomingMessage, ServerResponse } from "node:http";
|
4
3
|
import type { CoreServiceConfig } from "../core/api";
|
5
4
|
import type { AuthorizationInput } from "../core/authorize";
|
6
5
|
import type { AuthorizationResult } from "../core/authorize/types";
|
7
6
|
import type { CoreAuthInput } from "../core/types";
|
8
|
-
export * from "../core/services";
|
9
7
|
export * from "../core/rateLimit";
|
8
|
+
export * from "../core/services";
|
10
9
|
export * from "../core/usageLimit";
|
11
10
|
type NodeServiceConfig = CoreServiceConfig;
|
12
11
|
export type AuthInput = CoreAuthInput & {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"../../../../src/node","sources":["index.ts"],"names":[],"mappings":";AAGA,OAAO,KAAK,
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"../../../../src/node","sources":["index.ts"],"names":[],"mappings":";AAGA,OAAO,KAAK,EAEV,eAAe,EACf,cAAc,EACf,MAAM,WAAW,CAAC;AACnB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AACnE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAEnD,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,KAAK,iBAAiB,GAAG,iBAAiB,CAAC;AAE3C,MAAM,MAAM,SAAS,GAAG,aAAa,GAAG;IACtC,GAAG,EAAE,eAAe,CAAC;CACtB,CAAC;AAEF;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAsB,aAAa,CACjC,SAAS,EAAE,SAAS,EACpB,aAAa,EAAE,iBAAiB,GAC/B,OAAO,CAAC,mBAAmB,CAAC,CAsB9B;AAaD,wBAAgB,wBAAwB,CACtC,SAAS,EAAE,SAAS,GACnB,kBAAkB,CA2FpB;AAED,wBAAgB,aAAa,CAAC,SAAS,EAAE,MAAM,UAE9C;AAED,wBAAgB,+BAA+B,CAAC,aAAa,EAAE,MAAM,UAEpE;AAED,wBAAgB,cAAc,CAAC,EAC7B,QAAQ,EACR,GAAG,EACH,GAAG,EACH,QAAQ,EACR,aAAa,EACb,SAAS,GACV,EAAE,SAAS,GAAG;IAEb,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,cAAc,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,aAAa,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC;IAC/B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,QAwBA"}
|
@@ -1,5 +1,7 @@
|
|
1
1
|
'use strict';
|
2
2
|
|
3
|
+
var client = require('./client-e805236b.cjs.dev.js');
|
4
|
+
|
3
5
|
async function fetchKeyMetadataFromApi(clientId, config) {
|
4
6
|
const {
|
5
7
|
apiUrl,
|
@@ -67,116 +69,6 @@ async function updateRateLimitedAt(apiKeyId, config) {
|
|
67
69
|
});
|
68
70
|
}
|
69
71
|
|
70
|
-
function authorizeClient(authOptions, apiKeyMeta) {
|
71
|
-
const {
|
72
|
-
origin,
|
73
|
-
bundleId,
|
74
|
-
secretKeyHash: providedSecretHash
|
75
|
-
} = authOptions;
|
76
|
-
const {
|
77
|
-
domains,
|
78
|
-
bundleIds,
|
79
|
-
secretHash
|
80
|
-
} = apiKeyMeta;
|
81
|
-
const authResult = {
|
82
|
-
authorized: true,
|
83
|
-
apiKeyMeta,
|
84
|
-
accountMeta: {
|
85
|
-
id: apiKeyMeta.accountId,
|
86
|
-
// TODO update this later
|
87
|
-
name: "",
|
88
|
-
creatorWalletAddress: apiKeyMeta.creatorWalletAddress,
|
89
|
-
limits: apiKeyMeta.limits,
|
90
|
-
rateLimits: apiKeyMeta.rateLimits,
|
91
|
-
usage: apiKeyMeta.usage
|
92
|
-
}
|
93
|
-
};
|
94
|
-
|
95
|
-
// check for public restrictions
|
96
|
-
if (domains.includes("*")) {
|
97
|
-
return authResult;
|
98
|
-
}
|
99
|
-
|
100
|
-
// check for secretHash
|
101
|
-
if (providedSecretHash) {
|
102
|
-
if (secretHash !== providedSecretHash) {
|
103
|
-
return {
|
104
|
-
authorized: false,
|
105
|
-
errorMessage: "Incorrect key provided. You can view your active API keys at https://thirdweb.com/dashboard/settings",
|
106
|
-
errorCode: "SECRET_INVALID",
|
107
|
-
status: 401
|
108
|
-
};
|
109
|
-
}
|
110
|
-
return authResult;
|
111
|
-
}
|
112
|
-
|
113
|
-
// validate domains
|
114
|
-
if (origin) {
|
115
|
-
if (
|
116
|
-
// find matching domain, or if all domains allowed
|
117
|
-
// embedded-wallet.thirdweb(-dev).com is automatically allowed
|
118
|
-
// because the rpc is passed from user's domain to embedded-wallet.thirdweb.com iframe for use.
|
119
|
-
// Note this doesn't allow embedded-wallets from being used if it's disabled. The service check that runs after enforces that.
|
120
|
-
[...domains, "embedded-wallet.thirdweb.com", "embedded-wallet.thirdweb-dev.com"].find(d => {
|
121
|
-
// if any domain is allowed, we'll return true
|
122
|
-
if (d === "*") {
|
123
|
-
return true;
|
124
|
-
}
|
125
|
-
|
126
|
-
// special rule for `localhost`
|
127
|
-
// if the domain is localhost, we'll allow any origin that starts with localhost
|
128
|
-
if (d === "localhost" && origin.startsWith("localhost")) {
|
129
|
-
return true;
|
130
|
-
}
|
131
|
-
|
132
|
-
// If the allowedDomain has a wildcard,
|
133
|
-
// we'll check that the ending of our domain matches the wildcard
|
134
|
-
if (d.startsWith("*.")) {
|
135
|
-
// get rid of the * and check if it ends with the `.<domain>.<tld>`
|
136
|
-
const domainRoot = d.slice(1);
|
137
|
-
return origin.endsWith(domainRoot);
|
138
|
-
}
|
139
|
-
|
140
|
-
// If there's no wildcard, we'll check for an exact match
|
141
|
-
return d === origin;
|
142
|
-
})) {
|
143
|
-
return authResult;
|
144
|
-
}
|
145
|
-
return {
|
146
|
-
authorized: false,
|
147
|
-
errorMessage: `Invalid request: Unauthorized domain: ${origin}. You can view the restrictions on this API key at https://thirdweb.com/create-api-key`,
|
148
|
-
errorCode: "ORIGIN_UNAUTHORIZED",
|
149
|
-
status: 401
|
150
|
-
};
|
151
|
-
}
|
152
|
-
|
153
|
-
// validate bundleId
|
154
|
-
if (bundleId) {
|
155
|
-
if (
|
156
|
-
// find matching bundle id, or if all bundles allowed
|
157
|
-
bundleIds.find(b => {
|
158
|
-
if (b === "*") {
|
159
|
-
return true;
|
160
|
-
}
|
161
|
-
return b === bundleId;
|
162
|
-
})) {
|
163
|
-
return authResult;
|
164
|
-
}
|
165
|
-
return {
|
166
|
-
authorized: false,
|
167
|
-
errorMessage: `Invalid request: Unauthorized Bundle ID: ${bundleId}. You can view the restrictions on this API key at https://thirdweb.com/create-api-key`,
|
168
|
-
errorCode: "BUNDLE_UNAUTHORIZED",
|
169
|
-
status: 401
|
170
|
-
};
|
171
|
-
}
|
172
|
-
return {
|
173
|
-
authorized: false,
|
174
|
-
errorMessage: "The keys are invalid. Please check the secret-key/clientId and try again.",
|
175
|
-
errorCode: "UNAUTHORIZED",
|
176
|
-
status: 401
|
177
|
-
};
|
178
|
-
}
|
179
|
-
|
180
72
|
function authorizeService(apiKeyMetadata, serviceConfig, authorizationPayload) {
|
181
73
|
const {
|
182
74
|
services
|
@@ -418,7 +310,7 @@ async function authorize(authData, serviceConfig, cacheOptions) {
|
|
418
310
|
};
|
419
311
|
}
|
420
312
|
// now we can validate the key itself
|
421
|
-
const clientAuth = authorizeClient(authData, apiKeyMeta);
|
313
|
+
const clientAuth = client.authorizeClient(authData, apiKeyMeta);
|
422
314
|
if (!clientAuth.authorized) {
|
423
315
|
return {
|
424
316
|
errorCode: clientAuth.errorCode,
|
@@ -1,3 +1,5 @@
|
|
1
|
+
import { e as authorizeClient } from './client-8a85ab05.esm.js';
|
2
|
+
|
1
3
|
async function fetchKeyMetadataFromApi(clientId, config) {
|
2
4
|
const {
|
3
5
|
apiUrl,
|
@@ -65,116 +67,6 @@ async function updateRateLimitedAt(apiKeyId, config) {
|
|
65
67
|
});
|
66
68
|
}
|
67
69
|
|
68
|
-
function authorizeClient(authOptions, apiKeyMeta) {
|
69
|
-
const {
|
70
|
-
origin,
|
71
|
-
bundleId,
|
72
|
-
secretKeyHash: providedSecretHash
|
73
|
-
} = authOptions;
|
74
|
-
const {
|
75
|
-
domains,
|
76
|
-
bundleIds,
|
77
|
-
secretHash
|
78
|
-
} = apiKeyMeta;
|
79
|
-
const authResult = {
|
80
|
-
authorized: true,
|
81
|
-
apiKeyMeta,
|
82
|
-
accountMeta: {
|
83
|
-
id: apiKeyMeta.accountId,
|
84
|
-
// TODO update this later
|
85
|
-
name: "",
|
86
|
-
creatorWalletAddress: apiKeyMeta.creatorWalletAddress,
|
87
|
-
limits: apiKeyMeta.limits,
|
88
|
-
rateLimits: apiKeyMeta.rateLimits,
|
89
|
-
usage: apiKeyMeta.usage
|
90
|
-
}
|
91
|
-
};
|
92
|
-
|
93
|
-
// check for public restrictions
|
94
|
-
if (domains.includes("*")) {
|
95
|
-
return authResult;
|
96
|
-
}
|
97
|
-
|
98
|
-
// check for secretHash
|
99
|
-
if (providedSecretHash) {
|
100
|
-
if (secretHash !== providedSecretHash) {
|
101
|
-
return {
|
102
|
-
authorized: false,
|
103
|
-
errorMessage: "Incorrect key provided. You can view your active API keys at https://thirdweb.com/dashboard/settings",
|
104
|
-
errorCode: "SECRET_INVALID",
|
105
|
-
status: 401
|
106
|
-
};
|
107
|
-
}
|
108
|
-
return authResult;
|
109
|
-
}
|
110
|
-
|
111
|
-
// validate domains
|
112
|
-
if (origin) {
|
113
|
-
if (
|
114
|
-
// find matching domain, or if all domains allowed
|
115
|
-
// embedded-wallet.thirdweb(-dev).com is automatically allowed
|
116
|
-
// because the rpc is passed from user's domain to embedded-wallet.thirdweb.com iframe for use.
|
117
|
-
// Note this doesn't allow embedded-wallets from being used if it's disabled. The service check that runs after enforces that.
|
118
|
-
[...domains, "embedded-wallet.thirdweb.com", "embedded-wallet.thirdweb-dev.com"].find(d => {
|
119
|
-
// if any domain is allowed, we'll return true
|
120
|
-
if (d === "*") {
|
121
|
-
return true;
|
122
|
-
}
|
123
|
-
|
124
|
-
// special rule for `localhost`
|
125
|
-
// if the domain is localhost, we'll allow any origin that starts with localhost
|
126
|
-
if (d === "localhost" && origin.startsWith("localhost")) {
|
127
|
-
return true;
|
128
|
-
}
|
129
|
-
|
130
|
-
// If the allowedDomain has a wildcard,
|
131
|
-
// we'll check that the ending of our domain matches the wildcard
|
132
|
-
if (d.startsWith("*.")) {
|
133
|
-
// get rid of the * and check if it ends with the `.<domain>.<tld>`
|
134
|
-
const domainRoot = d.slice(1);
|
135
|
-
return origin.endsWith(domainRoot);
|
136
|
-
}
|
137
|
-
|
138
|
-
// If there's no wildcard, we'll check for an exact match
|
139
|
-
return d === origin;
|
140
|
-
})) {
|
141
|
-
return authResult;
|
142
|
-
}
|
143
|
-
return {
|
144
|
-
authorized: false,
|
145
|
-
errorMessage: `Invalid request: Unauthorized domain: ${origin}. You can view the restrictions on this API key at https://thirdweb.com/create-api-key`,
|
146
|
-
errorCode: "ORIGIN_UNAUTHORIZED",
|
147
|
-
status: 401
|
148
|
-
};
|
149
|
-
}
|
150
|
-
|
151
|
-
// validate bundleId
|
152
|
-
if (bundleId) {
|
153
|
-
if (
|
154
|
-
// find matching bundle id, or if all bundles allowed
|
155
|
-
bundleIds.find(b => {
|
156
|
-
if (b === "*") {
|
157
|
-
return true;
|
158
|
-
}
|
159
|
-
return b === bundleId;
|
160
|
-
})) {
|
161
|
-
return authResult;
|
162
|
-
}
|
163
|
-
return {
|
164
|
-
authorized: false,
|
165
|
-
errorMessage: `Invalid request: Unauthorized Bundle ID: ${bundleId}. You can view the restrictions on this API key at https://thirdweb.com/create-api-key`,
|
166
|
-
errorCode: "BUNDLE_UNAUTHORIZED",
|
167
|
-
status: 401
|
168
|
-
};
|
169
|
-
}
|
170
|
-
return {
|
171
|
-
authorized: false,
|
172
|
-
errorMessage: "The keys are invalid. Please check the secret-key/clientId and try again.",
|
173
|
-
errorCode: "UNAUTHORIZED",
|
174
|
-
status: 401
|
175
|
-
};
|
176
|
-
}
|
177
|
-
|
178
70
|
function authorizeService(apiKeyMetadata, serviceConfig, authorizationPayload) {
|
179
71
|
const {
|
180
72
|
services
|
@@ -1,5 +1,7 @@
|
|
1
1
|
'use strict';
|
2
2
|
|
3
|
+
var client = require('./client-43ffd386.cjs.prod.js');
|
4
|
+
|
3
5
|
async function fetchKeyMetadataFromApi(clientId, config) {
|
4
6
|
const {
|
5
7
|
apiUrl,
|
@@ -67,116 +69,6 @@ async function updateRateLimitedAt(apiKeyId, config) {
|
|
67
69
|
});
|
68
70
|
}
|
69
71
|
|
70
|
-
function authorizeClient(authOptions, apiKeyMeta) {
|
71
|
-
const {
|
72
|
-
origin,
|
73
|
-
bundleId,
|
74
|
-
secretKeyHash: providedSecretHash
|
75
|
-
} = authOptions;
|
76
|
-
const {
|
77
|
-
domains,
|
78
|
-
bundleIds,
|
79
|
-
secretHash
|
80
|
-
} = apiKeyMeta;
|
81
|
-
const authResult = {
|
82
|
-
authorized: true,
|
83
|
-
apiKeyMeta,
|
84
|
-
accountMeta: {
|
85
|
-
id: apiKeyMeta.accountId,
|
86
|
-
// TODO update this later
|
87
|
-
name: "",
|
88
|
-
creatorWalletAddress: apiKeyMeta.creatorWalletAddress,
|
89
|
-
limits: apiKeyMeta.limits,
|
90
|
-
rateLimits: apiKeyMeta.rateLimits,
|
91
|
-
usage: apiKeyMeta.usage
|
92
|
-
}
|
93
|
-
};
|
94
|
-
|
95
|
-
// check for public restrictions
|
96
|
-
if (domains.includes("*")) {
|
97
|
-
return authResult;
|
98
|
-
}
|
99
|
-
|
100
|
-
// check for secretHash
|
101
|
-
if (providedSecretHash) {
|
102
|
-
if (secretHash !== providedSecretHash) {
|
103
|
-
return {
|
104
|
-
authorized: false,
|
105
|
-
errorMessage: "Incorrect key provided. You can view your active API keys at https://thirdweb.com/dashboard/settings",
|
106
|
-
errorCode: "SECRET_INVALID",
|
107
|
-
status: 401
|
108
|
-
};
|
109
|
-
}
|
110
|
-
return authResult;
|
111
|
-
}
|
112
|
-
|
113
|
-
// validate domains
|
114
|
-
if (origin) {
|
115
|
-
if (
|
116
|
-
// find matching domain, or if all domains allowed
|
117
|
-
// embedded-wallet.thirdweb(-dev).com is automatically allowed
|
118
|
-
// because the rpc is passed from user's domain to embedded-wallet.thirdweb.com iframe for use.
|
119
|
-
// Note this doesn't allow embedded-wallets from being used if it's disabled. The service check that runs after enforces that.
|
120
|
-
[...domains, "embedded-wallet.thirdweb.com", "embedded-wallet.thirdweb-dev.com"].find(d => {
|
121
|
-
// if any domain is allowed, we'll return true
|
122
|
-
if (d === "*") {
|
123
|
-
return true;
|
124
|
-
}
|
125
|
-
|
126
|
-
// special rule for `localhost`
|
127
|
-
// if the domain is localhost, we'll allow any origin that starts with localhost
|
128
|
-
if (d === "localhost" && origin.startsWith("localhost")) {
|
129
|
-
return true;
|
130
|
-
}
|
131
|
-
|
132
|
-
// If the allowedDomain has a wildcard,
|
133
|
-
// we'll check that the ending of our domain matches the wildcard
|
134
|
-
if (d.startsWith("*.")) {
|
135
|
-
// get rid of the * and check if it ends with the `.<domain>.<tld>`
|
136
|
-
const domainRoot = d.slice(1);
|
137
|
-
return origin.endsWith(domainRoot);
|
138
|
-
}
|
139
|
-
|
140
|
-
// If there's no wildcard, we'll check for an exact match
|
141
|
-
return d === origin;
|
142
|
-
})) {
|
143
|
-
return authResult;
|
144
|
-
}
|
145
|
-
return {
|
146
|
-
authorized: false,
|
147
|
-
errorMessage: `Invalid request: Unauthorized domain: ${origin}. You can view the restrictions on this API key at https://thirdweb.com/create-api-key`,
|
148
|
-
errorCode: "ORIGIN_UNAUTHORIZED",
|
149
|
-
status: 401
|
150
|
-
};
|
151
|
-
}
|
152
|
-
|
153
|
-
// validate bundleId
|
154
|
-
if (bundleId) {
|
155
|
-
if (
|
156
|
-
// find matching bundle id, or if all bundles allowed
|
157
|
-
bundleIds.find(b => {
|
158
|
-
if (b === "*") {
|
159
|
-
return true;
|
160
|
-
}
|
161
|
-
return b === bundleId;
|
162
|
-
})) {
|
163
|
-
return authResult;
|
164
|
-
}
|
165
|
-
return {
|
166
|
-
authorized: false,
|
167
|
-
errorMessage: `Invalid request: Unauthorized Bundle ID: ${bundleId}. You can view the restrictions on this API key at https://thirdweb.com/create-api-key`,
|
168
|
-
errorCode: "BUNDLE_UNAUTHORIZED",
|
169
|
-
status: 401
|
170
|
-
};
|
171
|
-
}
|
172
|
-
return {
|
173
|
-
authorized: false,
|
174
|
-
errorMessage: "The keys are invalid. Please check the secret-key/clientId and try again.",
|
175
|
-
errorCode: "UNAUTHORIZED",
|
176
|
-
status: 401
|
177
|
-
};
|
178
|
-
}
|
179
|
-
|
180
72
|
function authorizeService(apiKeyMetadata, serviceConfig, authorizationPayload) {
|
181
73
|
const {
|
182
74
|
services
|
@@ -418,7 +310,7 @@ async function authorize(authData, serviceConfig, cacheOptions) {
|
|
418
310
|
};
|
419
311
|
}
|
420
312
|
// now we can validate the key itself
|
421
|
-
const clientAuth = authorizeClient(authData, apiKeyMeta);
|
313
|
+
const clientAuth = client.authorizeClient(authData, apiKeyMeta);
|
422
314
|
if (!clientAuth.authorized) {
|
423
315
|
return {
|
424
316
|
errorCode: clientAuth.errorCode,
|
@@ -2,11 +2,13 @@
|
|
2
2
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
4
4
|
|
5
|
-
var
|
5
|
+
var client = require('./client-e805236b.cjs.dev.js');
|
6
6
|
|
7
7
|
|
8
8
|
|
9
|
-
exports.SERVICES =
|
10
|
-
exports.SERVICE_DEFINITIONS =
|
11
|
-
exports.SERVICE_NAMES =
|
12
|
-
exports.
|
9
|
+
exports.SERVICES = client.SERVICES;
|
10
|
+
exports.SERVICE_DEFINITIONS = client.SERVICE_DEFINITIONS;
|
11
|
+
exports.SERVICE_NAMES = client.SERVICE_NAMES;
|
12
|
+
exports.authorizeBundleId = client.authorizeBundleId;
|
13
|
+
exports.authorizeDomain = client.authorizeDomain;
|
14
|
+
exports.getServiceByName = client.getServiceByName;
|
@@ -2,11 +2,13 @@
|
|
2
2
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
4
4
|
|
5
|
-
var
|
5
|
+
var client = require('./client-43ffd386.cjs.prod.js');
|
6
6
|
|
7
7
|
|
8
8
|
|
9
|
-
exports.SERVICES =
|
10
|
-
exports.SERVICE_DEFINITIONS =
|
11
|
-
exports.SERVICE_NAMES =
|
12
|
-
exports.
|
9
|
+
exports.SERVICES = client.SERVICES;
|
10
|
+
exports.SERVICE_DEFINITIONS = client.SERVICE_DEFINITIONS;
|
11
|
+
exports.SERVICE_NAMES = client.SERVICE_NAMES;
|
12
|
+
exports.authorizeBundleId = client.authorizeBundleId;
|
13
|
+
exports.authorizeDomain = client.authorizeDomain;
|
14
|
+
exports.getServiceByName = client.getServiceByName;
|
@@ -1 +1 @@
|
|
1
|
-
export {
|
1
|
+
export { d as SERVICES, S as SERVICE_DEFINITIONS, c as SERVICE_NAMES, a as authorizeBundleId, b as authorizeDomain, g as getServiceByName } from './client-8a85ab05.esm.js';
|
@@ -3,8 +3,8 @@
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
4
4
|
|
5
5
|
var node_crypto = require('node:crypto');
|
6
|
-
var index = require('../../dist/index-
|
7
|
-
var
|
6
|
+
var index = require('../../dist/index-0d9dbeb2.cjs.dev.js');
|
7
|
+
var client = require('../../dist/client-e805236b.cjs.dev.js');
|
8
8
|
|
9
9
|
/**
|
10
10
|
*
|
@@ -177,10 +177,10 @@ function logHttpRequest(_ref) {
|
|
177
177
|
|
178
178
|
exports.rateLimit = index.rateLimit;
|
179
179
|
exports.usageLimit = index.usageLimit;
|
180
|
-
exports.SERVICES =
|
181
|
-
exports.SERVICE_DEFINITIONS =
|
182
|
-
exports.SERVICE_NAMES =
|
183
|
-
exports.getServiceByName =
|
180
|
+
exports.SERVICES = client.SERVICES;
|
181
|
+
exports.SERVICE_DEFINITIONS = client.SERVICE_DEFINITIONS;
|
182
|
+
exports.SERVICE_NAMES = client.SERVICE_NAMES;
|
183
|
+
exports.getServiceByName = client.getServiceByName;
|
184
184
|
exports.authorizeNode = authorizeNode;
|
185
185
|
exports.deriveClientIdFromSecretKeyHash = deriveClientIdFromSecretKeyHash;
|
186
186
|
exports.extractAuthorizationData = extractAuthorizationData;
|
@@ -3,8 +3,8 @@
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
4
4
|
|
5
5
|
var node_crypto = require('node:crypto');
|
6
|
-
var index = require('../../dist/index-
|
7
|
-
var
|
6
|
+
var index = require('../../dist/index-fecf7702.cjs.prod.js');
|
7
|
+
var client = require('../../dist/client-43ffd386.cjs.prod.js');
|
8
8
|
|
9
9
|
/**
|
10
10
|
*
|
@@ -177,10 +177,10 @@ function logHttpRequest(_ref) {
|
|
177
177
|
|
178
178
|
exports.rateLimit = index.rateLimit;
|
179
179
|
exports.usageLimit = index.usageLimit;
|
180
|
-
exports.SERVICES =
|
181
|
-
exports.SERVICE_DEFINITIONS =
|
182
|
-
exports.SERVICE_NAMES =
|
183
|
-
exports.getServiceByName =
|
180
|
+
exports.SERVICES = client.SERVICES;
|
181
|
+
exports.SERVICE_DEFINITIONS = client.SERVICE_DEFINITIONS;
|
182
|
+
exports.SERVICE_NAMES = client.SERVICE_NAMES;
|
183
|
+
exports.getServiceByName = client.getServiceByName;
|
184
184
|
exports.authorizeNode = authorizeNode;
|
185
185
|
exports.deriveClientIdFromSecretKeyHash = deriveClientIdFromSecretKeyHash;
|
186
186
|
exports.extractAuthorizationData = extractAuthorizationData;
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { createHash } from 'node:crypto';
|
2
|
-
import { a as authorize } from '../../dist/index-
|
3
|
-
export { r as rateLimit, u as usageLimit } from '../../dist/index-
|
4
|
-
export {
|
2
|
+
import { a as authorize } from '../../dist/index-8cff5ac3.esm.js';
|
3
|
+
export { r as rateLimit, u as usageLimit } from '../../dist/index-8cff5ac3.esm.js';
|
4
|
+
export { d as SERVICES, S as SERVICE_DEFINITIONS, c as SERVICE_NAMES, g as getServiceByName } from '../../dist/client-8a85ab05.esm.js';
|
5
5
|
|
6
6
|
/**
|
7
7
|
*
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@thirdweb-dev/service-utils",
|
3
|
-
"version": "0.4.
|
3
|
+
"version": "0.4.31-nightly-73af67aad1f0b3f8d93ad6b38975770e8aed6208-20240608032553",
|
4
4
|
"main": "dist/thirdweb-dev-service-utils.cjs.js",
|
5
5
|
"module": "dist/thirdweb-dev-service-utils.esm.js",
|
6
6
|
"exports": {
|
@@ -1,65 +0,0 @@
|
|
1
|
-
const SERVICE_DEFINITIONS = {
|
2
|
-
storage: {
|
3
|
-
name: "storage",
|
4
|
-
title: "Storage",
|
5
|
-
description: "IPFS Upload and Download",
|
6
|
-
actions: [{
|
7
|
-
name: "read",
|
8
|
-
title: "Download",
|
9
|
-
description: "Download a file from Storage"
|
10
|
-
}, {
|
11
|
-
name: "write",
|
12
|
-
title: "Upload",
|
13
|
-
description: "Upload a file to Storage"
|
14
|
-
}]
|
15
|
-
},
|
16
|
-
rpc: {
|
17
|
-
name: "rpc",
|
18
|
-
title: "RPC",
|
19
|
-
description: "Accelerated RPC Edge",
|
20
|
-
// all actions allowed
|
21
|
-
actions: []
|
22
|
-
},
|
23
|
-
bundler: {
|
24
|
-
name: "bundler",
|
25
|
-
title: "Account Abstraction",
|
26
|
-
description: "Bundler & Paymaster services",
|
27
|
-
// all actions allowed
|
28
|
-
actions: []
|
29
|
-
},
|
30
|
-
relayer: {
|
31
|
-
name: "relayer",
|
32
|
-
title: "Gasless Relayer",
|
33
|
-
description: "Enable gasless transactions",
|
34
|
-
// all actions allowed
|
35
|
-
actions: []
|
36
|
-
},
|
37
|
-
embeddedWallets: {
|
38
|
-
name: "embeddedWallets",
|
39
|
-
title: "In-App Wallets",
|
40
|
-
description: "E-mail and social login wallets for easy web3 onboarding",
|
41
|
-
// all actions allowed
|
42
|
-
actions: []
|
43
|
-
},
|
44
|
-
checkout: {
|
45
|
-
name: "checkout",
|
46
|
-
title: "Checkouts",
|
47
|
-
description: "NFT Checkouts for easy web3 onboarding",
|
48
|
-
// all actions allowed
|
49
|
-
actions: []
|
50
|
-
},
|
51
|
-
pay: {
|
52
|
-
name: "pay",
|
53
|
-
title: "Pay",
|
54
|
-
description: "Pay for a blockchain transaction with any currency",
|
55
|
-
// all actions allowed
|
56
|
-
actions: []
|
57
|
-
}
|
58
|
-
};
|
59
|
-
const SERVICE_NAMES = Object.keys(SERVICE_DEFINITIONS);
|
60
|
-
const SERVICES = Object.values(SERVICE_DEFINITIONS);
|
61
|
-
function getServiceByName(name) {
|
62
|
-
return SERVICE_DEFINITIONS[name];
|
63
|
-
}
|
64
|
-
|
65
|
-
export { SERVICE_DEFINITIONS as S, SERVICE_NAMES as a, SERVICES as b, getServiceByName as g };
|
@@ -1,70 +0,0 @@
|
|
1
|
-
'use strict';
|
2
|
-
|
3
|
-
const SERVICE_DEFINITIONS = {
|
4
|
-
storage: {
|
5
|
-
name: "storage",
|
6
|
-
title: "Storage",
|
7
|
-
description: "IPFS Upload and Download",
|
8
|
-
actions: [{
|
9
|
-
name: "read",
|
10
|
-
title: "Download",
|
11
|
-
description: "Download a file from Storage"
|
12
|
-
}, {
|
13
|
-
name: "write",
|
14
|
-
title: "Upload",
|
15
|
-
description: "Upload a file to Storage"
|
16
|
-
}]
|
17
|
-
},
|
18
|
-
rpc: {
|
19
|
-
name: "rpc",
|
20
|
-
title: "RPC",
|
21
|
-
description: "Accelerated RPC Edge",
|
22
|
-
// all actions allowed
|
23
|
-
actions: []
|
24
|
-
},
|
25
|
-
bundler: {
|
26
|
-
name: "bundler",
|
27
|
-
title: "Account Abstraction",
|
28
|
-
description: "Bundler & Paymaster services",
|
29
|
-
// all actions allowed
|
30
|
-
actions: []
|
31
|
-
},
|
32
|
-
relayer: {
|
33
|
-
name: "relayer",
|
34
|
-
title: "Gasless Relayer",
|
35
|
-
description: "Enable gasless transactions",
|
36
|
-
// all actions allowed
|
37
|
-
actions: []
|
38
|
-
},
|
39
|
-
embeddedWallets: {
|
40
|
-
name: "embeddedWallets",
|
41
|
-
title: "In-App Wallets",
|
42
|
-
description: "E-mail and social login wallets for easy web3 onboarding",
|
43
|
-
// all actions allowed
|
44
|
-
actions: []
|
45
|
-
},
|
46
|
-
checkout: {
|
47
|
-
name: "checkout",
|
48
|
-
title: "Checkouts",
|
49
|
-
description: "NFT Checkouts for easy web3 onboarding",
|
50
|
-
// all actions allowed
|
51
|
-
actions: []
|
52
|
-
},
|
53
|
-
pay: {
|
54
|
-
name: "pay",
|
55
|
-
title: "Pay",
|
56
|
-
description: "Pay for a blockchain transaction with any currency",
|
57
|
-
// all actions allowed
|
58
|
-
actions: []
|
59
|
-
}
|
60
|
-
};
|
61
|
-
const SERVICE_NAMES = Object.keys(SERVICE_DEFINITIONS);
|
62
|
-
const SERVICES = Object.values(SERVICE_DEFINITIONS);
|
63
|
-
function getServiceByName(name) {
|
64
|
-
return SERVICE_DEFINITIONS[name];
|
65
|
-
}
|
66
|
-
|
67
|
-
exports.SERVICES = SERVICES;
|
68
|
-
exports.SERVICE_DEFINITIONS = SERVICE_DEFINITIONS;
|
69
|
-
exports.SERVICE_NAMES = SERVICE_NAMES;
|
70
|
-
exports.getServiceByName = getServiceByName;
|