@thirdweb-dev/service-utils 0.3.0-nightly-c0a6d2f1-20230803001802 → 0.3.0-nightly-5ee700e8-20230803010712

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.
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var index = require('../../dist/index-8a9496b0.cjs.dev.js');
5
+ var index = require('../../dist/index-6e878a86.cjs.dev.js');
6
6
  var services = require('../../dist/services-a3f36057.cjs.dev.js');
7
7
 
8
8
  const DEFAULT_CACHE_TTL_SECONDS = 60;
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var index = require('../../dist/index-92289057.cjs.prod.js');
5
+ var index = require('../../dist/index-bd1fbe19.cjs.prod.js');
6
6
  var services = require('../../dist/services-9e185105.cjs.prod.js');
7
7
 
8
8
  const DEFAULT_CACHE_TTL_SECONDS = 60;
@@ -1,4 +1,4 @@
1
- import { a as authorize } from '../../dist/index-3a529ebb.esm.js';
1
+ import { a as authorize } from '../../dist/index-f4c85072.esm.js';
2
2
  export { b as SERVICES, S as SERVICE_DEFINITIONS, a as SERVICE_NAMES, g as getServiceByName } from '../../dist/services-86283509.esm.js';
3
3
 
4
4
  const DEFAULT_CACHE_TTL_SECONDS = 60;
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"../../../../../src/core/authorize","sources":["client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AAC7C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAEnD,MAAM,MAAM,0BAA0B,GAAG;IACvC,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB,CAAC;AAEF,wBAAgB,eAAe,CAC7B,WAAW,EAAE,0BAA0B,EACvC,UAAU,EAAE,cAAc,GACzB,mBAAmB,CAuGrB"}
1
+ {"version":3,"file":"client.d.ts","sourceRoot":"../../../../../src/core/authorize","sources":["client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AAC7C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAEnD,MAAM,MAAM,0BAA0B,GAAG;IACvC,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB,CAAC;AAEF,wBAAgB,eAAe,CAC7B,WAAW,EAAE,0BAA0B,EACvC,UAAU,EAAE,cAAc,GACzB,mBAAmB,CAwGrB"}
@@ -71,7 +71,7 @@ function authorizeClient(authOptions, apiKeyMeta) {
71
71
  if (secretHash !== providedSecretHash) {
72
72
  return {
73
73
  authorized: false,
74
- errorMessage: "The secret is invalid. Please check you secret-key",
74
+ errorMessage: "Incorrect key provided. You can view your active API keys at https://thirdweb.com/dashboard/settings",
75
75
  errorCode: "SECRET_INVALID",
76
76
  status: 401
77
77
  };
@@ -110,7 +110,7 @@ function authorizeClient(authOptions, apiKeyMeta) {
110
110
  }
111
111
  return {
112
112
  authorized: false,
113
- errorMessage: `The domain: ${origin}, is not authorized for this key. Please update your key permissions on the thirdweb dashboard`,
113
+ errorMessage: `Invalid request: Unauthorized domain: ${origin}. You can view the restrictions on this API key at https://thirdweb.com/create-api-key`,
114
114
  errorCode: "ORIGIN_UNAUTHORIZED",
115
115
  status: 401
116
116
  };
@@ -130,7 +130,7 @@ function authorizeClient(authOptions, apiKeyMeta) {
130
130
  }
131
131
  return {
132
132
  authorized: false,
133
- errorMessage: `The bundleId: ${bundleId}, is not authorized for this key. Please update your key permissions on the thirdweb dashboard`,
133
+ errorMessage: `Invalid request: Unauthorized Bundle ID: ${bundleId}. You can view the restrictions on this API key at https://thirdweb.com/create-api-key`,
134
134
  errorCode: "BUNDLE_UNAUTHORIZED",
135
135
  status: 401
136
136
  };
@@ -152,7 +152,7 @@ function authorizeService(apiKeyMetadata, serviceConfig, authorizationPayload) {
152
152
  if (!service) {
153
153
  return {
154
154
  authorized: false,
155
- errorMessage: `The service "${serviceConfig.serviceScope}" is not authorized for this key. Please update your key permissions on the thirdweb dashboard.`,
155
+ errorMessage: `Invalid request: Unauthorized service: ${serviceConfig.serviceScope}. You can view the restrictions on this API key in your dashboard: https://thirdweb.com/create-api-key`,
156
156
  errorCode: "SERVICE_UNAUTHORIZED",
157
157
  status: 403
158
158
  };
@@ -164,7 +164,7 @@ function authorizeService(apiKeyMetadata, serviceConfig, authorizationPayload) {
164
164
  if (!isActionAllowed) {
165
165
  return {
166
166
  authorized: false,
167
- errorMessage: `The service "${serviceConfig.serviceScope}" action "${serviceConfig.serviceAction}" is not authorized for this key. Please update your key permissions on the thirdweb dashboard.`,
167
+ errorMessage: `Invalid request: Unauthorized action: ${serviceConfig.serviceScope} ${serviceConfig.serviceAction}. You can view the restrictions on this API key in your dashboard: https://thirdweb.com/create-api-key`,
168
168
  errorCode: "SERVICE_ACTION_UNAUTHORIZED",
169
169
  status: 403
170
170
  };
@@ -179,7 +179,7 @@ function authorizeService(apiKeyMetadata, serviceConfig, authorizationPayload) {
179
179
  if (!allAllowed && checkedAddresses.some(ta => !service.targetAddresses.includes(ta))) {
180
180
  return {
181
181
  authorized: false,
182
- errorMessage: `The target address: ${checkedAddresses}, for service "${serviceConfig.serviceScope}" is not authorized for this key. Please update your key permissions on the thirdweb dashboard.`,
182
+ errorMessage: `Invalid request: Unauthorized address: ${serviceConfig.serviceScope} ${checkedAddresses}. You can view the restrictions on this API key in your dashboard: https://thirdweb.com/create-api-key`,
183
183
  errorCode: "SERVICE_TARGET_ADDRESS_UNAUTHORIZED",
184
184
  status: 403
185
185
  };
@@ -71,7 +71,7 @@ function authorizeClient(authOptions, apiKeyMeta) {
71
71
  if (secretHash !== providedSecretHash) {
72
72
  return {
73
73
  authorized: false,
74
- errorMessage: "The secret is invalid. Please check you secret-key",
74
+ errorMessage: "Incorrect key provided. You can view your active API keys at https://thirdweb.com/dashboard/settings",
75
75
  errorCode: "SECRET_INVALID",
76
76
  status: 401
77
77
  };
@@ -110,7 +110,7 @@ function authorizeClient(authOptions, apiKeyMeta) {
110
110
  }
111
111
  return {
112
112
  authorized: false,
113
- errorMessage: `The domain: ${origin}, is not authorized for this key. Please update your key permissions on the thirdweb dashboard`,
113
+ errorMessage: `Invalid request: Unauthorized domain: ${origin}. You can view the restrictions on this API key at https://thirdweb.com/create-api-key`,
114
114
  errorCode: "ORIGIN_UNAUTHORIZED",
115
115
  status: 401
116
116
  };
@@ -130,7 +130,7 @@ function authorizeClient(authOptions, apiKeyMeta) {
130
130
  }
131
131
  return {
132
132
  authorized: false,
133
- errorMessage: `The bundleId: ${bundleId}, is not authorized for this key. Please update your key permissions on the thirdweb dashboard`,
133
+ errorMessage: `Invalid request: Unauthorized Bundle ID: ${bundleId}. You can view the restrictions on this API key at https://thirdweb.com/create-api-key`,
134
134
  errorCode: "BUNDLE_UNAUTHORIZED",
135
135
  status: 401
136
136
  };
@@ -152,7 +152,7 @@ function authorizeService(apiKeyMetadata, serviceConfig, authorizationPayload) {
152
152
  if (!service) {
153
153
  return {
154
154
  authorized: false,
155
- errorMessage: `The service "${serviceConfig.serviceScope}" is not authorized for this key. Please update your key permissions on the thirdweb dashboard.`,
155
+ errorMessage: `Invalid request: Unauthorized service: ${serviceConfig.serviceScope}. You can view the restrictions on this API key in your dashboard: https://thirdweb.com/create-api-key`,
156
156
  errorCode: "SERVICE_UNAUTHORIZED",
157
157
  status: 403
158
158
  };
@@ -164,7 +164,7 @@ function authorizeService(apiKeyMetadata, serviceConfig, authorizationPayload) {
164
164
  if (!isActionAllowed) {
165
165
  return {
166
166
  authorized: false,
167
- errorMessage: `The service "${serviceConfig.serviceScope}" action "${serviceConfig.serviceAction}" is not authorized for this key. Please update your key permissions on the thirdweb dashboard.`,
167
+ errorMessage: `Invalid request: Unauthorized action: ${serviceConfig.serviceScope} ${serviceConfig.serviceAction}. You can view the restrictions on this API key in your dashboard: https://thirdweb.com/create-api-key`,
168
168
  errorCode: "SERVICE_ACTION_UNAUTHORIZED",
169
169
  status: 403
170
170
  };
@@ -179,7 +179,7 @@ function authorizeService(apiKeyMetadata, serviceConfig, authorizationPayload) {
179
179
  if (!allAllowed && checkedAddresses.some(ta => !service.targetAddresses.includes(ta))) {
180
180
  return {
181
181
  authorized: false,
182
- errorMessage: `The target address: ${checkedAddresses}, for service "${serviceConfig.serviceScope}" is not authorized for this key. Please update your key permissions on the thirdweb dashboard.`,
182
+ errorMessage: `Invalid request: Unauthorized address: ${serviceConfig.serviceScope} ${checkedAddresses}. You can view the restrictions on this API key in your dashboard: https://thirdweb.com/create-api-key`,
183
183
  errorCode: "SERVICE_TARGET_ADDRESS_UNAUTHORIZED",
184
184
  status: 403
185
185
  };
@@ -69,7 +69,7 @@ function authorizeClient(authOptions, apiKeyMeta) {
69
69
  if (secretHash !== providedSecretHash) {
70
70
  return {
71
71
  authorized: false,
72
- errorMessage: "The secret is invalid. Please check you secret-key",
72
+ errorMessage: "Incorrect key provided. You can view your active API keys at https://thirdweb.com/dashboard/settings",
73
73
  errorCode: "SECRET_INVALID",
74
74
  status: 401
75
75
  };
@@ -108,7 +108,7 @@ function authorizeClient(authOptions, apiKeyMeta) {
108
108
  }
109
109
  return {
110
110
  authorized: false,
111
- errorMessage: `The domain: ${origin}, is not authorized for this key. Please update your key permissions on the thirdweb dashboard`,
111
+ errorMessage: `Invalid request: Unauthorized domain: ${origin}. You can view the restrictions on this API key at https://thirdweb.com/create-api-key`,
112
112
  errorCode: "ORIGIN_UNAUTHORIZED",
113
113
  status: 401
114
114
  };
@@ -128,7 +128,7 @@ function authorizeClient(authOptions, apiKeyMeta) {
128
128
  }
129
129
  return {
130
130
  authorized: false,
131
- errorMessage: `The bundleId: ${bundleId}, is not authorized for this key. Please update your key permissions on the thirdweb dashboard`,
131
+ errorMessage: `Invalid request: Unauthorized Bundle ID: ${bundleId}. You can view the restrictions on this API key at https://thirdweb.com/create-api-key`,
132
132
  errorCode: "BUNDLE_UNAUTHORIZED",
133
133
  status: 401
134
134
  };
@@ -150,7 +150,7 @@ function authorizeService(apiKeyMetadata, serviceConfig, authorizationPayload) {
150
150
  if (!service) {
151
151
  return {
152
152
  authorized: false,
153
- errorMessage: `The service "${serviceConfig.serviceScope}" is not authorized for this key. Please update your key permissions on the thirdweb dashboard.`,
153
+ errorMessage: `Invalid request: Unauthorized service: ${serviceConfig.serviceScope}. You can view the restrictions on this API key in your dashboard: https://thirdweb.com/create-api-key`,
154
154
  errorCode: "SERVICE_UNAUTHORIZED",
155
155
  status: 403
156
156
  };
@@ -162,7 +162,7 @@ function authorizeService(apiKeyMetadata, serviceConfig, authorizationPayload) {
162
162
  if (!isActionAllowed) {
163
163
  return {
164
164
  authorized: false,
165
- errorMessage: `The service "${serviceConfig.serviceScope}" action "${serviceConfig.serviceAction}" is not authorized for this key. Please update your key permissions on the thirdweb dashboard.`,
165
+ errorMessage: `Invalid request: Unauthorized action: ${serviceConfig.serviceScope} ${serviceConfig.serviceAction}. You can view the restrictions on this API key in your dashboard: https://thirdweb.com/create-api-key`,
166
166
  errorCode: "SERVICE_ACTION_UNAUTHORIZED",
167
167
  status: 403
168
168
  };
@@ -177,7 +177,7 @@ function authorizeService(apiKeyMetadata, serviceConfig, authorizationPayload) {
177
177
  if (!allAllowed && checkedAddresses.some(ta => !service.targetAddresses.includes(ta))) {
178
178
  return {
179
179
  authorized: false,
180
- errorMessage: `The target address: ${checkedAddresses}, for service "${serviceConfig.serviceScope}" is not authorized for this key. Please update your key permissions on the thirdweb dashboard.`,
180
+ errorMessage: `Invalid request: Unauthorized address: ${serviceConfig.serviceScope} ${checkedAddresses}. You can view the restrictions on this API key in your dashboard: https://thirdweb.com/create-api-key`,
181
181
  errorCode: "SERVICE_TARGET_ADDRESS_UNAUTHORIZED",
182
182
  status: 403
183
183
  };
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var node_crypto = require('node:crypto');
6
- var index = require('../../dist/index-8a9496b0.cjs.dev.js');
6
+ var index = require('../../dist/index-6e878a86.cjs.dev.js');
7
7
  var services = require('../../dist/services-a3f36057.cjs.dev.js');
8
8
 
9
9
  async function authorizeNode(authInput, serviceConfig) {
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var node_crypto = require('node:crypto');
6
- var index = require('../../dist/index-92289057.cjs.prod.js');
6
+ var index = require('../../dist/index-bd1fbe19.cjs.prod.js');
7
7
  var services = require('../../dist/services-9e185105.cjs.prod.js');
8
8
 
9
9
  async function authorizeNode(authInput, serviceConfig) {
@@ -1,5 +1,5 @@
1
1
  import { createHash } from 'node:crypto';
2
- import { a as authorize } from '../../dist/index-3a529ebb.esm.js';
2
+ import { a as authorize } from '../../dist/index-f4c85072.esm.js';
3
3
  export { b as SERVICES, S as SERVICE_DEFINITIONS, a as SERVICE_NAMES, g as getServiceByName } from '../../dist/services-86283509.esm.js';
4
4
 
5
5
  async function authorizeNode(authInput, serviceConfig) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thirdweb-dev/service-utils",
3
- "version": "0.3.0-nightly-c0a6d2f1-20230803001802",
3
+ "version": "0.3.0-nightly-5ee700e8-20230803010712",
4
4
  "main": "dist/thirdweb-dev-service-utils.cjs.js",
5
5
  "module": "dist/thirdweb-dev-service-utils.esm.js",
6
6
  "exports": {