@seamapi/http 0.11.1 → 0.12.0

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/connect.cjs CHANGED
@@ -229,6 +229,21 @@ var SeamHttpInvalidOptionsError = class extends Error {
229
229
  var SeamHttpMultiWorkspaceInvalidOptionsError = class extends SeamHttpInvalidOptionsError {
230
230
  };
231
231
 
232
+ // src/lib/seam/connect/token.ts
233
+ var tokenPrefix = "seam_";
234
+ var accessTokenPrefix = "seam_at";
235
+ var jwtPrefix = "ey";
236
+ var clientSessionTokenPrefix = "seam_cst";
237
+ var publishableKeyTokenPrefix = "seam_pk";
238
+ var isAccessToken = (token) => token.startsWith(accessTokenPrefix);
239
+ var isJwt = (token) => token.startsWith(jwtPrefix);
240
+ var isSeamToken = (token) => token.startsWith(tokenPrefix);
241
+ var isApiKey = (token) => !isClientSessionToken(token) && !isJwt(token) && !isAccessToken(token) && !isPublishableKey(token) && isSeamToken(token);
242
+ var isClientSessionToken = (token) => token.startsWith(clientSessionTokenPrefix);
243
+ var isPublishableKey = (token) => token.startsWith(publishableKeyTokenPrefix);
244
+ var isConsoleSessionToken = (token) => isJwt(token);
245
+ var isPersonalAccessToken = (token) => isAccessToken(token);
246
+
232
247
  // src/lib/seam/connect/auth.ts
233
248
  var getAuthHeaders = (options) => {
234
249
  if ("publishableKey" in options) {
@@ -420,16 +435,6 @@ var warnOnInsecureuserIdentifierKey = (userIdentifierKey) => {
420
435
  );
421
436
  }
422
437
  };
423
- var tokenPrefix = "seam_";
424
- var accessTokenPrefix = "seam_at";
425
- var jwtPrefix = "ey";
426
- var clientSessionTokenPrefix = "seam_cst";
427
- var publishableKeyTokenPrefix = "seam_pk";
428
- var isClientSessionToken = (token) => token.startsWith(clientSessionTokenPrefix);
429
- var isAccessToken = (token) => token.startsWith(accessTokenPrefix);
430
- var isJwt = (token) => token.startsWith(jwtPrefix);
431
- var isSeamToken = (token) => token.startsWith(tokenPrefix);
432
- var isPublishableKey = (token) => token.startsWith(publishableKeyTokenPrefix);
433
438
  var isEmail = (value) => /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(value);
434
439
 
435
440
  // src/lib/seam/connect/seam-http-error.ts
@@ -3352,6 +3357,11 @@ exports.SeamHttpWorkspaces = SeamHttpWorkspaces;
3352
3357
  exports.UnserializableParamError = UnserializableParamError;
3353
3358
  exports.errorInterceptor = errorInterceptor;
3354
3359
  exports.getOpenapiSchema = getOpenapiSchema;
3360
+ exports.isApiKey = isApiKey;
3361
+ exports.isClientSessionToken = isClientSessionToken;
3362
+ exports.isConsoleSessionToken = isConsoleSessionToken;
3363
+ exports.isPersonalAccessToken = isPersonalAccessToken;
3364
+ exports.isPublishableKey = isPublishableKey;
3355
3365
  exports.isSeamActionAttemptError = isSeamActionAttemptError;
3356
3366
  exports.isSeamActionAttemptFailedError = isSeamActionAttemptFailedError;
3357
3367
  exports.isSeamActionAttemptTimeoutError = isSeamActionAttemptTimeoutError;