lancer-shared 1.0.106 → 1.0.108

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.
@@ -85,6 +85,9 @@ export declare const ROUTES: {
85
85
  readonly BY_PROVIDER_AND_ID: (provider: string, id: string) => string;
86
86
  };
87
87
  };
88
+ readonly BID: {
89
+ readonly BASE: "bid";
90
+ };
88
91
  };
89
92
  export type RouteParams = {
90
93
  id?: string;
@@ -88,6 +88,9 @@ exports.ROUTES = {
88
88
  BY_PROVIDER_AND_ID: (provider, id) => `admin/scraper-accounts/${provider}/${id}`,
89
89
  },
90
90
  },
91
+ BID: {
92
+ BASE: 'bid',
93
+ },
91
94
  };
92
95
  // Helper function to build route with parameters
93
96
  const buildRoute = (route, params = {}) => {
package/dist/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
1
  export * from './schemas';
2
2
  export * from './types';
3
3
  export * from './constants';
4
+ export * from './utils';
package/dist/index.js CHANGED
@@ -17,3 +17,4 @@ Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./schemas"), exports);
18
18
  __exportStar(require("./types"), exports);
19
19
  __exportStar(require("./constants"), exports);
20
+ __exportStar(require("./utils"), exports);
@@ -0,0 +1 @@
1
+ export * from './try-catch';
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./try-catch"), exports);
@@ -0,0 +1,11 @@
1
+ type Success<T> = {
2
+ data: T;
3
+ error: null;
4
+ };
5
+ type Failure<E> = {
6
+ data: null;
7
+ error: E;
8
+ };
9
+ type Result<T, E = Error> = Success<T> | Failure<E>;
10
+ export declare function tryCatch<T, E = Error>(promise: Promise<T>): Promise<Result<T, E>>;
11
+ export {};
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.tryCatch = void 0;
13
+ // Main wrapper function
14
+ function tryCatch(promise) {
15
+ return __awaiter(this, void 0, void 0, function* () {
16
+ try {
17
+ const data = yield promise;
18
+ return { data, error: null };
19
+ }
20
+ catch (error) {
21
+ return { data: null, error: error };
22
+ }
23
+ });
24
+ }
25
+ exports.tryCatch = tryCatch;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "commonjs",
3
3
  "name": "lancer-shared",
4
- "version": "1.0.106",
4
+ "version": "1.0.108",
5
5
  "description": "This package contains shared stuff.",
6
6
  "types": "./dist/index.d.ts",
7
7
  "main": "./dist/index.js",