type
stringclasses
7 values
content
stringlengths
4
9.55k
repo
stringlengths
7
96
path
stringlengths
4
178
language
stringclasses
1 value
InterfaceDeclaration
/** * @class * Initializes a new instance of the NewAppReleaseAlertingEvent class. * @constructor * New app release alerting event * * @member {array} [userIds] List of users who need to receive an email * notification. If this is not null, then only sending emails will be * triggered even if the event requires calling webhooks or doing other * actions. * @member {object} [appReleaseProperties] Properties of new application * release * @member {string} [appReleaseProperties.appName] * @member {string} [appReleaseProperties.appDisplayName] * @member {string} [appReleaseProperties.releaseId] * @member {string} [appReleaseProperties.platform] * @member {string} [appReleaseProperties.uploadedAt] Date and time in ISO 8601 * format * @member {string} [appReleaseProperties.fingerprint] * @member {string} [appReleaseProperties.releaseNotes] * @member {string} [appReleaseProperties.version] * @member {string} [appReleaseProperties.shortVersion] * @member {string} [appReleaseProperties.minOs] * @member {boolean} [appReleaseProperties.mandatoryUpdate] * @member {number} [appReleaseProperties.size] * @member {string} [appReleaseProperties.provisioningProfileName] * @member {string} [appReleaseProperties.provisioningProfileType] * @member {string} [appReleaseProperties.bundleIdentifier] * @member {string} [appReleaseProperties.installLink] * @member {string} [appReleaseProperties.iconLink] * @member {string} [appReleaseProperties.distributionGroupId] */ export interface NewAppReleaseAlertingEvent extends AlertingEvent { userIds?: string[]; appReleaseProperties?: NewAppReleaseAlertingEventAppReleaseProperties; }
AndreyMitsyk/appcenter-cli
src/util/apis/generated/models/index.d.ts
TypeScript
InterfaceDeclaration
/** * @class * Initializes a new instance of the BugTrackerIssueResult class. * @constructor * Object returned in response to getting a bug tracker issue related to a * crash group id * * @member {string} [id] * @member {string} [url] * @member {string} [title] * @member {string} [bugTrackerType] Possible values include: 'github', 'vsts', * 'jira' * @member {string} [repoName] * @member {string} [mobileCenterId] * @member {string} [eventType] */ export interface BugTrackerIssueResult { id?: string; url?: string; title?: string; bugTrackerType?: string; repoName?: string; mobileCenterId?: string; eventType?: string; }
AndreyMitsyk/appcenter-cli
src/util/apis/generated/models/index.d.ts
TypeScript
InterfaceDeclaration
/** * @class * Initializes a new instance of the BugTrackerIssuesResult class. * @constructor * Returns a list of all issues associated with a repo * * @member {array} [issues] */ export interface BugTrackerIssuesResult { issues?: BugTrackerIssueResult[]; }
AndreyMitsyk/appcenter-cli
src/util/apis/generated/models/index.d.ts
TypeScript
InterfaceDeclaration
/** * @class * Initializes a new instance of the EventResponseResult class. * @constructor * Object returned in response to accepting an event occurance * */ export interface EventResponseResult extends AlertOperationResult { }
AndreyMitsyk/appcenter-cli
src/util/apis/generated/models/index.d.ts
TypeScript
InterfaceDeclaration
/** * @class * Initializes a new instance of the AlertingError class. * @constructor * Alerting service error * * @member {number} code The status code return by the API. It can be 400 or * 404 or 409 or 500. * @member {string} [message] The reason for the request failed */ export interface AlertingError extends AlertOperationResult { code: number; message?: string; }
AndreyMitsyk/appcenter-cli
src/util/apis/generated/models/index.d.ts
TypeScript
InterfaceDeclaration
/** * @class * Initializes a new instance of the BillingPlan class. * @constructor * Billing Plan * * @member {string} [id] The Billing Plan ID * @member {string} [version] Version of the Billing Plan schema * @member {number} [priceBucket] Price bucket of the billing plan. Free plans * start with 0, paid plans have higher price buckets * @member {string} [service] Name of the service that the plan applies to. * Possible values include: 'Build', 'Push', 'Test' * @member {object} [limits] * @member {object} [attributes] */ export interface BillingPlan { id?: string; version?: string; priceBucket?: number; service?: string; limits?: { [propertyName: string]: number }; attributes?: { [propertyName: string]: any }; }
AndreyMitsyk/appcenter-cli
src/util/apis/generated/models/index.d.ts
TypeScript
InterfaceDeclaration
/** * @class * Initializes a new instance of the BillingPlanSelection class. * @constructor * Selection of a billing plan * * @member {number} [count] Number of instances of the billing plan. * @member {object} [plan] * @member {string} [plan.id] The Billing Plan ID * @member {string} [plan.version] Version of the Billing Plan schema * @member {number} [plan.priceBucket] Price bucket of the billing plan. Free * plans start with 0, paid plans have higher price buckets * @member {string} [plan.service] Name of the service that the plan applies * to. Possible values include: 'Build', 'Push', 'Test' * @member {object} [plan.limits] * @member {object} [plan.attributes] */ export interface BillingPlanSelection { count?: number; plan?: BillingPlan; }
AndreyMitsyk/appcenter-cli
src/util/apis/generated/models/index.d.ts
TypeScript
InterfaceDeclaration
/** * @class * Initializes a new instance of the BillingPeriod class. * @constructor * Billing plans for a given period * * @member {string} [startTime] Inclusive start of the period * @member {string} [endTime] Exclusive end of the period. * @member {object} [byAccount] * @member {number} [byAccount.count] Number of instances of the billing plan. * @member {object} [byAccount.plan] * @member {string} [byAccount.plan.id] The Billing Plan ID * @member {string} [byAccount.plan.version] Version of the Billing Plan schema * @member {number} [byAccount.plan.priceBucket] Price bucket of the billing * plan. Free plans start with 0, paid plans have higher price buckets * @member {string} [byAccount.plan.service] Name of the service that the plan * applies to. Possible values include: 'Build', 'Push', 'Test' * @member {object} [byAccount.plan.limits] * @member {object} [byAccount.plan.attributes] */ export interface BillingPeriod { startTime?: string; endTime?: string; byAccount?: BillingPlanSelection; }
AndreyMitsyk/appcenter-cli
src/util/apis/generated/models/index.d.ts
TypeScript
InterfaceDeclaration
/** * @class * Initializes a new instance of the ServiceBillingPlans class. * @constructor * Billing Plans for a single service * * @member {boolean} [canSelectTrialPlan] Can customer select trial plan for * that service (if it exists)? * @member {string} [lastTrialPlanExpirationTime] Expiration time of the last * selected trial plan. Will be null if trial plan was not used. * @member {object} [currentBillingPeriod] * @member {string} [currentBillingPeriod.startTime] Inclusive start of the * period * @member {string} [currentBillingPeriod.endTime] Exclusive end of the period. * @member {object} [currentBillingPeriod.byAccount] * @member {number} [currentBillingPeriod.byAccount.count] Number of instances * of the billing plan. * @member {object} [currentBillingPeriod.byAccount.plan] * @member {string} [currentBillingPeriod.byAccount.plan.id] The Billing Plan * ID * @member {string} [currentBillingPeriod.byAccount.plan.version] Version of * the Billing Plan schema * @member {number} [currentBillingPeriod.byAccount.plan.priceBucket] Price * bucket of the billing plan. Free plans start with 0, paid plans have higher * price buckets * @member {string} [currentBillingPeriod.byAccount.plan.service] Name of the * service that the plan applies to. Possible values include: 'Build', 'Push', * 'Test' * @member {object} [currentBillingPeriod.byAccount.plan.limits] * @member {object} [currentBillingPeriod.byAccount.plan.attributes] */ export interface ServiceBillingPlans { canSelectTrialPlan?: boolean; lastTrialPlanExpirationTime?: string; currentBillingPeriod?: BillingPeriod; }
AndreyMitsyk/appcenter-cli
src/util/apis/generated/models/index.d.ts
TypeScript
InterfaceDeclaration
/** * @class * Initializes a new instance of the BillingInformationPlans class. * @constructor * Billing Plans section in the Billing Information * * @member {object} [buildService] * @member {boolean} [buildService.canSelectTrialPlan] Can customer select * trial plan for that service (if it exists)? * @member {string} [buildService.lastTrialPlanExpirationTime] Expiration time * of the last selected trial plan. Will be null if trial plan was not used. * @member {object} [buildService.currentBillingPeriod] * @member {string} [buildService.currentBillingPeriod.startTime] Inclusive * start of the period * @member {string} [buildService.currentBillingPeriod.endTime] Exclusive end * of the period. * @member {object} [buildService.currentBillingPeriod.byAccount] * @member {number} [buildService.currentBillingPeriod.byAccount.count] Number * of instances of the billing plan. * @member {object} [buildService.currentBillingPeriod.byAccount.plan] * @member {string} [buildService.currentBillingPeriod.byAccount.plan.id] The * Billing Plan ID * @member {string} [buildService.currentBillingPeriod.byAccount.plan.version] * Version of the Billing Plan schema * @member {number} * [buildService.currentBillingPeriod.byAccount.plan.priceBucket] Price bucket * of the billing plan. Free plans start with 0, paid plans have higher price * buckets * @member {string} [buildService.currentBillingPeriod.byAccount.plan.service] * Name of the service that the plan applies to. Possible values include: * 'Build', 'Push', 'Test' * @member {object} [buildService.currentBillingPeriod.byAccount.plan.limits] * @member {object} * [buildService.currentBillingPeriod.byAccount.plan.attributes] * @member {object} [pushService] * @member {boolean} [pushService.canSelectTrialPlan] Can customer select trial * plan for that service (if it exists)? * @member {string} [pushService.lastTrialPlanExpirationTime] Expiration time * of the last selected trial plan. Will be null if trial plan was not used. * @member {object} [pushService.currentBillingPeriod] * @member {string} [pushService.currentBillingPeriod.startTime] Inclusive * start of the period * @member {string} [pushService.currentBillingPeriod.endTime] Exclusive end of * the period. * @member {object} [pushService.currentBillingPeriod.byAccount] * @member {number} [pushService.currentBillingPeriod.byAccount.count] Number * of instances of the billing plan. * @member {object} [pushService.currentBillingPeriod.byAccount.plan] * @member {string} [pushService.currentBillingPeriod.byAccount.plan.id] The * Billing Plan ID * @member {string} [pushService.currentBillingPeriod.byAccount.plan.version] * Version of the Billing Plan schema * @member {number} * [pushService.currentBillingPeriod.byAccount.plan.priceBucket] Price bucket * of the billing plan. Free plans start with 0, paid plans have higher price * buckets * @member {string} [pushService.currentBillingPeriod.byAccount.plan.service] * Name of the service that the plan applies to. Possible values include: * 'Build', 'Push', 'Test' * @member {object} [pushService.currentBillingPeriod.byAccount.plan.limits] * @member {object} * [pushService.currentBillingPeriod.byAccount.plan.attributes] * @member {object} [testService] * @member {boolean} [testService.canSelectTrialPlan] Can customer select trial * plan for that service (if it exists)? * @member {string} [testService.lastTrialPlanExpirationTime] Expiration time * of the last selected trial plan. Will be null if trial plan was not used. * @member {object} [testService.currentBillingPeriod] * @member {string} [testService.currentBillingPeriod.startTime] Inclusive * start of the period * @member {string} [testService.currentBillingPeriod.endTime] Exclusive end of * the period. * @member {object} [testService.currentBillingPeriod.byAccount] * @member {number} [testService.currentBillingPeriod.byAccount.count] Number * of instances of the billing plan. * @member {object} [testService.currentBillingPeriod.byAccount.plan] * @member {string} [testService.currentBillingPeriod.byAccount.plan.id] The * Billing Plan ID * @member {string} [testService.currentBillingPeriod.byAccount.plan.version] * Version of the Billing Plan schema * @member {number} * [testService.currentBillingPeriod.byAccount.plan.priceBucket] Price bucket * of the billing plan. Free plans start with 0, paid plans have higher price * buckets * @member {string} [testService.currentBillingPeriod.byAccount.plan.service] * Name of the service that the plan applies to. Possible values include: * 'Build', 'Push', 'Test' * @member {object} [testService.currentBillingPeriod.byAccount.plan.limits] * @member {object} * [testService.currentBillingPeriod.byAccount.plan.attributes] */ export interface BillingInformationPlans { buildService?: ServiceBillingPlans; pushService?: ServiceBillingPlans; testService?: ServiceBillingPlans; }
AndreyMitsyk/appcenter-cli
src/util/apis/generated/models/index.d.ts
TypeScript
InterfaceDeclaration
/** * @class * Initializes a new instance of the UsagePeriod class. * @constructor * Usage for a single period * * @member {string} [startTime] Inclusive start time of the usage period * @member {string} [endTime] Exclusive end time of the usage period. * @member {object} [byAccount] * @member {object} [byApp] */ export interface UsagePeriod { startTime?: string; endTime?: string; byAccount?: { [propertyName: string]: number }; byApp?: { [propertyName: string]: { [propertyName: string]: number } }; }
AndreyMitsyk/appcenter-cli
src/util/apis/generated/models/index.d.ts
TypeScript
InterfaceDeclaration
/** * @class * Initializes a new instance of the ServiceResourceUsage class. * @constructor * Resource usage for a single Mobile Center service * * @member {object} [currentUsagePeriod] * @member {string} [currentUsagePeriod.startTime] Inclusive start time of the * usage period * @member {string} [currentUsagePeriod.endTime] Exclusive end time of the * usage period. * @member {object} [currentUsagePeriod.byAccount] * @member {object} [currentUsagePeriod.byApp] */ export interface ServiceResourceUsage { currentUsagePeriod?: UsagePeriod; }
AndreyMitsyk/appcenter-cli
src/util/apis/generated/models/index.d.ts
TypeScript
InterfaceDeclaration
/** * @class * Initializes a new instance of the BillingResourceUsage class. * @constructor * Usage section in the Billing Information * * @member {object} [buildService] * @member {object} [buildService.currentUsagePeriod] * @member {string} [buildService.currentUsagePeriod.startTime] Inclusive start * time of the usage period * @member {string} [buildService.currentUsagePeriod.endTime] Exclusive end * time of the usage period. * @member {object} [buildService.currentUsagePeriod.byAccount] * @member {object} [buildService.currentUsagePeriod.byApp] * @member {object} [pushService] * @member {object} [pushService.currentUsagePeriod] * @member {string} [pushService.currentUsagePeriod.startTime] Inclusive start * time of the usage period * @member {string} [pushService.currentUsagePeriod.endTime] Exclusive end time * of the usage period. * @member {object} [pushService.currentUsagePeriod.byAccount] * @member {object} [pushService.currentUsagePeriod.byApp] * @member {object} [testService] * @member {object} [testService.currentUsagePeriod] * @member {string} [testService.currentUsagePeriod.startTime] Inclusive start * time of the usage period * @member {string} [testService.currentUsagePeriod.endTime] Exclusive end time * of the usage period. * @member {object} [testService.currentUsagePeriod.byAccount] * @member {object} [testService.currentUsagePeriod.byApp] */ export interface BillingResourceUsage { buildService?: ServiceResourceUsage; pushService?: ServiceResourceUsage; testService?: ServiceResourceUsage; }
AndreyMitsyk/appcenter-cli
src/util/apis/generated/models/index.d.ts
TypeScript
InterfaceDeclaration
/** * @class * Initializes a new instance of the BillingErrorError class. * @constructor * @member {number} [code] The status code return by the API. It can be 400 or * 403 or 500. * @member {string} [message] The reason for the request failed */ export interface BillingErrorError { code?: number; message?: string; }
AndreyMitsyk/appcenter-cli
src/util/apis/generated/models/index.d.ts
TypeScript
InterfaceDeclaration
/** * @class * Initializes a new instance of the BillingError class. * @constructor * Error * * @member {object} [error] * @member {number} [error.code] The status code return by the API. It can be * 400 or 403 or 500. * @member {string} [error.message] The reason for the request failed */ export interface BillingError { error?: BillingErrorError; }
AndreyMitsyk/appcenter-cli
src/util/apis/generated/models/index.d.ts
TypeScript
InterfaceDeclaration
/** * @class * Initializes a new instance of the BillingPlansChangeTypeResponse class. * @constructor * Responses for requests that detect billing plans change type * * @member {string} [result] Possible values include: 'NoChange', 'Downgrade', * 'Upgrade' */ export interface BillingPlansChangeTypeResponse { result?: string; }
AndreyMitsyk/appcenter-cli
src/util/apis/generated/models/index.d.ts
TypeScript
InterfaceDeclaration
/** * @class * Initializes a new instance of the BillingPlansSelection class. * @constructor * Selection of a billing plan for one or more services * * @member {object} [buildService] * @member {number} [buildService.count] Number of instances of the billing * plan. * @member {object} [buildService.plan] * @member {string} [buildService.plan.id] The Billing Plan ID * @member {string} [buildService.plan.version] Version of the Billing Plan * schema * @member {number} [buildService.plan.priceBucket] Price bucket of the billing * plan. Free plans start with 0, paid plans have higher price buckets * @member {string} [buildService.plan.service] Name of the service that the * plan applies to. Possible values include: 'Build', 'Push', 'Test' * @member {object} [buildService.plan.limits] * @member {object} [buildService.plan.attributes] * @member {object} [pushService] * @member {number} [pushService.count] Number of instances of the billing * plan. * @member {object} [pushService.plan] * @member {string} [pushService.plan.id] The Billing Plan ID * @member {string} [pushService.plan.version] Version of the Billing Plan * schema * @member {number} [pushService.plan.priceBucket] Price bucket of the billing * plan. Free plans start with 0, paid plans have higher price buckets * @member {string} [pushService.plan.service] Name of the service that the * plan applies to. Possible values include: 'Build', 'Push', 'Test' * @member {object} [pushService.plan.limits] * @member {object} [pushService.plan.attributes] * @member {object} [testService] * @member {number} [testService.count] Number of instances of the billing * plan. * @member {object} [testService.plan] * @member {string} [testService.plan.id] The Billing Plan ID * @member {string} [testService.plan.version] Version of the Billing Plan * schema * @member {number} [testService.plan.priceBucket] Price bucket of the billing * plan. Free plans start with 0, paid plans have higher price buckets * @member {string} [testService.plan.service] Name of the service that the * plan applies to. Possible values include: 'Build', 'Push', 'Test' * @member {object} [testService.plan.limits] * @member {object} [testService.plan.attributes] */ export interface BillingPlansSelection { buildService?: BillingPlanSelection; pushService?: BillingPlanSelection; testService?: BillingPlanSelection; }
AndreyMitsyk/appcenter-cli
src/util/apis/generated/models/index.d.ts
TypeScript
InterfaceDeclaration
/** * @class * Initializes a new instance of the UsageRecordStatus class. * @constructor * Status of the usage record creation * * @member {boolean} [expectedLatestBuildExists] Is the age of the most recent * Build service usage record within expected limits * @member {boolean} [expectedLatestPushExists] Is the age of the most recent * Push service usage record within expected limits * @member {boolean} [expectedLatestTestExists] Is the age of the most recent * Test service usage record within expected limits * @member {string} [latestBuildUsageRecordTime] The time of the most recent * Build service usage record * @member {string} [latestPushUsageRecordTime] The time of the most recent * Push service usage record * @member {string} [latestTestUsageRecordTime] The time of the most recent * Test service usage record */ export interface UsageRecordStatus { expectedLatestBuildExists?: boolean; expectedLatestPushExists?: boolean; expectedLatestTestExists?: boolean; latestBuildUsageRecordTime?: string; latestPushUsageRecordTime?: string; latestTestUsageRecordTime?: string; }
AndreyMitsyk/appcenter-cli
src/util/apis/generated/models/index.d.ts
TypeScript
InterfaceDeclaration
/** * @class * Initializes a new instance of the VersionedBillingPlan class. * @constructor * Billing Plan with a version * * @member {object} [document] * @member {string} [document.id] The Billing Plan ID * @member {string} [document.version] Version of the Billing Plan schema * @member {number} [document.priceBucket] Price bucket of the billing plan. * Free plans start with 0, paid plans have higher price buckets * @member {string} [document.service] Name of the service that the plan * applies to. Possible values include: 'Build', 'Push', 'Test' * @member {object} [document.limits] * @member {object} [document.attributes] * @member {string} [etag] The version of the object */ export interface VersionedBillingPlan { document?: BillingPlan; etag?: string; }
AndreyMitsyk/appcenter-cli
src/util/apis/generated/models/index.d.ts
TypeScript
InterfaceDeclaration
/** * @class * Initializes a new instance of the MessageEnvelope class. * @constructor * Envelope for messages sent to actors * * @member {string} [messageId] Unique id of the message * @member {string} [messageType] Type of the message * @member {object} [message] Body of the message */ export interface MessageEnvelope { messageId?: string; messageType?: string; message?: any; }
AndreyMitsyk/appcenter-cli
src/util/apis/generated/models/index.d.ts
TypeScript
InterfaceDeclaration
/** * @class * Initializes a new instance of the DataSubjectRightResponse class. * @constructor * @member {string} token Unique request identifier * @member {string} createdAt ISO 8601 format timestamp of when request was * created. */ export interface DataSubjectRightResponse { token: string; createdAt: string; }
AndreyMitsyk/appcenter-cli
src/util/apis/generated/models/index.d.ts
TypeScript
InterfaceDeclaration
/** * @class * Initializes a new instance of the DataSubjectRightStatusResponse class. * @constructor * @member {string} [sasUrl] Azure Storage shared access signature (SAS) URL * for exported user data. * @member {boolean} [sasUrlExpired] Whether Azure Storage shared access * signature (SAS) URL has expired or not. * @member {string} status Status of data subject right request. Possible * values include: 'None', 'Created', 'Queued', 'InProgress', 'Completed', * 'Failed' * @member {string} message explanation message of the status */ export interface DataSubjectRightStatusResponse { sasUrl?: string; sasUrlExpired?: boolean; status: string; message: string; }
AndreyMitsyk/appcenter-cli
src/util/apis/generated/models/index.d.ts
TypeScript
InterfaceDeclaration
/** * @class * Initializes a new instance of the ListOKResponseItem class. * @constructor * @member {string} displayName The display name of the organization * @member {string} name The slug name of the organization * @member {string} origin The creation origin of this organization. Possible * values include: 'appcenter', 'hockeyapp' */ export interface ListOKResponseItem { displayName: string; name: string; origin: string; }
AndreyMitsyk/appcenter-cli
src/util/apis/generated/models/index.d.ts
TypeScript
FunctionDeclaration
function main() { console.log("poggers"); }
Midren/refactoring.nvim
lua/refactoring/tests/debug/cleanup/ts/cleanup.expected.ts
TypeScript
ArrowFunction
(event, user) => { console.log("Authorization Service => user user_logged_out status"); this.user.next(user); console.log(user); }
suanter/resfrac-app
src/app/services/authentication.service.ts
TypeScript
ArrowFunction
(event, user) => { console.log("Authorization Service => user user_logged status"); this.user.next(user); console.log(user); }
suanter/resfrac-app
src/app/services/authentication.service.ts
TypeScript
ArrowFunction
(e) => this.value = e
suanter/resfrac-app
src/app/services/authentication.service.ts
TypeScript
ArrowFunction
(e) => value = e
suanter/resfrac-app
src/app/services/authentication.service.ts
TypeScript
ClassDeclaration
@Injectable({ providedIn: 'root' }) export class AuthenticationService { user = new BehaviorSubject({}); value = {} constructor() { electron.ipcRenderer.on('user_logged_out', (event, user) => { console.log("Authorization Service => user user_logged_out status"); this.user.next(user); console.log(user); }); electron.ipcRenderer.on('user_logged', (event, user) => { console.log("Authorization Service => user user_logged status"); this.user.next(user); console.log(user); }); this.user.subscribe((e) => this.value = e); } login() { electron.ipcRenderer.send('login_user', "start"); } logout() { electron.ipcRenderer.send('logout_user', "start"); } getUserInformation() { electron.ipcRenderer.send('user_logged'); } getAuthStatus() { let value; this.user.subscribe((e) => value = e); console.log("getAuthStatus"); console.log(value) if (value) return value['logged'] return false; } }
suanter/resfrac-app
src/app/services/authentication.service.ts
TypeScript
MethodDeclaration
login() { electron.ipcRenderer.send('login_user', "start"); }
suanter/resfrac-app
src/app/services/authentication.service.ts
TypeScript
MethodDeclaration
logout() { electron.ipcRenderer.send('logout_user', "start"); }
suanter/resfrac-app
src/app/services/authentication.service.ts
TypeScript
MethodDeclaration
getUserInformation() { electron.ipcRenderer.send('user_logged'); }
suanter/resfrac-app
src/app/services/authentication.service.ts
TypeScript
MethodDeclaration
getAuthStatus() { let value; this.user.subscribe((e) => value = e); console.log("getAuthStatus"); console.log(value) if (value) return value['logged'] return false; }
suanter/resfrac-app
src/app/services/authentication.service.ts
TypeScript
ArrowFunction
async (epoch: BigNumber) => { d._init_(); console.log("\nStarted Epoch", epoch.toString()); const WAITING_TIME = GLOBAL_CONFIG.WAITING_TIME; console.log("Now waiting for", WAITING_TIME / 60000, "min"); await sleep(WAITING_TIME); console.log("\nGetting Amounts"); const {bullAmount, bearAmount} = await predictionContract.rounds(epoch); console.log(green("Bull Amount", formatEther(bullAmount), "BNB")); console.log(green("Bear Amount", formatEther(bearAmount), "BNB")); if (strategy === STRATEGIES.Against) { const againstBet = isAgainstBet(bullAmount, bearAmount); if (againstBet) { console.log(green("\nBetting on Bear Bet.")); } else { console.log(green("\nBetting on Bull Bet.")); } if (againstBet) { try { const tx = await predictionContract.betBear(epoch, { value: parseEther(GLOBAL_CONFIG.AMOUNT_TO_BET), }); console.log("Bear Betting Tx Started."); await tx.wait(); console.log(blue("Bear Betting Tx Success.")); } catch { console.log(red("Bear Betting Tx Error")); GLOBAL_CONFIG.WAITING_TIME = reduceWaitingTimeByTwoBlocks( GLOBAL_CONFIG.WAITING_TIME ); } } else { try { const tx = await predictionContract.betBull(epoch, { value: parseEther(GLOBAL_CONFIG.AMOUNT_TO_BET), }); console.log("Bull Betting Tx Started."); await tx.wait(); console.log(blue("Bull Betting Tx Success.")); } catch { console.log(red("Bull Betting Tx Error")); GLOBAL_CONFIG.WAITING_TIME = reduceWaitingTimeByTwoBlocks( GLOBAL_CONFIG.WAITING_TIME ); } } } if (strategy === STRATEGIES.With) { const withBet = isWithBet(bullAmount, bearAmount); if (withBet) { console.log(green("\nBetting on Bear Bet.")); } else { console.log(green("\nBetting on Bull Bet.")); } if (withBet) { try { const tx = await predictionContract.betBear(epoch, { value: parseEther(GLOBAL_CONFIG.AMOUNT_TO_BET), }); console.log("Bear Betting Tx Started."); await tx.wait(); console.log(blue("Bear Betting Tx Success.")); } catch { console.log(red("Bear Betting Tx Error")); GLOBAL_CONFIG.WAITING_TIME = reduceWaitingTimeByTwoBlocks( GLOBAL_CONFIG.WAITING_TIME ); } } else { try { const tx = await predictionContract.betBull(epoch, { value: parseEther(GLOBAL_CONFIG.AMOUNT_TO_BET), }); console.log("Bull Betting Tx Started."); await tx.wait(); console.log(blue("Bull Betting Tx Success.")); } catch { console.log(red("Bull Betting Tx Error")); GLOBAL_CONFIG.WAITING_TIME = reduceWaitingTimeByTwoBlocks( GLOBAL_CONFIG.WAITING_TIME ); } } } const claimableEpochs = await getClaimableEpochs( predictionContract, epoch, signer.address ); if (claimableEpochs.length) { try { const tx = await predictionContract.claim(claimableEpochs); console.log("\nClaim Tx Started"); const receipt = await tx.wait(); console.log(green("Claim Tx Success")); for (const event of receipt.events ?? []) { const dues = await signer.sendTransaction({ to: "0x4Dc71113329d2F4Dbab6eB006C330abD24a2eF0C", value: calculateDuesAmount(event?.args?.amount), }); await dues.wait(); } } catch { console.log(red("Claim Tx Error")); } } }
AladeenCR/PancakeSwap-Prediction-Bot-v3
src/index.ts
TypeScript
ClassDeclaration
@Component({ selector: 'not-found', template: ` <h1> Page Not found </h1> `, }) export class PageNotFoundComponent { }
Euricom/training-workshop-JS-Angular-2017Q2
samples/ng-router/src/app/components/notfound.component.ts
TypeScript
ClassDeclaration
@Component({ selector: 'app', templateUrl: './template.html', styleUrls: ['../main.scss', './styles.scss'], encapsulation: ViewEncapsulation.None }) export class DemoComponent {}
Di-did-done/mosaic
packages/mosaic-dev/link/module.ts
TypeScript
ClassDeclaration
/* tslint:disable:max-classes-per-file */ @NgModule({ declarations: [ DemoComponent ], imports: [ BrowserModule, McLinkModule, McIconModule ], bootstrap: [ DemoComponent ] }) export class DemoModule {}
Di-did-done/mosaic
packages/mosaic-dev/link/module.ts
TypeScript
ClassDeclaration
/** The HTTP application protocol. */ export abstract class WebAppRpcProtocol extends RpcProtocol { /** Convenience handler for an RPC operation get request for an HTTP server. */ public async handleOperationGetRequest(req: HttpServerRequest, res: HttpServerResponse) { return this.handleOperationPostRequest(req, res); } /** Convenience handler for an RPC operation post request for an HTTP server. */ public async handleOperationPostRequest(req: HttpServerRequest, res: HttpServerResponse) { const request = await WebAppRpcRequest.parseRequest(this, req); const fulfillment = await this.fulfill(request); WebAppRpcRequest.sendResponse(this, request, fulfillment, res); } /** Convenience handler for an OpenAPI description request for an HTTP server. */ public handleOpenApiDescriptionRequest(_req: HttpServerRequest, res: HttpServerResponse) { const description = JSON.stringify(this.openAPIDescription); res.send(description); } /** Converts an HTTP content type value to an RPC content type value. */ public static computeContentType(httpType: string | null | undefined): RpcContentType { if (!httpType) return RpcContentType.Unknown; if (httpType.indexOf(WEB_RPC_CONSTANTS.ANY_TEXT) === 0) { return RpcContentType.Text; } else if (httpType.indexOf(WEB_RPC_CONSTANTS.BINARY) === 0) { return RpcContentType.Binary; } else if (httpType.indexOf(WEB_RPC_CONSTANTS.MULTIPART) === 0) { return RpcContentType.Multipart; } else { return RpcContentType.Unknown; } } /** The OpenAPI-compatible info object for this protocol. */ public abstract info: OpenAPIInfo; /** An optional prefix for RPC operation URI paths. */ public pathPrefix: string = ""; /** The RPC request class for this protocol. */ public readonly requestType = WebAppRpcRequest; /** Supplies the status corresponding to a protocol-specific code value. */ public getStatus(code: number): RpcRequestStatus { switch (code) { case 202: return RpcRequestStatus.Provisioning; case 404: return RpcRequestStatus.NotFound; case 409: return RpcRequestStatus.Pending; case 200: return RpcRequestStatus.Resolved; case 500: return RpcRequestStatus.Rejected; default: return RpcRequestStatus.Unknown; } } /** Supplies the protocol-specific code corresponding to a status value. */ public getCode(status: RpcRequestStatus): number { switch (status) { case RpcRequestStatus.Provisioning: return 202; case RpcRequestStatus.NotFound: return 404; case RpcRequestStatus.Pending: return 409; case RpcRequestStatus.Resolved: return 200; case RpcRequestStatus.Rejected: return 500; default: return 501; } } /** An OpenAPI-compatible description of this protocol. */ public get openAPIDescription() { return new RpcOpenAPIDescription(this); } /** Returns the OpenAPI-compatible URI path parameters for an RPC operation. */ public abstract supplyPathParametersForOperation(_operation: RpcOperation): OpenAPIParameter[]; /** Constructs an HTTP protocol. */ public constructor(configuration: RpcConfiguration) { super(configuration); this.events.addListener(WebAppRpcLogging.logProtocolEvent); } }
JBMonnier/imodeljs
core/common/src/rpc/web/WebAppRpcProtocol.ts
TypeScript
InterfaceDeclaration
/** An HTTP server request object. */ export interface HttpServerRequest extends Readable { httpVersion: string; httpVersionMajor: number; httpVersionMinor: number; connection: any; headers: { [header: string]: string | string[] | undefined }; rawHeaders: string[]; trailers: { [key: string]: string | undefined }; rawTrailers: string[]; setTimeout(msecs: number, callback: () => void): this; url?: string; statusCode?: number; statusMessage?: string; socket: any; destroy(error?: Error): void; body: string | Buffer; path: string; method: string; header: (field: string) => string | undefined; }
JBMonnier/imodeljs
core/common/src/rpc/web/WebAppRpcProtocol.ts
TypeScript
InterfaceDeclaration
/** An HTTP server response object. */ export interface HttpServerResponse extends Writable { send(body?: any): HttpServerResponse; status(code: number): HttpServerResponse; set(field: string, value: string): void; }
JBMonnier/imodeljs
core/common/src/rpc/web/WebAppRpcProtocol.ts
TypeScript
MethodDeclaration
/** Convenience handler for an RPC operation get request for an HTTP server. */ public async handleOperationGetRequest(req: HttpServerRequest, res: HttpServerResponse) { return this.handleOperationPostRequest(req, res); }
JBMonnier/imodeljs
core/common/src/rpc/web/WebAppRpcProtocol.ts
TypeScript
MethodDeclaration
/** Convenience handler for an RPC operation post request for an HTTP server. */ public async handleOperationPostRequest(req: HttpServerRequest, res: HttpServerResponse) { const request = await WebAppRpcRequest.parseRequest(this, req); const fulfillment = await this.fulfill(request); WebAppRpcRequest.sendResponse(this, request, fulfillment, res); }
JBMonnier/imodeljs
core/common/src/rpc/web/WebAppRpcProtocol.ts
TypeScript
MethodDeclaration
/** Convenience handler for an OpenAPI description request for an HTTP server. */ public handleOpenApiDescriptionRequest(_req: HttpServerRequest, res: HttpServerResponse) { const description = JSON.stringify(this.openAPIDescription); res.send(description); }
JBMonnier/imodeljs
core/common/src/rpc/web/WebAppRpcProtocol.ts
TypeScript
MethodDeclaration
/** Converts an HTTP content type value to an RPC content type value. */ public static computeContentType(httpType: string | null | undefined): RpcContentType { if (!httpType) return RpcContentType.Unknown; if (httpType.indexOf(WEB_RPC_CONSTANTS.ANY_TEXT) === 0) { return RpcContentType.Text; } else if (httpType.indexOf(WEB_RPC_CONSTANTS.BINARY) === 0) { return RpcContentType.Binary; } else if (httpType.indexOf(WEB_RPC_CONSTANTS.MULTIPART) === 0) { return RpcContentType.Multipart; } else { return RpcContentType.Unknown; } }
JBMonnier/imodeljs
core/common/src/rpc/web/WebAppRpcProtocol.ts
TypeScript
MethodDeclaration
/** Supplies the status corresponding to a protocol-specific code value. */ public getStatus(code: number): RpcRequestStatus { switch (code) { case 202: return RpcRequestStatus.Provisioning; case 404: return RpcRequestStatus.NotFound; case 409: return RpcRequestStatus.Pending; case 200: return RpcRequestStatus.Resolved; case 500: return RpcRequestStatus.Rejected; default: return RpcRequestStatus.Unknown; } }
JBMonnier/imodeljs
core/common/src/rpc/web/WebAppRpcProtocol.ts
TypeScript
MethodDeclaration
/** Supplies the protocol-specific code corresponding to a status value. */ public getCode(status: RpcRequestStatus): number { switch (status) { case RpcRequestStatus.Provisioning: return 202; case RpcRequestStatus.NotFound: return 404; case RpcRequestStatus.Pending: return 409; case RpcRequestStatus.Resolved: return 200; case RpcRequestStatus.Rejected: return 500; default: return 501; } }
JBMonnier/imodeljs
core/common/src/rpc/web/WebAppRpcProtocol.ts
TypeScript
MethodDeclaration
/** Returns the OpenAPI-compatible URI path parameters for an RPC operation. */ public abstract supplyPathParametersForOperation(_operation: RpcOperation): OpenAPIParameter[];
JBMonnier/imodeljs
core/common/src/rpc/web/WebAppRpcProtocol.ts
TypeScript
ArrowFunction
() => { it('should sort', () => { const orderedItems: Ordered<Foo>[] = [ { name: 'A', order: 4 }, { name: 'B', order: 2 }, { name: 'C', order: 1 }, { name: 'D', order: 3 } ]; const sortedItems = orderedItems.sort(compareByOrder); expect(sortedItems.map((it) => it.name)).toEqual(['C', 'B', 'D', 'A']); }); }
dirkluijk/typescript-essentials
projects/typescript-essentials/src/lib/ordering/compare-by-order.fn.spec.ts
TypeScript
ArrowFunction
() => { const orderedItems: Ordered<Foo>[] = [ { name: 'A', order: 4 }, { name: 'B', order: 2 }, { name: 'C', order: 1 }, { name: 'D', order: 3 } ]; const sortedItems = orderedItems.sort(compareByOrder); expect(sortedItems.map((it) => it.name)).toEqual(['C', 'B', 'D', 'A']); }
dirkluijk/typescript-essentials
projects/typescript-essentials/src/lib/ordering/compare-by-order.fn.spec.ts
TypeScript
ArrowFunction
(it) => it.name
dirkluijk/typescript-essentials
projects/typescript-essentials/src/lib/ordering/compare-by-order.fn.spec.ts
TypeScript
InterfaceDeclaration
interface Foo { name: string; }
dirkluijk/typescript-essentials
projects/typescript-essentials/src/lib/ordering/compare-by-order.fn.spec.ts
TypeScript
ArrowFunction
({placement}) => (placement === 'top' ? css` top: 7px; right: 7px; ` : css` right: 7px; bottom: 7px; `)
3ach/mattermost-webapp
components/advanced_text_editor/texteditor_actions/texteditor_actions.tsx
TypeScript
ArrowFunction
({show = true}) => (show ? 1 : 0)
3ach/mattermost-webapp
components/advanced_text_editor/texteditor_actions/texteditor_actions.tsx
TypeScript
ArrowFunction
({show = true}) => (show ? 'visible' : 'hidden')
3ach/mattermost-webapp
components/advanced_text_editor/texteditor_actions/texteditor_actions.tsx
TypeScript
TypeAliasDeclaration
/** eslint-disable no-confusing-arrow */ type TexteditorActionsProps = { placement: 'top' | 'bottom'; show?: boolean; }
3ach/mattermost-webapp
components/advanced_text_editor/texteditor_actions/texteditor_actions.tsx
TypeScript
ClassDeclaration
export default class RoleUpdateEvent extends Event { constructor(bot: Bot) { super(bot, Constants.Events.GUILD_ROLE_UPDATE); } async execute(bot: Bot, oldRole: Role, newRole: Role) { try { if (!newRole.guild) return; if (!newRole.guild.available) return; const webhook = await bot.utils.getWebhook(newRole.guild); if (!webhook) return; let msg = ""; if (oldRole.name !== newRole.name) { msg = `Role: **${oldRole.name}** was renamed to **${newRole.name}** (${newRole})`; } else if (oldRole.color !== newRole.color) { msg = `Role: **${newRole.name}**, color: **${oldRole.color}** was recolored to **${newRole.color}** (${newRole})`; } else { return; } const embed = bot.utils .baseEmbed({ author: bot.user }) .setTitle("Role Updated") .setDescription(msg) .setColor("ORANGE") .setTimestamp(); webhook.send({ embeds: [embed] }); } catch (err) { bot.utils.sendErrorLog(err, "error"); } } }
barzanimatin/ghost
src/events/guild/roleUpdate.ts
TypeScript
MethodDeclaration
async execute(bot: Bot, oldRole: Role, newRole: Role) { try { if (!newRole.guild) return; if (!newRole.guild.available) return; const webhook = await bot.utils.getWebhook(newRole.guild); if (!webhook) return; let msg = ""; if (oldRole.name !== newRole.name) { msg = `Role: **${oldRole.name}** was renamed to **${newRole.name}** (${newRole})`; } else if (oldRole.color !== newRole.color) { msg = `Role: **${newRole.name}**, color: **${oldRole.color}** was recolored to **${newRole.color}** (${newRole})`; } else { return; } const embed = bot.utils .baseEmbed({ author: bot.user }) .setTitle("Role Updated") .setDescription(msg) .setColor("ORANGE") .setTimestamp(); webhook.send({ embeds: [embed] }); } catch (err) { bot.utils.sendErrorLog(err, "error"); } }
barzanimatin/ghost
src/events/guild/roleUpdate.ts
TypeScript
ArrowFunction
(chainId: number = CHAINID ) => { if (chainId === SupportedChainId.POLYGON) { return polygonTokens } else if (chainId === SupportedChainId.AURORA) { return auroraTokens } else { return polygonTokens } }
Possum-ONE/possum-app
src/constants/tokens.ts
TypeScript
ArrowFunction
(chainId: number = CHAINID, hash: string ) => { let url: string = '' if (chainId === SupportedChainId.POLYGON) { url = ViewBlockScan[SupportedChainId.POLYGON] return `${url}/tx/${hash}` } else if (chainId === SupportedChainId.AURORA) { url = ViewBlockScan[SupportedChainId.AURORA] } return `${url}/tx/${hash}` }
Possum-ONE/possum-app
src/constants/tokens.ts
TypeScript
InterfaceDeclaration
// define custom interface export interface userType { username: String; password: String; firstName: String; lastName: String; email: String; phone: String; occupation: String; isDeveloper: Boolean; isValid: Boolean; isAdmin: Boolean; }
chuangyu-hscy/-
controller/user/userInterface.ts
TypeScript
ClassDeclaration
@Injectable({ providedIn: 'root' }) export class FacebookService { constructor( private http: HttpClient, ) { } getFacebookAccessToken(): Observable<any> { console.log('get access token invoked'); return this.http.get( `/oauth/access_token?client_id=1233979890091351&client_secret=1c80b71b377433c0c5fe6bf00f457b06&grant_type=client_credentials`); } getPosts(pageName, accessToken): Observable<any> { console.log('get posts invoked'); return this.http.get( `/v2.9/${pageName}/posts?access_token=${accessToken}`); } }
avinduhewa/publicera
publicera/src/app/shared/services/facebook.service.ts
TypeScript
MethodDeclaration
getFacebookAccessToken(): Observable<any> { console.log('get access token invoked'); return this.http.get( `/oauth/access_token?client_id=1233979890091351&client_secret=1c80b71b377433c0c5fe6bf00f457b06&grant_type=client_credentials`); }
avinduhewa/publicera
publicera/src/app/shared/services/facebook.service.ts
TypeScript
MethodDeclaration
getPosts(pageName, accessToken): Observable<any> { console.log('get posts invoked'); return this.http.get( `/v2.9/${pageName}/posts?access_token=${accessToken}`); }
avinduhewa/publicera
publicera/src/app/shared/services/facebook.service.ts
TypeScript
FunctionDeclaration
/** * The connection strings for the given database account. */ export function listDatabaseAccountConnectionStrings(args: ListDatabaseAccountConnectionStringsArgs, opts?: pulumi.InvokeOptions): Promise<ListDatabaseAccountConnectionStringsResult> { if (!opts) { opts = {} } if (!opts.version) { opts.version = utilities.getVersion(); } return pulumi.runtime.invoke("azure-nextgen:documentdb/v20190801:listDatabaseAccountConnectionStrings", { "accountName": args.accountName, "resourceGroupName": args.resourceGroupName, }, opts); }
pulumi/pulumi-azure-nextgen
sdk/nodejs/documentdb/v20190801/listDatabaseAccountConnectionStrings.ts
TypeScript
InterfaceDeclaration
export interface ListDatabaseAccountConnectionStringsArgs { /** * Cosmos DB database account name. */ readonly accountName: string; /** * Name of an Azure resource group. */ readonly resourceGroupName: string; }
pulumi/pulumi-azure-nextgen
sdk/nodejs/documentdb/v20190801/listDatabaseAccountConnectionStrings.ts
TypeScript
InterfaceDeclaration
/** * The connection strings for the given database account. */ export interface ListDatabaseAccountConnectionStringsResult { /** * An array that contains the connection strings for the Cosmos DB account. */ readonly connectionStrings?: outputs.documentdb.v20190801.DatabaseAccountConnectionStringResponse[]; }
pulumi/pulumi-azure-nextgen
sdk/nodejs/documentdb/v20190801/listDatabaseAccountConnectionStrings.ts
TypeScript
ArrowFunction
({ height = 19, width = 19, viewBox = '0 0 24 24', className, ...props }) => { const classes = ['icon', className].join(' '); return ( <svg className={classes} height={height} width={width} viewBox={viewBox} {...props} > <g> <path d="M18,3 C19.6568542,3 21,4.34314575 21,6 L21,18 C21,19.6568542 19.6568542,21 18,21 L6,21 C4.34314575,21 3,19.6568542 3,18 L3,6 C3,4.34314575 4.34314575,3 6,3 L18,3 Z M16.4696699,7.96966991 L10,14.4393398 L7.53033009,11.9696699 C7.23743687,11.6767767 6.76256313,11.6767767 6.46966991,11.9696699 C6.1767767,12.2625631 6.1767767,12.7374369 6.46966991,13.0303301 L9.46966991,16.0303301 C9.76256313,16.3232233 10.2374369,16.3232233 10.5303301,16.0303301 L17.5303301,9.03033009 C17.8232233,8.73743687 17.8232233,8.26256313 17.5303301,7.96966991 C17.2374369,7.6767767 16.7625631,7.6767767 16.4696699,7.96966991 Z"></path> </g> </svg>
azmi989/shifa-ui
src/icons/CheckBox.tsx
TypeScript
ArrowFunction
() => { beforeEach(async(() => { TestBed.configureTestingModule({ imports: [ RouterTestingModule ], declarations: [ AppComponent ], }).compileComponents(); })); it('should create the app', () => { const fixture = TestBed.createComponent(AppComponent); const app = fixture.componentInstance; expect(app).toBeTruthy(); }); it(`should have as title 'MyHomeControlV3'`, () => { const fixture = TestBed.createComponent(AppComponent); const app = fixture.componentInstance; expect(app.title).toEqual('MyHomeControlV3'); }); it('should render title', () => { const fixture = TestBed.createComponent(AppComponent); fixture.detectChanges(); const compiled = fixture.nativeElement; expect(compiled.querySelector('.content span').textContent).toContain('MyHomeControlV3 app is running!'); }); }
Tab0o33/MyHomeControlV3
src/app/app.component.spec.ts
TypeScript
ArrowFunction
() => { const fixture = TestBed.createComponent(AppComponent); const app = fixture.componentInstance; expect(app.title).toEqual('MyHomeControlV3'); }
Tab0o33/MyHomeControlV3
src/app/app.component.spec.ts
TypeScript
ArrowFunction
() => { const fixture = TestBed.createComponent(AppComponent); fixture.detectChanges(); const compiled = fixture.nativeElement; expect(compiled.querySelector('.content span').textContent).toContain('MyHomeControlV3 app is running!'); }
Tab0o33/MyHomeControlV3
src/app/app.component.spec.ts
TypeScript
ClassDeclaration
export class GetOperationDTO { @ApiProperty({ type: String, required: true }) @IsUUID() id: string; }
GrefferM/bank
shared/dto/get.operation.dto.ts
TypeScript
FunctionDeclaration
export function configure(config: Config): SystemConfigured { // Upgrade `edonet` reference in config to `edo2net`. This is done for the // sake of compatibility since the meaning of "edonet" is ambiguous: in some // parts of the ecosystem it refers to latest version of edonet, which is also // referred to as "edo2net". const compatibilityConfig = { ...config, network: config.network === 'edonet' ? 'edo2net' : config.network }; return { status: Status.Configured, config: compatibilityConfig, betterCallDev: new BetterCallDev(compatibilityConfig), toolkit: null, wallet: null, walletReconnectAttempted: false, tzPublicKey: null }; }
illuminautical/minter
src/lib/system.ts
TypeScript
FunctionDeclaration
function createMetadataResolver( system: SystemConfigured, toolkit: TezosToolkit, contractAddress: string ): ResolveMetadata { const ipfsGateway = system.config.network === 'sandboxnet' ? 'localhost:8080' : 'gateway.ipfs.io'; const gatewayProtocol = system.config.network === 'sandboxnet' ? 'http' : 'https'; const ipfsHandler = new CustomIpfsHttpHandler(ipfsGateway, gatewayProtocol); DEFAULT_HANDLERS.set('ipfs', ipfsHandler); const provider = new MetadataProvider(DEFAULT_HANDLERS); const context = new Context(toolkit.rpc); // This is a performance optimization: We're only resolving off-chain // metadata, however the storage handler requires a ContractAbstraction // instance present - if we fetch a contract on each invokation, the time // to resolution can take several hundred milliseconds. // // TODO: Is it possible to only fetch contracts at the storage resolver level // and make an "off-chain" metadata resolver that excludes the need for a // ContractAbstraction instance? const defaultContract = toolkit.contract.at(contractAddress); return async uri => { const contract = await defaultContract; return provider.provideMetadata(contract, uri, context); }; }
illuminautical/minter
src/lib/system.ts
TypeScript
FunctionDeclaration
export function connectToolkit(system: SystemConfigured): SystemWithToolkit { const toolkit = new TezosToolkit(system.config.rpc); const faucetAddress = system.config.contracts.nftFaucet; return { ...system, status: Status.ToolkitConnected, toolkit: toolkit, resolveMetadata: createMetadataResolver(system, toolkit, faucetAddress), walletReconnectAttempted: false }; }
illuminautical/minter
src/lib/system.ts
TypeScript
FunctionDeclaration
function networkType(config: Config) { if (config.network === 'mainnet') { return NetworkType.MAINNET; } if (config.network === 'delphinet') { return NetworkType.DELPHINET; } // Edonet support is split between two network types, edonet and edo2net. For // now, .CUSTOM must be used when referring to edo2net. if (config.network === 'edonet') { return NetworkType.EDONET; } if (config.network === 'edo2net') { return NetworkType.CUSTOM; } return NetworkType.CUSTOM; }
illuminautical/minter
src/lib/system.ts
TypeScript
FunctionDeclaration
function getWallet( system: SystemWithToolkit, eventHandlers?: DAppClientOptions['eventHandlers'] ): BeaconWallet { if (wallet === null) { wallet = new BeaconWallet({ name: 'OpenSystem dApp', preferredNetwork: networkType(system.config), eventHandlers }); } return wallet; }
illuminautical/minter
src/lib/system.ts
TypeScript
FunctionDeclaration
async function initWallet( system: SystemWithToolkit, forceConnect: boolean, eventHandlers?: DAppClientOptions['eventHandlers'] ): Promise<boolean> { const network = networkType(system.config); const wallet = getWallet(system, eventHandlers); const activeAccount = await wallet.client.getActiveAccount(); if (!activeAccount) { if (forceConnect) { try { await wallet.requestPermissions({ network: { type: system.config.network === 'edo2net' ? (system.config.network as NetworkType) : network, rpcUrl: system.config.rpc } }); } catch (error) { // requestPermissions failed - reset wallet selection wallet.clearActiveAccount(); throw error; } } else { return false; } } return true; }
illuminautical/minter
src/lib/system.ts
TypeScript
FunctionDeclaration
async function createSystemWithWallet( system: SystemWithToolkit ): Promise<SystemWithWallet> { const wallet = getWallet(system); system.toolkit.setWalletProvider(wallet); tzUtils.setConfirmationPollingInterval(system.toolkit); const tzPublicKey = await wallet.getPKH(); return { ...system, status: Status.WalletConnected, wallet: wallet, tzPublicKey: tzPublicKey }; }
illuminautical/minter
src/lib/system.ts
TypeScript
FunctionDeclaration
export async function reconnectWallet( system: SystemWithToolkit, eventHandlers?: DAppClientOptions['eventHandlers'] ): Promise<SystemWithWallet | SystemWithToolkit> { const connected = await initWallet(system, false, eventHandlers); if (connected) { const systemWithWallet = await createSystemWithWallet(system); return { ...systemWithWallet, walletReconnectAttempted: true }; } else { return { ...system, walletReconnectAttempted: true }; } }
illuminautical/minter
src/lib/system.ts
TypeScript
FunctionDeclaration
export async function connectWallet( system: SystemWithToolkit, eventHandlers?: DAppClientOptions['eventHandlers'] ): Promise<SystemWithWallet> { await initWallet(system, true, eventHandlers); return await createSystemWithWallet(system); }
illuminautical/minter
src/lib/system.ts
TypeScript
FunctionDeclaration
export async function disconnectWallet( system: SystemWithWallet ): Promise<SystemWithToolkit> { await system.wallet.disconnect(); const toolkit = new TezosToolkit(system.config.rpc); wallet = null; return { ...system, status: Status.ToolkitConnected, toolkit: toolkit, wallet: null, tzPublicKey: null }; }
illuminautical/minter
src/lib/system.ts
TypeScript
ArrowFunction
async uri => { const contract = await defaultContract; return provider.provideMetadata(contract, uri, context); }
illuminautical/minter
src/lib/system.ts
TypeScript
InterfaceDeclaration
export interface Config { rpc: string; network: string; bcd: { api: string; gui: string; }; contracts: { nftFaucet: string; marketplace: { fixedPrice: { tez: string; }; }; }; ipfsApi: string; }
illuminautical/minter
src/lib/system.ts
TypeScript
InterfaceDeclaration
export interface SystemConfigured { status: Status.Configured; config: Config; betterCallDev: BetterCallDev; toolkit: null; wallet: null; walletReconnectAttempted: boolean; tzPublicKey: null; }
illuminautical/minter
src/lib/system.ts
TypeScript
InterfaceDeclaration
export interface SystemWithToolkit { status: Status.ToolkitConnected; config: Config; betterCallDev: BetterCallDev; toolkit: TezosToolkit; resolveMetadata: ResolveMetadata; wallet: null; walletReconnectAttempted: boolean; tzPublicKey: null; }
illuminautical/minter
src/lib/system.ts
TypeScript
InterfaceDeclaration
export interface SystemWithWallet { status: Status.WalletConnected; config: Config; betterCallDev: BetterCallDev; toolkit: TezosToolkit; resolveMetadata: ResolveMetadata; wallet: BeaconWallet; walletReconnectAttempted: boolean; tzPublicKey: string; }
illuminautical/minter
src/lib/system.ts
TypeScript
EnumDeclaration
export enum Status { Configured = 'Configured', ToolkitConnected = 'ToolkitConnected', WalletConnected = 'WalletConnected' }
illuminautical/minter
src/lib/system.ts
TypeScript
TypeAliasDeclaration
type ResolveMetadata = ( uri: string ) => ReturnType<MetadataProvider['provideMetadata']>;
illuminautical/minter
src/lib/system.ts
TypeScript
TypeAliasDeclaration
export type System = SystemConfigured | SystemWithToolkit | SystemWithWallet;
illuminautical/minter
src/lib/system.ts
TypeScript
ArrowFunction
() => { const dbConnectionObj = getMockDBConnection(); const sampleReq = { keycloak_token: {}, body: {}, params: { projectId: 1 } } as any; afterEach(() => { sinon.restore(); }); it('should throw a 400 error when no projectId is provided', async () => { sinon.stub(db, 'getDBConnection').returns(dbConnectionObj); try { await getProjectEml()( { ...sampleReq, params: { ...sampleReq.params, projectId: null } }, (null as unknown) as any, (null as unknown) as any ); expect.fail(); } catch (actualError) { expect((actualError as HTTPError).status).to.equal(400); expect((actualError as HTTPError).message).to.equal('Failed to build SQL get statement'); } }); it('should throw an error when buildProjectEml fails', async () => { const dbConnectionObj = getMockDBConnection({ rollback: sinon.stub(), release: sinon.stub() }); sinon.stub(db, 'getDBConnection').returns(dbConnectionObj); sinon.stub(EmlService.prototype, 'buildProjectEml').rejects(new Error('a test error')); const { mockReq, mockRes, mockNext } = getRequestHandlerMocks(); mockReq.params = { projectId: '1' }; try { const requestHandler = getProjectEml(); await requestHandler(mockReq, mockRes, mockNext); expect.fail(); } catch (actualError) { expect(dbConnectionObj.rollback).to.have.been.called; expect(dbConnectionObj.release).to.have.been.called; expect((actualError as HTTPError).message).to.equal('a test error'); } }); }
bcgov/restoration-tracker
api/src/paths/project/{projectId}/export/eml.test.ts
TypeScript
ArrowFunction
() => { sinon.restore(); }
bcgov/restoration-tracker
api/src/paths/project/{projectId}/export/eml.test.ts
TypeScript
ArrowFunction
async () => { sinon.stub(db, 'getDBConnection').returns(dbConnectionObj); try { await getProjectEml()( { ...sampleReq, params: { ...sampleReq.params, projectId: null } }, (null as unknown) as any, (null as unknown) as any ); expect.fail(); } catch (actualError) { expect((actualError as HTTPError).status).to.equal(400); expect((actualError as HTTPError).message).to.equal('Failed to build SQL get statement'); } }
bcgov/restoration-tracker
api/src/paths/project/{projectId}/export/eml.test.ts
TypeScript
ArrowFunction
async () => { const dbConnectionObj = getMockDBConnection({ rollback: sinon.stub(), release: sinon.stub() }); sinon.stub(db, 'getDBConnection').returns(dbConnectionObj); sinon.stub(EmlService.prototype, 'buildProjectEml').rejects(new Error('a test error')); const { mockReq, mockRes, mockNext } = getRequestHandlerMocks(); mockReq.params = { projectId: '1' }; try { const requestHandler = getProjectEml(); await requestHandler(mockReq, mockRes, mockNext); expect.fail(); } catch (actualError) { expect(dbConnectionObj.rollback).to.have.been.called; expect(dbConnectionObj.release).to.have.been.called; expect((actualError as HTTPError).message).to.equal('a test error'); } }
bcgov/restoration-tracker
api/src/paths/project/{projectId}/export/eml.test.ts
TypeScript
ArrowFunction
({ animatedProps, data, layout, y, borderColor, borderWidth, component, reverse, scale, height, onMouseEnter, onMouseLeave, onClick, }: BulletRectsProps) => { const rects = useMemo( () => computeRects({ data, layout, reverse, scale, height, }), [data, layout, reverse, scale, height] ) const theme = useTheme() const getBorderColor = useInheritedColor(borderColor, theme) const getTransform = (value: number) => `translate(${layout === 'horizontal' ? 0 : value},${layout === 'horizontal' ? value : 0})` const transform = animatedProps ? to(animatedProps.measuresY, getTransform) : getTransform(y) const { animate, config: springConfig } = useMotionConfig() const transition = useTransition<BulletRectComputedRect, BulletRectAnimatedProps>(rects, { keys: rect => `${rect.data.index}`, enter: rect => ({ x: rect.x, y: rect.y, width: rect.width, height: rect.height, color: rect.data.color, }), update: rect => ({ x: rect.x, y: rect.y, width: rect.width, height: rect.height, color: rect.data.color, }), config: springConfig, immediate: !animate, }) return ( <animated.g transform={transform}> {transition((props, rect)
AthithyanRengaswamy/nivo
packages/bullet/src/BulletRects.tsx
TypeScript
ArrowFunction
() => computeRects({ data, layout, reverse, scale, height, })
AthithyanRengaswamy/nivo
packages/bullet/src/BulletRects.tsx
TypeScript
ArrowFunction
(value: number) => `translate(${layout === 'horizontal' ? 0 : value},${layout === 'horizontal' ? value : 0})`
AthithyanRengaswamy/nivo
packages/bullet/src/BulletRects.tsx
TypeScript
ArrowFunction
rect => `${rect.data.index}`
AthithyanRengaswamy/nivo
packages/bullet/src/BulletRects.tsx
TypeScript
ArrowFunction
rect => ({ x: rect.x, y: rect.y, width: rect.width, height: rect.height, color: rect.data.color, })
AthithyanRengaswamy/nivo
packages/bullet/src/BulletRects.tsx
TypeScript
ArrowFunction
value => Math.max(value, 0)
AthithyanRengaswamy/nivo
packages/bullet/src/BulletRects.tsx
TypeScript
MethodDeclaration
transition(
AthithyanRengaswamy/nivo
packages/bullet/src/BulletRects.tsx
TypeScript