lancer-shared 1.0.105 → 1.0.107

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/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);
@@ -145,9 +145,6 @@ export declare const agencyBidSchema: z.ZodObject<z.objectUtil.extendShape<{
145
145
  username: z.ZodString;
146
146
  password: z.ZodString;
147
147
  }, {
148
- agencyName: z.ZodString;
149
- contractorName: z.ZodString;
150
- specializedProfile: z.ZodNullable<z.ZodString>;
151
148
  formData: z.ZodObject<z.objectUtil.extendShape<{
152
149
  coverLetter: z.ZodString;
153
150
  questionAnswerPairs: z.ZodNullable<z.ZodArray<z.ZodObject<{
@@ -211,9 +208,6 @@ export declare const agencyBidSchema: z.ZodObject<z.objectUtil.extendShape<{
211
208
  cookies: any[];
212
209
  password: string;
213
210
  jobUrl: string;
214
- agencyName: string;
215
- contractorName: string;
216
- specializedProfile: string | null;
217
211
  userId: string;
218
212
  campaignId: string;
219
213
  }, {
@@ -235,9 +229,6 @@ export declare const agencyBidSchema: z.ZodObject<z.objectUtil.extendShape<{
235
229
  cookies: any[];
236
230
  password: string;
237
231
  jobUrl: string;
238
- agencyName: string;
239
- contractorName: string;
240
- specializedProfile: string | null;
241
232
  userId: string;
242
233
  campaignId: string;
243
234
  }>;
@@ -26,9 +26,6 @@ exports.bidSchema = zod_1.z.object({
26
26
  password: zod_1.z.string(),
27
27
  });
28
28
  exports.agencyBidSchema = exports.bidSchema.extend({
29
- agencyName: zod_1.z.string(),
30
- contractorName: zod_1.z.string(),
31
- specializedProfile: zod_1.z.string().nullable(),
32
29
  formData: exports.agencyBidFormDataSchema,
33
30
  });
34
31
  exports.freelancerBidSchema = exports.bidSchema.extend({
@@ -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.105",
4
+ "version": "1.0.107",
5
5
  "description": "This package contains shared stuff.",
6
6
  "types": "./dist/index.d.ts",
7
7
  "main": "./dist/index.js",