type
stringclasses 7
values | content
stringlengths 4
9.55k
| repo
stringlengths 7
96
| path
stringlengths 4
178
| language
stringclasses 1
value |
---|---|---|---|---|
FunctionDeclaration |
export function keys(v: object): string[] {
if (Object.keys) {
return Object.keys(v);
}
return _keys(v);
} | cloudflare/authr | ts/src/util.ts | TypeScript |
FunctionDeclaration |
export function values(v: object): any[] {
if (Object.values) {
return Object.values(v);
}
return _values(v);
} | cloudflare/authr | ts/src/util.ts | TypeScript |
FunctionDeclaration |
export function isPlainObject(v?: any): v is object {
return _isPlainObject(v);
} | cloudflare/authr | ts/src/util.ts | TypeScript |
FunctionDeclaration |
export function isString(v?: any): v is string {
return _isString(v);
} | cloudflare/authr | ts/src/util.ts | TypeScript |
FunctionDeclaration |
export function isObject(v?: any): v is object {
return _isObject(v);
} | cloudflare/authr | ts/src/util.ts | TypeScript |
FunctionDeclaration |
export function isArray(v?: any): v is any[] {
return _isArray(v);
} | cloudflare/authr | ts/src/util.ts | TypeScript |
FunctionDeclaration |
export function empty(v?: any): boolean {
if (v === null) {
return true;
}
if (v === undefined) {
return true;
}
if (isArray(v) || isString(v)) {
return !v.length;
}
if (isPlainObject(v)) {
return !keys(v).length;
}
return !v;
} | cloudflare/authr | ts/src/util.ts | TypeScript |
FunctionDeclaration |
export function runtimeAssertIsSubject(v?: ISubject): void {
if (!isSubject(v)) {
throw new AuthrError(
'"subject" argument does not implement mandatory subject methods'
);
}
} | cloudflare/authr | ts/src/util.ts | TypeScript |
FunctionDeclaration |
export function runtimeAssertIsResource(v?: IResource): void {
if (!isResource(v)) {
throw new AuthrError(
'"resource" argument does not implement mandatory resource methods'
);
}
} | cloudflare/authr | ts/src/util.ts | TypeScript |
InterfaceDeclaration |
export interface IEvaluator {
evaluate(resource: IResource): boolean;
} | cloudflare/authr | ts/src/util.ts | TypeScript |
InterfaceDeclaration |
export interface IJSONSerializable {
toJSON(): any;
} | cloudflare/authr | ts/src/util.ts | TypeScript |
FunctionDeclaration |
function createSnippetTests(snippetsFile: string): void {
suite(snippetsFile, () => {
const snippetsPath = path.join(testFolder, '..', 'assets', snippetsFile);
const snippets = <{ [name: string]: ISnippet }>fse.readJsonSync(snippetsPath);
// tslint:disable-next-line:no-for-in forin
for (let snippetName in snippets) {
testWithLanguageServer(`snippet: ${snippetName}`, async function (this: ITestCallbackContext): Promise<void> {
await testSnippet(this, snippetsPath, snippetName, snippets[snippetName]);
});
}
});
} | alexandair/vscode-azurearmtools | test/functional/snippets.test.ts | TypeScript |
FunctionDeclaration |
async function testSnippet(testCallbackContext: ITestCallbackContext, snippetsPath: string, snippetName: string, snippet: ISnippet): Promise<void> {
if (overrideSkipTests[snippetName]) {
testCallbackContext.skip();
return;
}
validateSnippet();
const template = overrideTemplateForSnippet[snippetName] !== undefined ? overrideTemplateForSnippet[snippetName] : resourceTemplate;
// tslint:disable-next-line: strict-boolean-expressions
const expectedDiagnostics = (overrideExpectedDiagnostics[snippetName] || []).sort();
// tslint:disable-next-line: strict-boolean-expressions
const snippetInsertComment: string = overrideInsertPosition[snippetName] || "// Insert here: resource";
const snippetInsertIndex: number = template.indexOf(snippetInsertComment);
assert(snippetInsertIndex >= 0, `Couldn't find location to insert snippet (looking for "${snippetInsertComment}")`);
const snippetInsertPos = getVSCodePositionFromPosition(new DeploymentTemplate(template, "fake template").getContextFromDocumentCharacterIndex(snippetInsertIndex).documentPosition);
const tempPath = getTempFilePath(`snippet ${snippetName}`, '.azrm');
fse.writeFileSync(tempPath, template);
let doc = await workspace.openTextDocument(tempPath);
await window.showTextDocument(doc);
// Wait for first set of diagnostics to finish.
await getDiagnosticsForDocument(doc, {});
const initialDocText = window.activeTextEditor!.document.getText();
// Start waiting for next set of diagnostics (so it picks up the current completion versions)
let diagnosticsPromise: Promise<Diagnostic[]> = getDiagnosticsForDocument(
doc,
{
waitForChange: true,
ignoreSources: [sources.schema] //asdf TODO: Don't ignore schema errors
});
// Insert snippet
window.activeTextEditor!.selection = new Selection(snippetInsertPos, snippetInsertPos);
await delay(1);
await commands.executeCommand('editor.action.insertSnippet', {
name: snippetName
});
// Wait for diagnostics to finish
let diagnostics: Diagnostic[] = await diagnosticsPromise;
if (DEBUG_BREAK_AFTER_INSERTING_SNIPPET) {
// tslint:disable-next-line: no-debugger
debugger;
}
const docTextAfterInsertion = window.activeTextEditor!.document.getText();
validateDocumentWithSnippet();
let messages = diagnostics.map(d => d.message).sort();
assert.deepStrictEqual(messages, expectedDiagnostics);
// // NOTE: Even though we request the editor to be closed,
// // there's no way to request the document actually be closed,
// // and when you open it via an API, it doesn't close for a while,
// // so the diagnostics won't go away
// // See https://github.com/Microsoft/vscode/issues/43056
await commands.executeCommand("undo");
fse.unlinkSync(tempPath);
await commands.executeCommand('workbench.action.closeAllEditors');
// Look for common errors in the snippet
function validateSnippet(): void {
const snippetText = JSON.stringify(snippet, null, 4);
errorIfTextMatches(snippetText, /\$\$/, `Instead of $$ in snippet, use \\$`);
errorIfTextMatches(snippetText, /\${[^0-9]/, "Snippet placeholder is missing the numeric id, makes it look like a variable to vscode");
}
function validateDocumentWithSnippet(): void {
assert(initialDocText !== docTextAfterInsertion, "No insertion happened? Document didn't change.");
}
function errorIfTextMatches(text: string, regex: RegExp, errorMessage: string): void {
const match = text.match(regex);
if (match) {
assert(false, `${errorMessage}. At "${text.slice(match.index!, match.index! + 20)}..."`);
}
}
} | alexandair/vscode-azurearmtools | test/functional/snippets.test.ts | TypeScript |
FunctionDeclaration | // Look for common errors in the snippet
function validateSnippet(): void {
const snippetText = JSON.stringify(snippet, null, 4);
errorIfTextMatches(snippetText, /\$\$/, `Instead of $$ in snippet, use \\$`);
errorIfTextMatches(snippetText, /\${[^0-9]/, "Snippet placeholder is missing the numeric id, makes it look like a variable to vscode");
} | alexandair/vscode-azurearmtools | test/functional/snippets.test.ts | TypeScript |
FunctionDeclaration |
function validateDocumentWithSnippet(): void {
assert(initialDocText !== docTextAfterInsertion, "No insertion happened? Document didn't change.");
} | alexandair/vscode-azurearmtools | test/functional/snippets.test.ts | TypeScript |
FunctionDeclaration |
function errorIfTextMatches(text: string, regex: RegExp, errorMessage: string): void {
const match = text.match(regex);
if (match) {
assert(false, `${errorMessage}. At "${text.slice(match.index!, match.index! + 20)}..."`);
}
} | alexandair/vscode-azurearmtools | test/functional/snippets.test.ts | TypeScript |
ArrowFunction |
() => {
suite("all snippets", () => {
createSnippetTests("armsnippets.jsonc");
});
function createSnippetTests(snippetsFile: string): void {
suite(snippetsFile, () => {
const snippetsPath = path.join(testFolder, '..', 'assets', snippetsFile);
const snippets = <{ [name: string]: ISnippet }>fse.readJsonSync(snippetsPath);
// tslint:disable-next-line:no-for-in forin
for (let snippetName in snippets) {
testWithLanguageServer(`snippet: ${snippetName}`, async function (this: ITestCallbackContext): Promise<void> {
await testSnippet(this, snippetsPath, snippetName, snippets[snippetName]);
});
}
});
}
async function testSnippet(testCallbackContext: ITestCallbackContext, snippetsPath: string, snippetName: string, snippet: ISnippet): Promise<void> {
if (overrideSkipTests[snippetName]) {
testCallbackContext.skip();
return;
}
validateSnippet();
const template = overrideTemplateForSnippet[snippetName] !== undefined ? overrideTemplateForSnippet[snippetName] : resourceTemplate;
// tslint:disable-next-line: strict-boolean-expressions
const expectedDiagnostics = (overrideExpectedDiagnostics[snippetName] || []).sort();
// tslint:disable-next-line: strict-boolean-expressions
const snippetInsertComment: string = overrideInsertPosition[snippetName] || "// Insert here: resource";
const snippetInsertIndex: number = template.indexOf(snippetInsertComment);
assert(snippetInsertIndex >= 0, `Couldn't find location to insert snippet (looking for "${snippetInsertComment}")`);
const snippetInsertPos = getVSCodePositionFromPosition(new DeploymentTemplate(template, "fake template").getContextFromDocumentCharacterIndex(snippetInsertIndex).documentPosition);
const tempPath = getTempFilePath(`snippet ${snippetName}`, '.azrm');
fse.writeFileSync(tempPath, template);
let doc = await workspace.openTextDocument(tempPath);
await window.showTextDocument(doc);
// Wait for first set of diagnostics to finish.
await getDiagnosticsForDocument(doc, {});
const initialDocText = window.activeTextEditor!.document.getText();
// Start waiting for next set of diagnostics (so it picks up the current completion versions)
let diagnosticsPromise: Promise<Diagnostic[]> = getDiagnosticsForDocument(
doc,
{
waitForChange: true,
ignoreSources: [sources.schema] //asdf TODO: Don't ignore schema errors
});
// Insert snippet
window.activeTextEditor!.selection = new Selection(snippetInsertPos, snippetInsertPos);
await delay(1);
await commands.executeCommand('editor.action.insertSnippet', {
name: snippetName
});
// Wait for diagnostics to finish
let diagnostics: Diagnostic[] = await diagnosticsPromise;
if (DEBUG_BREAK_AFTER_INSERTING_SNIPPET) {
// tslint:disable-next-line: no-debugger
debugger;
}
const docTextAfterInsertion = window.activeTextEditor!.document.getText();
validateDocumentWithSnippet();
let messages = diagnostics.map(d => d.message).sort();
assert.deepStrictEqual(messages, expectedDiagnostics);
// // NOTE: Even though we request the editor to be closed,
// // there's no way to request the document actually be closed,
// // and when you open it via an API, it doesn't close for a while,
// // so the diagnostics won't go away
// // See https://github.com/Microsoft/vscode/issues/43056
await commands.executeCommand("undo");
fse.unlinkSync(tempPath);
await commands.executeCommand('workbench.action.closeAllEditors');
// Look for common errors in the snippet
function validateSnippet(): void {
const snippetText = JSON.stringify(snippet, null, 4);
errorIfTextMatches(snippetText, /\$\$/, `Instead of $$ in snippet, use \\$`);
errorIfTextMatches(snippetText, /\${[^0-9]/, "Snippet placeholder is missing the numeric id, makes it look like a variable to vscode");
}
function validateDocumentWithSnippet(): void {
assert(initialDocText !== docTextAfterInsertion, "No insertion happened? Document didn't change.");
}
function errorIfTextMatches(text: string, regex: RegExp, errorMessage: string): void {
const match = text.match(regex);
if (match) {
assert(false, `${errorMessage}. At "${text.slice(match.index!, match.index! + 20)}..."`);
}
}
}
} | alexandair/vscode-azurearmtools | test/functional/snippets.test.ts | TypeScript |
ArrowFunction |
() => {
createSnippetTests("armsnippets.jsonc");
} | alexandair/vscode-azurearmtools | test/functional/snippets.test.ts | TypeScript |
ArrowFunction |
() => {
const snippetsPath = path.join(testFolder, '..', 'assets', snippetsFile);
const snippets = <{ [name: string]: ISnippet }>fse.readJsonSync(snippetsPath);
// tslint:disable-next-line:no-for-in forin
for (let snippetName in snippets) {
testWithLanguageServer(`snippet: ${snippetName}`, async function (this: ITestCallbackContext): Promise<void> {
await testSnippet(this, snippetsPath, snippetName, snippets[snippetName]);
});
}
} | alexandair/vscode-azurearmtools | test/functional/snippets.test.ts | TypeScript |
ArrowFunction |
d => d.message | alexandair/vscode-azurearmtools | test/functional/snippets.test.ts | TypeScript |
InterfaceDeclaration |
interface ISnippet {
prefix: string;
body: string[];
description?: string;
} | alexandair/vscode-azurearmtools | test/functional/snippets.test.ts | TypeScript |
ArrowFunction |
() => {
const [waifus, setWaifus] = useState<Waifu[]>([]);
const history = useHistory();
const [t] = useTranslation();
const getDungeonPreview = async () => {
const globals = await getGlobals();
const _waifus: Waifu[] = [];
const contractHelper = new ContractHelper();
await contractHelper.init();
const count = await contractHelper.waifuBalanceOfAddress(
globals.dungeonAddress
);
const promises = Array.from(Array(WAIU_COUNT).keys()).map(async () => {
const index = Math.floor(Math.random() * count);
const id = await contractHelper.tokenOfAddressByIndex(
index,
globals.dungeonAddress
);
_waifus.push({ id });
});
await Promise.all(promises);
setWaifus(_waifus);
};
useEffect(() => {
getDungeonPreview();
}, []);
return (
<StyledPreview>
<Header>{t("headers.available")}</Header>
<WaifuWrapper>
{waifus.map((waifu: Waifu) => (
<WaifuCard key={waifu.id} waifu={waifu} />
))}
</WaifuWrapper>
<ButtonContainer>
<Button primary onClick={() | andriishupta/waifusion-site | src/components/Preview.tsx | TypeScript |
ArrowFunction |
async () => {
const globals = await getGlobals();
const _waifus: Waifu[] = [];
const contractHelper = new ContractHelper();
await contractHelper.init();
const count = await contractHelper.waifuBalanceOfAddress(
globals.dungeonAddress
);
const promises = Array.from(Array(WAIU_COUNT).keys()).map(async () => {
const index = Math.floor(Math.random() * count);
const id = await contractHelper.tokenOfAddressByIndex(
index,
globals.dungeonAddress
);
_waifus.push({ id });
});
await Promise.all(promises);
setWaifus(_waifus);
} | andriishupta/waifusion-site | src/components/Preview.tsx | TypeScript |
ArrowFunction |
async () => {
const index = Math.floor(Math.random() * count);
const id = await contractHelper.tokenOfAddressByIndex(
index,
globals.dungeonAddress
);
_waifus.push({ id });
} | andriishupta/waifusion-site | src/components/Preview.tsx | TypeScript |
ArrowFunction |
() => {
getDungeonPreview();
} | andriishupta/waifusion-site | src/components/Preview.tsx | TypeScript |
ArrowFunction |
(waifu: Waifu) => (
<WaifuCard key={waifu.id} | andriishupta/waifusion-site | src/components/Preview.tsx | TypeScript |
MethodDeclaration |
t("headers.available") | andriishupta/waifusion-site | src/components/Preview.tsx | TypeScript |
MethodDeclaration |
t("buttons.free") | andriishupta/waifusion-site | src/components/Preview.tsx | TypeScript |
ClassDeclaration |
export class IRecipientRegistry__factory {
static readonly abi = _abi;
static createInterface(): IRecipientRegistryInterface {
return new utils.Interface(_abi) as IRecipientRegistryInterface;
}
static connect(
address: string,
signerOrProvider: Signer | Provider
): IRecipientRegistry {
return new Contract(address, _abi, signerOrProvider) as IRecipientRegistry;
}
} | chnejohnson/clrfund-contracts | typechain/factories/IRecipientRegistry__factory.ts | TypeScript |
MethodDeclaration |
static createInterface(): IRecipientRegistryInterface {
return new utils.Interface(_abi) as IRecipientRegistryInterface;
} | chnejohnson/clrfund-contracts | typechain/factories/IRecipientRegistry__factory.ts | TypeScript |
MethodDeclaration |
static connect(
address: string,
signerOrProvider: Signer | Provider
): IRecipientRegistry {
return new Contract(address, _abi, signerOrProvider) as IRecipientRegistry;
} | chnejohnson/clrfund-contracts | typechain/factories/IRecipientRegistry__factory.ts | TypeScript |
FunctionDeclaration |
export function createDetailsPage(scan: model.Scan, callback?: () => void) {
return { createView };
function createView() {
const page = new Page();
const layout = new StackLayout();
page.content = layout;
const label = new Label();
label.text = scan.content;
label.className = "details-content";
layout.addChild(label);
const date = new Label();
date.text = scan.date.toLocaleString('en');
layout.addChild(date);
if (callback) {
const button = new Button();
button.text = "Open";
button.on("tap", callback);
layout.addChild(button);
}
return page;
}
} | BennetAni/TypeScript-Modern-JavaScript-Development | Module 3/Chapter 5/src/view/details.ts | TypeScript |
FunctionDeclaration |
function createView() {
const page = new Page();
const layout = new StackLayout();
page.content = layout;
const label = new Label();
label.text = scan.content;
label.className = "details-content";
layout.addChild(label);
const date = new Label();
date.text = scan.date.toLocaleString('en');
layout.addChild(date);
if (callback) {
const button = new Button();
button.text = "Open";
button.on("tap", callback);
layout.addChild(button);
}
return page;
} | BennetAni/TypeScript-Modern-JavaScript-Development | Module 3/Chapter 5/src/view/details.ts | TypeScript |
ClassDeclaration |
@Module({
imports: [ConfigModule.forRoot(),
TypeOrmModule.forRoot(), VehiclesModule]
})
export class AppModule { } | MaxFullStack/canoa-digital-backend | src/app.module.ts | TypeScript |
ArrowFunction |
() => {
it('renders without crashing', () => {
const { container } = render(
<User.Provider value={userMockConnected}>
<Router>
<Routes />
</Router>
</User.Provider>
)
expect(container.firstChild).toBeInTheDocument()
})
} | ArvindVivek/The-Auger-Network | client/src/Routes.test.tsx | TypeScript |
ArrowFunction |
() => {
const { container } = render(
<User.Provider value={userMockConnected}>
<Router>
<Routes />
</Router>
</User.Provider>
)
expect(container.firstChild).toBeInTheDocument()
} | ArvindVivek/The-Auger-Network | client/src/Routes.test.tsx | TypeScript |
ArrowFunction |
() => {
let component: AccinfBalanceGetComponent;
let fixture: ComponentFixture<AccinfBalanceGetComponent>;
@Component({
selector: 'app-play-wth-data',
template: '',
})
class MockPlayWithDataComponent {
@Input() headers: object;
@Input() accountIdFlag: boolean;
@Input() variablePathEnd: string;
}
@Pipe({ name: 'translate' })
class TranslatePipe implements PipeTransform {
transform(value) {
const tmp = value.split('.');
return tmp[1];
}
}
beforeEach(
waitForAsync(() => {
TestBed.configureTestingModule({
declarations: [AccinfBalanceGetComponent, LineCommandComponent, TranslatePipe, MockPlayWithDataComponent],
}).compileComponents();
})
);
beforeEach(() => {
fixture = TestBed.createComponent(AccinfBalanceGetComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
it('should be right headers', () => {
const headers: object = {
'X-Request-ID': '2f77a125-aa7a-45c0-b414-cea25a116035',
'Consent-ID': 'CONSENT_ID',
'PSU-IP-Address': '1.1.1.1',
};
expect(typeof component.headers).toBe('object');
for (const key in component.headers) {
if (component.headers.hasOwnProperty(key)) {
expect(headers.hasOwnProperty(key)).toBeTruthy();
expect(headers[key]).toBe(component.headers[key]);
}
}
});
it('should change segment', () => {
expect(component.activeSegment).toBe('documentation');
component.changeSegment('play-data');
expect(component.activeSegment).toBe('play-data');
component.changeSegment('documentation');
expect(component.activeSegment).toBe('documentation');
component.changeSegment('wrong-segment');
expect(component.activeSegment).not.toBe('wrong-segment');
});
} | kloose/XS2A-Sandbox | developer-portal-ui/src/app/components/test-cases/components/api-endpoints/accinf-balance-get/accinf-balance-get.component.spec.ts | TypeScript |
ArrowFunction |
() => {
TestBed.configureTestingModule({
declarations: [AccinfBalanceGetComponent, LineCommandComponent, TranslatePipe, MockPlayWithDataComponent],
}).compileComponents();
} | kloose/XS2A-Sandbox | developer-portal-ui/src/app/components/test-cases/components/api-endpoints/accinf-balance-get/accinf-balance-get.component.spec.ts | TypeScript |
ArrowFunction |
() => {
fixture = TestBed.createComponent(AccinfBalanceGetComponent);
component = fixture.componentInstance;
fixture.detectChanges();
} | kloose/XS2A-Sandbox | developer-portal-ui/src/app/components/test-cases/components/api-endpoints/accinf-balance-get/accinf-balance-get.component.spec.ts | TypeScript |
ArrowFunction |
() => {
const headers: object = {
'X-Request-ID': '2f77a125-aa7a-45c0-b414-cea25a116035',
'Consent-ID': 'CONSENT_ID',
'PSU-IP-Address': '1.1.1.1',
};
expect(typeof component.headers).toBe('object');
for (const key in component.headers) {
if (component.headers.hasOwnProperty(key)) {
expect(headers.hasOwnProperty(key)).toBeTruthy();
expect(headers[key]).toBe(component.headers[key]);
}
}
} | kloose/XS2A-Sandbox | developer-portal-ui/src/app/components/test-cases/components/api-endpoints/accinf-balance-get/accinf-balance-get.component.spec.ts | TypeScript |
ArrowFunction |
() => {
expect(component.activeSegment).toBe('documentation');
component.changeSegment('play-data');
expect(component.activeSegment).toBe('play-data');
component.changeSegment('documentation');
expect(component.activeSegment).toBe('documentation');
component.changeSegment('wrong-segment');
expect(component.activeSegment).not.toBe('wrong-segment');
} | kloose/XS2A-Sandbox | developer-portal-ui/src/app/components/test-cases/components/api-endpoints/accinf-balance-get/accinf-balance-get.component.spec.ts | TypeScript |
ClassDeclaration |
@Component({
selector: 'app-play-wth-data',
template: '',
})
class MockPlayWithDataComponent {
@Input() headers: object;
@Input() accountIdFlag: boolean;
@Input() variablePathEnd: string;
} | kloose/XS2A-Sandbox | developer-portal-ui/src/app/components/test-cases/components/api-endpoints/accinf-balance-get/accinf-balance-get.component.spec.ts | TypeScript |
ClassDeclaration |
@Pipe({ name: 'translate' })
class TranslatePipe implements PipeTransform {
transform(value) {
const tmp = value.split('.');
return tmp[1];
}
} | kloose/XS2A-Sandbox | developer-portal-ui/src/app/components/test-cases/components/api-endpoints/accinf-balance-get/accinf-balance-get.component.spec.ts | TypeScript |
MethodDeclaration |
transform(value) {
const tmp = value.split('.');
return tmp[1];
} | kloose/XS2A-Sandbox | developer-portal-ui/src/app/components/test-cases/components/api-endpoints/accinf-balance-get/accinf-balance-get.component.spec.ts | TypeScript |
MethodDeclaration | /**
* Gets configuration of perun apps brandings and apps\' domains
* Returns object of type PerunAppsConfig
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
public getAppsConfig(observe?: 'body', reportProgress?: boolean): Observable<PerunAppsConfig>; | Kuliak/perun-web-apps | libs/perun/openapi/src/lib/api/utils.service.ts | TypeScript |
MethodDeclaration |
public getAppsConfig(
observe?: 'response',
reportProgress?: boolean
): Observable<HttpResponse<PerunAppsConfig>>; | Kuliak/perun-web-apps | libs/perun/openapi/src/lib/api/utils.service.ts | TypeScript |
MethodDeclaration |
public getAppsConfig(
observe?: 'events',
reportProgress?: boolean
): Observable<HttpEvent<PerunAppsConfig>>; | Kuliak/perun-web-apps | libs/perun/openapi/src/lib/api/utils.service.ts | TypeScript |
MethodDeclaration |
public getAppsConfig(observe: any = 'body', reportProgress: boolean = false): Observable<any> {
let headers = this.defaultHeaders;
// authentication (ApiKeyAuth) required
if (this.configuration.apiKeys && this.configuration.apiKeys['Authorization']) {
headers = headers.set('Authorization', this.configuration.apiKeys['Authorization']);
}
// authentication (BasicAuth) required
if (this.configuration.username || this.configuration.password) {
headers = headers.set(
'Authorization',
'Basic ' + btoa(this.configuration.username + ':' + this.configuration.password)
);
}
// authentication (BearerAuth) required
if (this.configuration.accessToken) {
const accessToken =
typeof this.configuration.accessToken === 'function'
? this.configuration.accessToken()
: this.configuration.accessToken;
headers = headers.set('Authorization', 'Bearer ' + accessToken);
}
// to determine the Accept header
const httpHeaderAccepts: string[] = ['application/json'];
const httpHeaderAcceptSelected: string | undefined =
this.configuration.selectHeaderAccept(httpHeaderAccepts);
if (httpHeaderAcceptSelected !== undefined) {
headers = headers.set('Accept', httpHeaderAcceptSelected);
}
return this.httpClient.get<PerunAppsConfig>(
`${this.configuration.basePath}/json/utils/getAppsConfig`,
{
withCredentials: this.configuration.withCredentials,
headers: headers,
observe: observe,
reportProgress: reportProgress,
}
);
} | Kuliak/perun-web-apps | libs/perun/openapi/src/lib/api/utils.service.ts | TypeScript |
MethodDeclaration | /**
* Gets perun-web-gui.properties as Map<String,String>
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
public getGuiConfiguration(
observe?: 'body',
reportProgress?: boolean
): Observable<{ [key: string]: string }>; | Kuliak/perun-web-apps | libs/perun/openapi/src/lib/api/utils.service.ts | TypeScript |
MethodDeclaration |
public getGuiConfiguration(
observe?: 'response',
reportProgress?: boolean
): Observable<HttpResponse<{ [key: string]: string }>>; | Kuliak/perun-web-apps | libs/perun/openapi/src/lib/api/utils.service.ts | TypeScript |
MethodDeclaration |
public getGuiConfiguration(
observe?: 'events',
reportProgress?: boolean
): Observable<HttpEvent<{ [key: string]: string }>>; | Kuliak/perun-web-apps | libs/perun/openapi/src/lib/api/utils.service.ts | TypeScript |
MethodDeclaration |
public getGuiConfiguration(
observe: any = 'body',
reportProgress: boolean = false
): Observable<any> {
let headers = this.defaultHeaders;
// authentication (ApiKeyAuth) required
if (this.configuration.apiKeys && this.configuration.apiKeys['Authorization']) {
headers = headers.set('Authorization', this.configuration.apiKeys['Authorization']);
}
// authentication (BasicAuth) required
if (this.configuration.username || this.configuration.password) {
headers = headers.set(
'Authorization',
'Basic ' + btoa(this.configuration.username + ':' + this.configuration.password)
);
}
// authentication (BearerAuth) required
if (this.configuration.accessToken) {
const accessToken =
typeof this.configuration.accessToken === 'function'
? this.configuration.accessToken()
: this.configuration.accessToken;
headers = headers.set('Authorization', 'Bearer ' + accessToken);
}
// to determine the Accept header
const httpHeaderAccepts: string[] = ['application/json'];
const httpHeaderAcceptSelected: string | undefined =
this.configuration.selectHeaderAccept(httpHeaderAccepts);
if (httpHeaderAcceptSelected !== undefined) {
headers = headers.set('Accept', httpHeaderAcceptSelected);
}
return this.httpClient.get<{ [key: string]: string }>(
`${this.configuration.basePath}/json/utils/getGuiConfiguration`,
{
withCredentials: this.configuration.withCredentials,
headers: headers,
observe: observe,
reportProgress: reportProgress,
}
);
} | Kuliak/perun-web-apps | libs/perun/openapi/src/lib/api/utils.service.ts | TypeScript |
MethodDeclaration | /**
* Gets Perun runtime status
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
public getPerunRPCVersion(observe?: 'body', reportProgress?: boolean): Observable<string>; | Kuliak/perun-web-apps | libs/perun/openapi/src/lib/api/utils.service.ts | TypeScript |
MethodDeclaration |
public getPerunRPCVersion(
observe?: 'response',
reportProgress?: boolean
): Observable<HttpResponse<string>>; | Kuliak/perun-web-apps | libs/perun/openapi/src/lib/api/utils.service.ts | TypeScript |
MethodDeclaration |
public getPerunRPCVersion(
observe?: 'events',
reportProgress?: boolean
): Observable<HttpEvent<string>>; | Kuliak/perun-web-apps | libs/perun/openapi/src/lib/api/utils.service.ts | TypeScript |
MethodDeclaration |
public getPerunRPCVersion(
observe: any = 'body',
reportProgress: boolean = false
): Observable<any> {
let headers = this.defaultHeaders;
// authentication (ApiKeyAuth) required
if (this.configuration.apiKeys && this.configuration.apiKeys['Authorization']) {
headers = headers.set('Authorization', this.configuration.apiKeys['Authorization']);
}
// authentication (BasicAuth) required
if (this.configuration.username || this.configuration.password) {
headers = headers.set(
'Authorization',
'Basic ' + btoa(this.configuration.username + ':' + this.configuration.password)
);
}
// authentication (BearerAuth) required
if (this.configuration.accessToken) {
const accessToken =
typeof this.configuration.accessToken === 'function'
? this.configuration.accessToken()
: this.configuration.accessToken;
headers = headers.set('Authorization', 'Bearer ' + accessToken);
}
// to determine the Accept header
const httpHeaderAccepts: string[] = ['text/plain'];
const httpHeaderAcceptSelected: string | undefined =
this.configuration.selectHeaderAccept(httpHeaderAccepts);
if (httpHeaderAcceptSelected !== undefined) {
headers = headers.set('Accept', httpHeaderAcceptSelected);
}
return this.httpClient.get<string>(`${this.configuration.basePath}/`, {
withCredentials: this.configuration.withCredentials,
headers: headers,
observe: observe,
reportProgress: reportProgress,
});
} | Kuliak/perun-web-apps | libs/perun/openapi/src/lib/api/utils.service.ts | TypeScript |
MethodDeclaration | /**
* Gets Perun runtime statistics
* Returns list of strings which looks like this \"Timestamp: \'2019-11-14 10:46:39.613\'\", \"USERS: \'39927\'\", \"FACILITIES: \'552\'\", \"DESTINATIONS: \'2568\'\", \"VOS: \'341\'\", \"RESOURCES: \'2560\'\", \"GROUPS: \'2300\'\", \"AUDITMESSAGES: \'7333237\'\"
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
public getPerunStatistics(observe?: 'body', reportProgress?: boolean): Observable<Array<string>>; | Kuliak/perun-web-apps | libs/perun/openapi/src/lib/api/utils.service.ts | TypeScript |
MethodDeclaration |
public getPerunStatistics(
observe?: 'response',
reportProgress?: boolean
): Observable<HttpResponse<Array<string>>>; | Kuliak/perun-web-apps | libs/perun/openapi/src/lib/api/utils.service.ts | TypeScript |
MethodDeclaration |
public getPerunStatistics(
observe?: 'events',
reportProgress?: boolean
): Observable<HttpEvent<Array<string>>>; | Kuliak/perun-web-apps | libs/perun/openapi/src/lib/api/utils.service.ts | TypeScript |
MethodDeclaration |
public getPerunStatistics(
observe: any = 'body',
reportProgress: boolean = false
): Observable<any> {
let headers = this.defaultHeaders;
// authentication (ApiKeyAuth) required
if (this.configuration.apiKeys && this.configuration.apiKeys['Authorization']) {
headers = headers.set('Authorization', this.configuration.apiKeys['Authorization']);
}
// authentication (BasicAuth) required
if (this.configuration.username || this.configuration.password) {
headers = headers.set(
'Authorization',
'Basic ' + btoa(this.configuration.username + ':' + this.configuration.password)
);
}
// authentication (BearerAuth) required
if (this.configuration.accessToken) {
const accessToken =
typeof this.configuration.accessToken === 'function'
? this.configuration.accessToken()
: this.configuration.accessToken;
headers = headers.set('Authorization', 'Bearer ' + accessToken);
}
// to determine the Accept header
const httpHeaderAccepts: string[] = ['application/json'];
const httpHeaderAcceptSelected: string | undefined =
this.configuration.selectHeaderAccept(httpHeaderAccepts);
if (httpHeaderAcceptSelected !== undefined) {
headers = headers.set('Accept', httpHeaderAcceptSelected);
}
return this.httpClient.get<Array<string>>(
`${this.configuration.basePath}/json/utils/getPerunStatistics`,
{
withCredentials: this.configuration.withCredentials,
headers: headers,
observe: observe,
reportProgress: reportProgress,
}
);
} | Kuliak/perun-web-apps | libs/perun/openapi/src/lib/api/utils.service.ts | TypeScript |
MethodDeclaration | /**
* Gets Perun runtime status
* Returns list of strings which looks like this \"Version of Perun: 3.8.6\", \"Version of PerunDB: 3.1.55\", \"Version of Servlet: Apache Tomcat/9.0.16 (Debian)\", \"Version of DB-driver: PostgreSQL JDBC Driver-42.2.8\", \"Version of DB: PostgreSQL-12.0 (Debian 12.0-2.pgdg100+1)\", \"Version of Java platform: 11.0.5\", \"AuditerConsumer: \'127.0.0.1:6071\' with last processed id=\'23463958\'\", \"AuditerConsumer: \'ldapcConsumer\' with last processed id=\'23463958\'\", \"AuditerConsumer: \'notifications\' with last processed id=\'23463952\'\", \"LastMessageId: 23463958\", \"Timestamp: 2019-11-14 10:12:30.99\"
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
public getPerunStatus(observe?: 'body', reportProgress?: boolean): Observable<Array<string>>; | Kuliak/perun-web-apps | libs/perun/openapi/src/lib/api/utils.service.ts | TypeScript |
MethodDeclaration |
public getPerunStatus(
observe?: 'response',
reportProgress?: boolean
): Observable<HttpResponse<Array<string>>>; | Kuliak/perun-web-apps | libs/perun/openapi/src/lib/api/utils.service.ts | TypeScript |
MethodDeclaration |
public getPerunStatus(
observe?: 'events',
reportProgress?: boolean
): Observable<HttpEvent<Array<string>>>; | Kuliak/perun-web-apps | libs/perun/openapi/src/lib/api/utils.service.ts | TypeScript |
MethodDeclaration |
public getPerunStatus(observe: any = 'body', reportProgress: boolean = false): Observable<any> {
let headers = this.defaultHeaders;
// authentication (ApiKeyAuth) required
if (this.configuration.apiKeys && this.configuration.apiKeys['Authorization']) {
headers = headers.set('Authorization', this.configuration.apiKeys['Authorization']);
}
// authentication (BasicAuth) required
if (this.configuration.username || this.configuration.password) {
headers = headers.set(
'Authorization',
'Basic ' + btoa(this.configuration.username + ':' + this.configuration.password)
);
}
// authentication (BearerAuth) required
if (this.configuration.accessToken) {
const accessToken =
typeof this.configuration.accessToken === 'function'
? this.configuration.accessToken()
: this.configuration.accessToken;
headers = headers.set('Authorization', 'Bearer ' + accessToken);
}
// to determine the Accept header
const httpHeaderAccepts: string[] = ['application/json'];
const httpHeaderAcceptSelected: string | undefined =
this.configuration.selectHeaderAccept(httpHeaderAccepts);
if (httpHeaderAcceptSelected !== undefined) {
headers = headers.set('Accept', httpHeaderAcceptSelected);
}
return this.httpClient.get<Array<string>>(
`${this.configuration.basePath}/json/utils/getPerunStatus`,
{
withCredentials: this.configuration.withCredentials,
headers: headers,
observe: observe,
reportProgress: reportProgress,
}
);
} | Kuliak/perun-web-apps | libs/perun/openapi/src/lib/api/utils.service.ts | TypeScript |
MethodDeclaration | /**
* Gets Perun system time in milliseconds since the epoch
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
public getPerunSystemTimeInMillis(observe?: 'body', reportProgress?: boolean): Observable<number>; | Kuliak/perun-web-apps | libs/perun/openapi/src/lib/api/utils.service.ts | TypeScript |
MethodDeclaration |
public getPerunSystemTimeInMillis(
observe?: 'response',
reportProgress?: boolean
): Observable<HttpResponse<number>>; | Kuliak/perun-web-apps | libs/perun/openapi/src/lib/api/utils.service.ts | TypeScript |
MethodDeclaration |
public getPerunSystemTimeInMillis(
observe?: 'events',
reportProgress?: boolean
): Observable<HttpEvent<number>>; | Kuliak/perun-web-apps | libs/perun/openapi/src/lib/api/utils.service.ts | TypeScript |
MethodDeclaration |
public getPerunSystemTimeInMillis(
observe: any = 'body',
reportProgress: boolean = false
): Observable<any> {
let headers = this.defaultHeaders;
// authentication (ApiKeyAuth) required
if (this.configuration.apiKeys && this.configuration.apiKeys['Authorization']) {
headers = headers.set('Authorization', this.configuration.apiKeys['Authorization']);
}
// authentication (BasicAuth) required
if (this.configuration.username || this.configuration.password) {
headers = headers.set(
'Authorization',
'Basic ' + btoa(this.configuration.username + ':' + this.configuration.password)
);
}
// authentication (BearerAuth) required
if (this.configuration.accessToken) {
const accessToken =
typeof this.configuration.accessToken === 'function'
? this.configuration.accessToken()
: this.configuration.accessToken;
headers = headers.set('Authorization', 'Bearer ' + accessToken);
}
// to determine the Accept header
const httpHeaderAccepts: string[] = ['application/json'];
const httpHeaderAcceptSelected: string | undefined =
this.configuration.selectHeaderAccept(httpHeaderAccepts);
if (httpHeaderAcceptSelected !== undefined) {
headers = headers.set('Accept', httpHeaderAcceptSelected);
}
return this.httpClient.get<number>(
`${this.configuration.basePath}/json/utils/getPerunSystemTimeInMillis`,
{
withCredentials: this.configuration.withCredentials,
headers: headers,
observe: observe,
reportProgress: reportProgress,
}
);
} | Kuliak/perun-web-apps | libs/perun/openapi/src/lib/api/utils.service.ts | TypeScript |
ClassDeclaration | /** @public */
export abstract class IModelTileRpcInterface extends RpcInterface {
public static getClient(): IModelTileRpcInterface { return RpcManager.getClientForInterface(IModelTileRpcInterface); }
/** The immutable name of the interface. */
public static readonly interfaceName = "IModelTileRpcInterface";
/** The semantic version of the interface. */
public static interfaceVersion = "2.0.0";
/*===========================================================================================
NOTE: Any add/remove/change to the methods below requires an update of the interface version.
NOTE: Please consult the README in this folder for the semantic versioning rules.
===========================================================================================*/
/** @beta */
public async getTileCacheContainerUrl(_tokenProps: IModelRpcProps, _id: CloudStorageContainerDescriptor): Promise<CloudStorageContainerUrl> {
return this.forward(arguments);
}
/** @internal */
public async requestTileTreeProps(_tokenProps: IModelRpcProps, _id: string): Promise<TileTreeProps> { return this.forward(arguments); }
/** @internal */
public async requestTileContent(iModelToken: IModelRpcProps, treeId: string, contentId: string, isCanceled?: () => boolean, guid?: string): Promise<Uint8Array> {
const cached = await IModelTileRpcInterface.checkCache(iModelToken, treeId, contentId, guid);
if (undefined === cached && undefined !== isCanceled && isCanceled())
throw new AbandonedError();
return cached || this.forward(arguments);
}
/** This is a temporary workaround for folks developing authoring applications, to be removed when proper support for such applications is introduced.
* Given a set of model Ids, it purges any associated tile tree state on the back-end so that the next request for the tile tree or content will recreate that state.
* Invoked after a modification is made to the model(s).
* If no array of model Ids is supplied, it purges *all* tile trees, which can be quite inefficient.
* @internal
*/
public async purgeTileTrees(_tokenProps: IModelRpcProps, _modelIds: Id64Array | undefined): Promise<void> { return this.forward(arguments); }
private static async checkCache(tokenProps: IModelRpcProps, treeId: string, contentId: string, guid: string | undefined): Promise<Uint8Array | undefined> {
return CloudStorageTileCache.getCache().retrieve({ tokenProps, treeId, contentId, guid });
}
} | rssahai/imodeljs | core/common/src/rpc/IModelTileRpcInterface.ts | TypeScript |
MethodDeclaration |
public static getClient(): IModelTileRpcInterface { return RpcManager.getClientForInterface(IModelTileRpcInterface); } | rssahai/imodeljs | core/common/src/rpc/IModelTileRpcInterface.ts | TypeScript |
MethodDeclaration | /*===========================================================================================
NOTE: Any add/remove/change to the methods below requires an update of the interface version.
NOTE: Please consult the README in this folder for the semantic versioning rules.
===========================================================================================*/
/** @beta */
public async getTileCacheContainerUrl(_tokenProps: IModelRpcProps, _id: CloudStorageContainerDescriptor): Promise<CloudStorageContainerUrl> {
return this.forward(arguments);
} | rssahai/imodeljs | core/common/src/rpc/IModelTileRpcInterface.ts | TypeScript |
MethodDeclaration | /** @internal */
public async requestTileTreeProps(_tokenProps: IModelRpcProps, _id: string): Promise<TileTreeProps> { return this.forward(arguments); } | rssahai/imodeljs | core/common/src/rpc/IModelTileRpcInterface.ts | TypeScript |
MethodDeclaration | /** @internal */
public async requestTileContent(iModelToken: IModelRpcProps, treeId: string, contentId: string, isCanceled?: () => boolean, guid?: string): Promise<Uint8Array> {
const cached = await IModelTileRpcInterface.checkCache(iModelToken, treeId, contentId, guid);
if (undefined === cached && undefined !== isCanceled && isCanceled())
throw new AbandonedError();
return cached || this.forward(arguments);
} | rssahai/imodeljs | core/common/src/rpc/IModelTileRpcInterface.ts | TypeScript |
MethodDeclaration | /** This is a temporary workaround for folks developing authoring applications, to be removed when proper support for such applications is introduced.
* Given a set of model Ids, it purges any associated tile tree state on the back-end so that the next request for the tile tree or content will recreate that state.
* Invoked after a modification is made to the model(s).
* If no array of model Ids is supplied, it purges *all* tile trees, which can be quite inefficient.
* @internal
*/
public async purgeTileTrees(_tokenProps: IModelRpcProps, _modelIds: Id64Array | undefined): Promise<void> { return this.forward(arguments); } | rssahai/imodeljs | core/common/src/rpc/IModelTileRpcInterface.ts | TypeScript |
MethodDeclaration |
private static async checkCache(tokenProps: IModelRpcProps, treeId: string, contentId: string, guid: string | undefined): Promise<Uint8Array | undefined> {
return CloudStorageTileCache.getCache().retrieve({ tokenProps, treeId, contentId, guid });
} | rssahai/imodeljs | core/common/src/rpc/IModelTileRpcInterface.ts | TypeScript |
ClassDeclaration |
@Injectable({
providedIn: "root"
})
export class MiembroService {
public miembroDocRef: DocumentReference;
public miembro: Miembro = {
id: '',
nombre: '',
correo: '',
passGenerada: '',
facultad: '',
institucion: '',
puesto: '',
rol: '',
sni: '',
};
private dictionary: Array<String>;
constructor(
public db: AngularFirestore,
private afsAuth: AngularFireAuth
) { }
obtenerMiembros() {
return this.db.collection("miembros").ref.orderBy("nombre").get();
}
obtenerMiembroId(idMiembro: string) {
return this.db.collection("miembros").doc(idMiembro).ref;
}
obtenerMiembro(correo: string) {
return this.db.collection("miembros").ref.where("correo", "==", correo).limit(1).get();
}
registrarMiembro(nombre: string, correo: string, rol: string) {
var dbTemp = this.db;
var config = {
apiKey: "AIzaSyB8U1sGZ0nv84GoFy68BUYg9qxIjOc7dwM",
authDomain: "arpa-desktop.firebaseapp.com",
databaseURL: "https://arpa-desktop.firebaseio.com"
};
var segundaConexion = firebase.initializeApp(config, "Secundiaria");
var caracteres: String = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPWRSTUVWXYZ0123456789";
this.dictionary = caracteres.split("");
var passGenerada = "";
for (var i = 0; i < 6; i++) {
passGenerada += this.dictionary[Math.floor(Math.random() * this.dictionary.length)];
}
console.log(passGenerada);
segundaConexion.auth().createUserWithEmailAndPassword(correo, passGenerada).then(function (firebaseUser) {
console.log("User " + firebaseUser.user.uid + " created successfully!");
dbTemp.collection("miembros").doc(firebaseUser.user.uid).set({
nombre: nombre,
correo: correo,
rol: rol,
passGenerada: passGenerada.toString()
});
segundaConexion.auth().signOut();
}).catch(function (error) {
console.log(error);
});
return passGenerada;
}
degradarMiembro(idMiembro: string) {
var docRef = this.db.collection("miembros").doc(idMiembro).ref;
docRef.get().then(function (doc) {
docRef.update({
rol: "Colaborador"
});
});
}
ascenderColaborador(idMiembro: string) {
var docRef = this.db.doc("miembros/" + idMiembro).ref.get();
docRef.then(function (doc) {
doc.ref.update({
rol: "Miembro"
});
});
return docRef;
}
setMiembroActivo(idMiembro: string) {
this.miembroDocRef = this.db.collection("miembros").doc(idMiembro).ref;
}
getMiembroActivo() {
return this.miembroDocRef;
}
obtenerEstudios(idMiembro) {
return this.db.collection("miembros").doc(idMiembro).collection("estudios").ref.orderBy("titulo").get();
}
agregarEstudio(idMiembro, estudio) {
return this.db.collection("miembros").doc(idMiembro).collection("estudios").add(estudio);
}
modificarEstudio(idMiembro, estudio) {
return this.db.collection("miembros").doc(idMiembro).collection("estudios").doc(estudio.id).set(estudio)
}
eliminarEstudio(idMiembro, idEstudio) {
return this.db.collection("miembros").doc(idMiembro).collection("estudios").doc(idEstudio).delete();
}
actualizarDatos(miembro) {
this.afsAuth.auth.currentUser.updatePassword(miembro.passGenerada);
return this.db.collection("miembros").doc(miembro.id).set({
nombre: miembro.nombre,
correo: miembro.correo,
passGenerada: miembro.passGenerada,
facultad: miembro.facultad,
institucion: miembro.institucion,
puesto: miembro.puesto,
sni: miembro.sni,
rol: miembro.rol
});
}
agregarOActualizarColaboradorExterno(idMiembro, colaborador) {
console.log(colaborador);
if(isUndefined(colaborador.id)) {
console.log(idMiembro);
return this.db.collection("miembros").doc(idMiembro).collection("colaboradores").add(colaborador);
} else {
return this.db.collection("miembros").doc(idMiembro).collection("colaboradores").doc(colaborador.id).set(colaborador);
}
}
eliminarColaboradorExterno(idMiembro, idColaborador) {
return this.db.collection("miembros").doc(idMiembro).collection("colaboradores").doc(idColaborador).delete();
}
obtenerColaboradoresExternos(idMiembro) {
return this.db.collection("miembros").doc(idMiembro).collection("colaboradores").ref.orderBy("nombre").get();
}
} | Manolomon/arpa-desktop | src/app/servicios/miembro.service.ts | TypeScript |
MethodDeclaration |
obtenerMiembros() {
return this.db.collection("miembros").ref.orderBy("nombre").get();
} | Manolomon/arpa-desktop | src/app/servicios/miembro.service.ts | TypeScript |
MethodDeclaration |
obtenerMiembroId(idMiembro: string) {
return this.db.collection("miembros").doc(idMiembro).ref;
} | Manolomon/arpa-desktop | src/app/servicios/miembro.service.ts | TypeScript |
MethodDeclaration |
obtenerMiembro(correo: string) {
return this.db.collection("miembros").ref.where("correo", "==", correo).limit(1).get();
} | Manolomon/arpa-desktop | src/app/servicios/miembro.service.ts | TypeScript |
MethodDeclaration |
registrarMiembro(nombre: string, correo: string, rol: string) {
var dbTemp = this.db;
var config = {
apiKey: "AIzaSyB8U1sGZ0nv84GoFy68BUYg9qxIjOc7dwM",
authDomain: "arpa-desktop.firebaseapp.com",
databaseURL: "https://arpa-desktop.firebaseio.com"
};
var segundaConexion = firebase.initializeApp(config, "Secundiaria");
var caracteres: String = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPWRSTUVWXYZ0123456789";
this.dictionary = caracteres.split("");
var passGenerada = "";
for (var i = 0; i < 6; i++) {
passGenerada += this.dictionary[Math.floor(Math.random() * this.dictionary.length)];
}
console.log(passGenerada);
segundaConexion.auth().createUserWithEmailAndPassword(correo, passGenerada).then(function (firebaseUser) {
console.log("User " + firebaseUser.user.uid + " created successfully!");
dbTemp.collection("miembros").doc(firebaseUser.user.uid).set({
nombre: nombre,
correo: correo,
rol: rol,
passGenerada: passGenerada.toString()
});
segundaConexion.auth().signOut();
}).catch(function (error) {
console.log(error);
});
return passGenerada;
} | Manolomon/arpa-desktop | src/app/servicios/miembro.service.ts | TypeScript |
MethodDeclaration |
degradarMiembro(idMiembro: string) {
var docRef = this.db.collection("miembros").doc(idMiembro).ref;
docRef.get().then(function (doc) {
docRef.update({
rol: "Colaborador"
});
});
} | Manolomon/arpa-desktop | src/app/servicios/miembro.service.ts | TypeScript |
MethodDeclaration |
ascenderColaborador(idMiembro: string) {
var docRef = this.db.doc("miembros/" + idMiembro).ref.get();
docRef.then(function (doc) {
doc.ref.update({
rol: "Miembro"
});
});
return docRef;
} | Manolomon/arpa-desktop | src/app/servicios/miembro.service.ts | TypeScript |
MethodDeclaration |
setMiembroActivo(idMiembro: string) {
this.miembroDocRef = this.db.collection("miembros").doc(idMiembro).ref;
} | Manolomon/arpa-desktop | src/app/servicios/miembro.service.ts | TypeScript |
MethodDeclaration |
getMiembroActivo() {
return this.miembroDocRef;
} | Manolomon/arpa-desktop | src/app/servicios/miembro.service.ts | TypeScript |
MethodDeclaration |
obtenerEstudios(idMiembro) {
return this.db.collection("miembros").doc(idMiembro).collection("estudios").ref.orderBy("titulo").get();
} | Manolomon/arpa-desktop | src/app/servicios/miembro.service.ts | TypeScript |
MethodDeclaration |
agregarEstudio(idMiembro, estudio) {
return this.db.collection("miembros").doc(idMiembro).collection("estudios").add(estudio);
} | Manolomon/arpa-desktop | src/app/servicios/miembro.service.ts | TypeScript |
MethodDeclaration |
modificarEstudio(idMiembro, estudio) {
return this.db.collection("miembros").doc(idMiembro).collection("estudios").doc(estudio.id).set(estudio)
} | Manolomon/arpa-desktop | src/app/servicios/miembro.service.ts | TypeScript |
MethodDeclaration |
eliminarEstudio(idMiembro, idEstudio) {
return this.db.collection("miembros").doc(idMiembro).collection("estudios").doc(idEstudio).delete();
} | Manolomon/arpa-desktop | src/app/servicios/miembro.service.ts | TypeScript |
MethodDeclaration |
actualizarDatos(miembro) {
this.afsAuth.auth.currentUser.updatePassword(miembro.passGenerada);
return this.db.collection("miembros").doc(miembro.id).set({
nombre: miembro.nombre,
correo: miembro.correo,
passGenerada: miembro.passGenerada,
facultad: miembro.facultad,
institucion: miembro.institucion,
puesto: miembro.puesto,
sni: miembro.sni,
rol: miembro.rol
});
} | Manolomon/arpa-desktop | src/app/servicios/miembro.service.ts | TypeScript |
MethodDeclaration |
agregarOActualizarColaboradorExterno(idMiembro, colaborador) {
console.log(colaborador);
if(isUndefined(colaborador.id)) {
console.log(idMiembro);
return this.db.collection("miembros").doc(idMiembro).collection("colaboradores").add(colaborador);
} else {
return this.db.collection("miembros").doc(idMiembro).collection("colaboradores").doc(colaborador.id).set(colaborador);
}
} | Manolomon/arpa-desktop | src/app/servicios/miembro.service.ts | TypeScript |
MethodDeclaration |
eliminarColaboradorExterno(idMiembro, idColaborador) {
return this.db.collection("miembros").doc(idMiembro).collection("colaboradores").doc(idColaborador).delete();
} | Manolomon/arpa-desktop | src/app/servicios/miembro.service.ts | TypeScript |
MethodDeclaration |
obtenerColaboradoresExternos(idMiembro) {
return this.db.collection("miembros").doc(idMiembro).collection("colaboradores").ref.orderBy("nombre").get();
} | Manolomon/arpa-desktop | src/app/servicios/miembro.service.ts | TypeScript |
FunctionDeclaration |
function _fillFunc(context) {
context.fillText(this.partialText, 0, 0);
} | phucdo1711/konva | src/shapes/TextPath.ts | TypeScript |
FunctionDeclaration |
function _strokeFunc(context) {
context.strokeText(this.partialText, 0, 0);
} | phucdo1711/konva | src/shapes/TextPath.ts | TypeScript |
InterfaceDeclaration |
export interface TextPathConfig extends ShapeConfig {
text?: string;
data?: string;
fontFamily?: string;
fontSize?: number;
fontStyle?: string;
letterSpacing?: number;
startOffset?: number;
textAnchor?: string;
} | phucdo1711/konva | src/shapes/TextPath.ts | TypeScript |
MethodDeclaration |
_sceneFunc(context) {
context.setAttr('font', this._getContextFont());
context.setAttr('textBaseline', this.textBaseline());
context.setAttr('textAlign', 'left');
context.save();
var textDecoration = this.textDecoration();
var fill = this.fill();
var fontSize = this.fontSize();
var glyphInfo = this.glyphInfo;
if (textDecoration === 'underline') {
context.beginPath();
}
for (var i = 0; i < glyphInfo.length; i++) {
context.save();
var p0 = glyphInfo[i].p0;
context.translate(p0.x, p0.y);
context.rotate(glyphInfo[i].rotation);
this.partialText = glyphInfo[i].text;
context.fillStrokeShape(this);
if (textDecoration === 'underline') {
if (i === 0) {
context.moveTo(0, fontSize / 2 + 1);
}
context.lineTo(fontSize, fontSize / 2 + 1);
}
context.restore();
//// To assist with debugging visually, uncomment following
//
// if (i % 2) context.strokeStyle = 'cyan';
// else context.strokeStyle = 'green';
// var p1 = glyphInfo[i].p1;
// context.moveTo(p0.x, p0.y);
// context.lineTo(p1.x, p1.y);
// context.stroke();
}
if (textDecoration === 'underline') {
context.strokeStyle = fill;
context.lineWidth = fontSize / 20;
context.stroke();
}
context.restore();
} | phucdo1711/konva | src/shapes/TextPath.ts | TypeScript |
MethodDeclaration |
_hitFunc(context) {
context.beginPath();
var glyphInfo = this.glyphInfo;
if (glyphInfo.length >= 1) {
var p0 = glyphInfo[0].p0;
context.moveTo(p0.x, p0.y);
}
for (var i = 0; i < glyphInfo.length; i++) {
var p1 = glyphInfo[i].p1;
context.lineTo(p1.x, p1.y);
}
context.setAttr('lineWidth', this.fontSize());
context.setAttr('strokeStyle', this.colorKey);
context.stroke();
} | phucdo1711/konva | src/shapes/TextPath.ts | TypeScript |
MethodDeclaration | /**
* get text width in pixels
* @method
* @name Konva.TextPath#getTextWidth
*/
getTextWidth() {
return this.textWidth;
} | phucdo1711/konva | src/shapes/TextPath.ts | TypeScript |
MethodDeclaration |
getTextHeight() {
Util.warn(
'text.getTextHeight() method is deprecated. Use text.height() - for full height and text.fontSize() - for one line height.'
);
return this.textHeight;
} | phucdo1711/konva | src/shapes/TextPath.ts | TypeScript |
MethodDeclaration |
setText(text) {
return Text.prototype.setText.call(this, text);
} | phucdo1711/konva | src/shapes/TextPath.ts | TypeScript |