lancer-shared 1.2.19 → 1.2.21
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/bundle.cjs.js +134 -23
- package/dist/constants/account-status.d.ts +3 -0
- package/dist/constants/account-status.js +17 -0
- package/dist/constants/collections.js +16 -0
- package/dist/constants/common-questions.js +60 -0
- package/dist/constants/index.d.ts +1 -1
- package/dist/constants/index.js +40 -0
- package/dist/constants/invoice.d.ts +2 -0
- package/dist/constants/job-filter-options.js +268 -0
- package/dist/constants/job-status.js +26 -0
- package/dist/constants/mappings/countryMapping.js +122 -0
- package/dist/constants/mappings/regionMapping.js +242 -0
- package/dist/constants/routes.js +108 -0
- package/dist/constants/upwork-accounts.js +21 -0
- package/dist/index.js +20 -0
- package/dist/schemas/account/account-status.js +11 -0
- package/dist/schemas/account/bidder-account.js +37 -0
- package/dist/schemas/account/index.js +19 -0
- package/dist/schemas/account/manager-account.d.ts +116 -0
- package/dist/schemas/account/manager-account.js +38 -0
- package/dist/schemas/account/scraper-account.js +37 -0
- package/dist/schemas/ai/ai-config.d.ts +36 -0
- package/dist/schemas/ai/ai-config.js +12 -0
- package/dist/schemas/ai/index.d.ts +3 -0
- package/dist/schemas/ai/index.js +19 -0
- package/dist/schemas/ai/proposal.d.ts +82 -0
- package/dist/schemas/ai/proposal.js +16 -0
- package/dist/schemas/ai/suitability.d.ts +37 -0
- package/dist/schemas/ai/suitability.js +17 -0
- package/dist/schemas/bid/bid-result.js +15 -0
- package/dist/schemas/bid/bid.js +36 -0
- package/dist/schemas/bid/index.js +18 -0
- package/dist/schemas/bidding/index.d.ts +1 -0
- package/dist/schemas/bidding/index.js +17 -0
- package/dist/schemas/bidding/proposal-bidding-status.d.ts +26 -0
- package/dist/schemas/bidding/proposal-bidding-status.js +18 -0
- package/dist/schemas/campaign/campaign-ai-metrics.js +9 -0
- package/dist/schemas/campaign/campaign-analytics.d.ts +2621 -38
- package/dist/schemas/campaign/campaign-analytics.js +41 -0
- package/dist/schemas/campaign/campaign-expenses.js +9 -0
- package/dist/schemas/campaign/campaign-insights.js +31 -0
- package/dist/schemas/campaign/campaign-integrations.js +16 -0
- package/dist/schemas/campaign/campaign-job-count.js +6 -0
- package/dist/schemas/campaign/campaign.js +44 -0
- package/dist/schemas/campaign/index.js +23 -0
- package/dist/schemas/chat-message/chat-message.js +13 -0
- package/dist/schemas/chat-message/index.js +17 -0
- package/dist/schemas/config/agency-config.js +10 -0
- package/dist/schemas/config/index.js +17 -0
- package/dist/schemas/index.js +32 -0
- package/dist/schemas/invoice/index.d.ts +8 -0
- package/dist/schemas/job/index.js +19 -0
- package/dist/schemas/job/job-details.d.ts +335 -0
- package/dist/schemas/job/job-details.js +29 -0
- package/dist/schemas/job/job-note.d.ts +83 -0
- package/dist/schemas/job/job-note.js +30 -0
- package/dist/schemas/job/job-status.d.ts +3 -0
- package/dist/schemas/job/job-status.js +27 -0
- package/dist/schemas/job/job.d.ts +1160 -0
- package/dist/schemas/job/job.js +90 -0
- package/dist/schemas/job/pipeline-job.d.ts +602 -0
- package/dist/schemas/job/pipeline-job.js +42 -0
- package/dist/schemas/job/upwork-job.d.ts +334 -0
- package/dist/schemas/job/upwork-job.js +60 -0
- package/dist/schemas/job-filters/index.js +17 -0
- package/dist/schemas/job-filters/job-filters.js +87 -0
- package/dist/schemas/lead/index.js +19 -0
- package/dist/schemas/lead/lead-note.js +30 -0
- package/dist/schemas/lead/lead-status.d.ts +23 -0
- package/dist/schemas/lead/lead-status.js +26 -0
- package/dist/schemas/lead/lead.d.ts +1897 -0
- package/dist/schemas/lead/lead.js +143 -0
- package/dist/schemas/logger/index.js +17 -0
- package/dist/schemas/logger/log-event.d.ts +13 -10
- package/dist/schemas/logger/log-event.js +66 -0
- package/dist/schemas/organization/index.d.ts +68 -1
- package/dist/schemas/organization/index.js +17 -0
- package/dist/schemas/organization/organization.d.ts +13 -87
- package/dist/schemas/organization/organization.js +19 -0
- package/dist/schemas/organization/subscription.d.ts +47 -0
- package/dist/schemas/plan/index.d.ts +36 -3
- package/dist/schemas/proxy/index.js +17 -0
- package/dist/schemas/proxy/proxy.js +21 -0
- package/dist/schemas/saved-search/index.js +12 -0
- package/dist/schemas/scraper/index.js +18 -0
- package/dist/schemas/scraper/scrape-payload.d.ts +49 -0
- package/dist/schemas/scraper/scrape-payload.js +16 -0
- package/dist/schemas/scraper/scrape-result.js +23 -0
- package/dist/schemas/shared.js +16 -0
- package/dist/schemas/time-filter/index.js +9 -0
- package/dist/schemas/upwork-account/index.d.ts +3 -0
- package/dist/schemas/upwork-account/index.js +19 -0
- package/dist/schemas/upwork-account/upwork-account-status.d.ts +2 -0
- package/dist/schemas/upwork-account/upwork-account-status.js +11 -0
- package/dist/schemas/upwork-account/upwork-business-manager-account.d.ts +95 -0
- package/dist/schemas/upwork-account/upwork-business-manager-account.js +35 -0
- package/dist/schemas/upwork-account/upwork-scraping-account.d.ts +90 -0
- package/dist/schemas/upwork-account/upwork-scraping-account.js +29 -0
- package/dist/schemas/user/index.js +55 -0
- package/dist/types/account/account-status.js +2 -0
- package/dist/types/account/bidder-account.js +2 -0
- package/dist/types/account/index.js +19 -0
- package/dist/types/account/manager-account.d.ts +7 -0
- package/dist/types/account/manager-account.js +2 -0
- package/dist/types/account/scraper-account.js +2 -0
- package/dist/types/ai/ai-config.d.ts +6 -0
- package/dist/types/ai/ai-config.js +2 -0
- package/dist/types/ai/index.d.ts +3 -0
- package/dist/types/ai/index.js +19 -0
- package/dist/types/ai/proposal.d.ts +10 -0
- package/dist/types/ai/proposal.js +2 -0
- package/dist/types/ai/suitability.d.ts +6 -0
- package/dist/types/ai/suitability.js +2 -0
- package/dist/types/bid/bid-result.js +2 -0
- package/dist/types/bid/bid.js +2 -0
- package/dist/types/bid/index.js +18 -0
- package/dist/types/bidding/index.d.ts +1 -0
- package/dist/types/bidding/index.js +17 -0
- package/dist/types/bidding/proposal-bidding-status.d.ts +3 -0
- package/dist/types/bidding/proposal-bidding-status.js +2 -0
- package/dist/types/campaign/campaign-analytics.js +2 -0
- package/dist/types/campaign/campaign-expenses.js +2 -0
- package/dist/types/campaign/campaign-insights.js +2 -0
- package/dist/types/campaign/campaign-integrations.js +2 -0
- package/dist/types/campaign/campaign-job-count.js +2 -0
- package/dist/types/campaign/campaign.js +2 -0
- package/dist/types/campaign/index.js +22 -0
- package/dist/types/chat-message/chat-message.js +2 -0
- package/dist/types/chat-message/index.js +17 -0
- package/dist/types/config/agency-config.js +2 -0
- package/dist/types/config/index.js +17 -0
- package/dist/types/index.js +29 -0
- package/dist/types/job/index.js +19 -0
- package/dist/types/job/job-details.d.ts +36 -0
- package/dist/types/job/job-details.js +2 -0
- package/dist/types/job/job-note.js +2 -0
- package/dist/types/job/job-status.js +12 -0
- package/dist/types/job/job.d.ts +36 -0
- package/dist/types/job/job.js +2 -0
- package/dist/types/job-filters/index.js +17 -0
- package/dist/types/job-filters/job-filters.js +2 -0
- package/dist/types/logger/index.js +17 -0
- package/dist/types/logger/log-event.js +2 -0
- package/dist/types/saved-search/index.js +2 -0
- package/dist/types/scraper/index.js +18 -0
- package/dist/types/scraper/scrape-payload.js +2 -0
- package/dist/types/scraper/scrape-result.js +2 -0
- package/dist/types/time-filter/index.js +2 -0
- package/dist/types/upwork-account/index.d.ts +3 -0
- package/dist/types/upwork-account/index.js +19 -0
- package/dist/types/upwork-account/upwork-account-status.d.ts +3 -0
- package/dist/types/upwork-account/upwork-account-status.js +2 -0
- package/dist/types/upwork-account/upwork-business-manager-account.d.ts +7 -0
- package/dist/types/upwork-account/upwork-business-manager-account.js +2 -0
- package/dist/types/upwork-account/upwork-scraping-account.d.ts +5 -0
- package/dist/types/upwork-account/upwork-scraping-account.js +2 -0
- package/dist/types/user/index.js +2 -0
- package/dist/utils/index.js +17 -0
- package/dist/utils/try-catch.js +25 -0
- package/package.json +1 -1
|
@@ -0,0 +1,19 @@
|
|
|
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("./job"), exports);
|
|
18
|
+
__exportStar(require("./job-note"), exports);
|
|
19
|
+
__exportStar(require("./job-status"), exports);
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { SavedSearch } from '../saved-search';
|
|
3
|
+
import { ClientInfoSchema, jobDetailsSchema, JobListItemSchema, JobMetadataSchema, jobPipelineDetailsSchema, jobPipelineResponseSchema, JobSkillsSchema, upworkJobDetailsSchema, VendorQualificationsSchema } from '../../schemas';
|
|
4
|
+
import { JobNote } from './job-note';
|
|
5
|
+
import { JobStatus } from './job-status';
|
|
6
|
+
import { QuestionAnswerPair } from '../ai';
|
|
7
|
+
export interface UpworkJob extends z.infer<typeof upworkJobDetailsSchema> {
|
|
8
|
+
clientInfo: ClientInfo | null;
|
|
9
|
+
metadata: JobMetadata | null;
|
|
10
|
+
skills: JobSkill[] | null;
|
|
11
|
+
vendorQualifications: VendorQualifications | null;
|
|
12
|
+
}
|
|
13
|
+
export interface Job extends z.infer<typeof jobDetailsSchema> {
|
|
14
|
+
clientInfo: ClientInfo | null;
|
|
15
|
+
metadata: JobMetadata | null;
|
|
16
|
+
skills: JobSkill[] | null;
|
|
17
|
+
vendorQualifications: VendorQualifications | null;
|
|
18
|
+
notes?: JobNote[];
|
|
19
|
+
suitabilityQuestionAnswerPairs?: QuestionAnswerPair[];
|
|
20
|
+
status?: JobStatus;
|
|
21
|
+
}
|
|
22
|
+
export interface JobPipeline extends z.infer<typeof jobPipelineDetailsSchema> {
|
|
23
|
+
clientInfo: Pick<ClientInfo, 'country'>;
|
|
24
|
+
metadata: Pick<JobMetadata, 'hourlyRate' | 'fixedPrice'>;
|
|
25
|
+
}
|
|
26
|
+
export interface JobPipelineResponse extends z.infer<typeof jobPipelineResponseSchema> {
|
|
27
|
+
jobs: JobPipeline[];
|
|
28
|
+
}
|
|
29
|
+
export type JobWithSavedSearch = Job & {
|
|
30
|
+
savedSearch?: SavedSearch | null;
|
|
31
|
+
};
|
|
32
|
+
export type JobListItem = z.infer<typeof JobListItemSchema>;
|
|
33
|
+
export type JobSkill = z.infer<typeof JobSkillsSchema>;
|
|
34
|
+
export type VendorQualifications = z.infer<typeof VendorQualificationsSchema>;
|
|
35
|
+
export type ClientInfo = z.infer<typeof ClientInfoSchema>;
|
|
36
|
+
export type JobMetadata = z.infer<typeof JobMetadataSchema>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.leadStatusDisplayMap = void 0;
|
|
4
|
+
exports.leadStatusDisplayMap = {
|
|
5
|
+
leads: "Leads",
|
|
6
|
+
contacted: "Contacted",
|
|
7
|
+
viewed: "Viewed",
|
|
8
|
+
replied: "Replied",
|
|
9
|
+
negotiations: "Negotiations",
|
|
10
|
+
won: "Won",
|
|
11
|
+
lost: "Lost",
|
|
12
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { SavedSearch } from "../saved-search";
|
|
3
|
+
import { LeadNote } from "./job-note";
|
|
4
|
+
import { LeadAgentStatus, LeadStatus } from "./job-status";
|
|
5
|
+
import { QuestionAnswerPair } from "../ai";
|
|
6
|
+
import { clientInfoSchema, jobListItemSchema, leadResponseSchema, leadSchema, jobSkillsSchema, metadataSchema, upworkJobSchema, vendorQualificationSchema, clientReviewSchema, bidRangeSchema, jobActivitySchema } from "../../schemas/lead/lead";
|
|
7
|
+
export interface Job extends z.infer<typeof upworkJobSchema> {
|
|
8
|
+
clientInfo: ClientInfo | null;
|
|
9
|
+
metadata: JobMetadata | null;
|
|
10
|
+
skills: JobSkill[] | null;
|
|
11
|
+
vendorQualifications: VendorQualifications | null;
|
|
12
|
+
}
|
|
13
|
+
export interface Lead extends z.infer<typeof leadSchema> {
|
|
14
|
+
clientInfo: ClientInfo | null;
|
|
15
|
+
metadata: JobMetadata | null;
|
|
16
|
+
skills: JobSkill[] | null;
|
|
17
|
+
vendorQualifications: VendorQualifications | null;
|
|
18
|
+
notes: LeadNote[] | null;
|
|
19
|
+
questionAnswerPairs: QuestionAnswerPair[] | null;
|
|
20
|
+
agentStatus: LeadAgentStatus;
|
|
21
|
+
leadStatus: LeadStatus;
|
|
22
|
+
}
|
|
23
|
+
export interface LeadResponse extends z.infer<typeof leadResponseSchema> {
|
|
24
|
+
leads: Lead[];
|
|
25
|
+
}
|
|
26
|
+
export type JobWithSavedSearch = Lead & {
|
|
27
|
+
savedSearch?: SavedSearch | null;
|
|
28
|
+
};
|
|
29
|
+
export type JobListItem = z.infer<typeof jobListItemSchema>;
|
|
30
|
+
export type JobSkill = z.infer<typeof jobSkillsSchema>;
|
|
31
|
+
export type VendorQualifications = z.infer<typeof vendorQualificationSchema>;
|
|
32
|
+
export type ClientInfo = z.infer<typeof clientInfoSchema>;
|
|
33
|
+
export type JobMetadata = z.infer<typeof metadataSchema>;
|
|
34
|
+
export type ClientReview = z.infer<typeof clientReviewSchema>;
|
|
35
|
+
export type JobBidRange = z.infer<typeof bidRangeSchema>;
|
|
36
|
+
export type JobActivity = z.infer<typeof jobActivitySchema>;
|
|
@@ -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("./job-filters"), exports);
|
|
@@ -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("./log-event"), exports);
|
|
@@ -0,0 +1,18 @@
|
|
|
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("./scrape-payload"), exports);
|
|
18
|
+
__exportStar(require("./scrape-result"), exports);
|
|
@@ -0,0 +1,19 @@
|
|
|
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("./upwork-account-status"), exports);
|
|
18
|
+
__exportStar(require("./upwork-business-manager-account"), exports);
|
|
19
|
+
__exportStar(require("./upwork-scraping-account"), exports);
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { createUpworkBusinessManagerAccountSchema, updateUpworkBusinessManagerAccountSchema, upworkBusinessManagerAccountProvider, upworkBusinessManagerAccountSchema } from '../../schemas';
|
|
3
|
+
export interface UpworkBusinessManagerAccount extends z.infer<typeof upworkBusinessManagerAccountSchema> {
|
|
4
|
+
}
|
|
5
|
+
export type UpworkBusinessManagerAccountProvider = z.infer<typeof upworkBusinessManagerAccountProvider>;
|
|
6
|
+
export type CreateUpworkBusinessManagerAccount = z.infer<typeof createUpworkBusinessManagerAccountSchema>;
|
|
7
|
+
export type UpdateUpworkBusinessManagerAccount = z.infer<typeof updateUpworkBusinessManagerAccountSchema>;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { createUpworkScraperAccountSchema, updateUpworkScraperAccountSchema, upworkScrapingAccountSchema } from '../../schemas';
|
|
3
|
+
export type UpworkScrapingAccount = z.infer<typeof upworkScrapingAccountSchema>;
|
|
4
|
+
export type CreateUpworkScraperAccount = z.infer<typeof createUpworkScraperAccountSchema>;
|
|
5
|
+
export type UpdateUpworkScraperAccount = z.infer<typeof updateUpworkScraperAccountSchema>;
|
|
@@ -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,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;
|