@memberjunction/ng-credentials 6.1.4 → 6.2.0-edge.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (21) hide show
  1. package/dist/lib/dialogs/credential-dialog.component.d.ts +18 -2
  2. package/dist/lib/dialogs/credential-dialog.component.d.ts.map +1 -1
  3. package/dist/lib/dialogs/credential-dialog.component.js +47 -15
  4. package/dist/lib/dialogs/credential-dialog.component.js.map +1 -1
  5. package/dist/lib/panels/credential-category-edit-panel/credential-category-edit-panel.component.d.ts +76 -8
  6. package/dist/lib/panels/credential-category-edit-panel/credential-category-edit-panel.component.d.ts.map +1 -1
  7. package/dist/lib/panels/credential-category-edit-panel/credential-category-edit-panel.component.js +164 -50
  8. package/dist/lib/panels/credential-category-edit-panel/credential-category-edit-panel.component.js.map +1 -1
  9. package/dist/lib/panels/credential-edit-panel/credential-edit-panel.component.d.ts +129 -16
  10. package/dist/lib/panels/credential-edit-panel/credential-edit-panel.component.d.ts.map +1 -1
  11. package/dist/lib/panels/credential-edit-panel/credential-edit-panel.component.js +338 -124
  12. package/dist/lib/panels/credential-edit-panel/credential-edit-panel.component.js.map +1 -1
  13. package/dist/lib/panels/credential-type-edit-panel/credential-type-edit-panel.component.d.ts +81 -9
  14. package/dist/lib/panels/credential-type-edit-panel/credential-type-edit-panel.component.d.ts.map +1 -1
  15. package/dist/lib/panels/credential-type-edit-panel/credential-type-edit-panel.component.js +207 -71
  16. package/dist/lib/panels/credential-type-edit-panel/credential-type-edit-panel.component.js.map +1 -1
  17. package/dist/lib/services/credential-dialog.service.d.ts +10 -0
  18. package/dist/lib/services/credential-dialog.service.d.ts.map +1 -1
  19. package/dist/lib/services/credential-dialog.service.js +27 -7
  20. package/dist/lib/services/credential-dialog.service.js.map +1 -1
  21. package/package.json +9 -9
@@ -1 +1 @@
1
- {"version":3,"file":"credential-type-edit-panel.component.js","sourceRoot":"","sources":["../../../../src/lib/panels/credential-type-edit-panel/credential-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B;QACpC,IAAK,KAAK,CAAC,MAAsB,CAAC,SAAS,CAAC,QAAQ,CAAC,gBAAgB,CAAC,EAAE,CAAC;YACrE,IAAI,CAAC,UAAU,EAAE,CAAC;QACtB,CAAC;IACL,CAAC;IAEM,eAAe,CAAC,QAAgB;QACnC,MAAM,OAAO,GAA2B;YACpC,IAAI,EAAE,mBAAmB;YACzB,eAAe,EAAE,sBAAsB;YACvC,SAAS,EAAE,mBAAmB;YAC9B,UAAU,EAAE,sBAAsB;YAClC,gBAAgB,EAAE,2BAA2B;YAC7C,aAAa,EAAE,kBAAkB;SACpC,CAAC;QACF,OAAO,OAAO,CAAC,QAAQ,CAAC,IAAI,iBAAiB,CAAC;IAClD,CAAC;IAEM,gBAAgB,CAAC,QAAgB;QACpC,MAAM,QAAQ,GAA2B;YACrC,IAAI,EAAE,yBAAyB;YAC/B,eAAe,EAAE,yBAAyB;YAC1C,SAAS,EAAE,yBAAyB;YACpC,UAAU,EAAE,0BAA0B;YACtC,gBAAgB,EAAE,0BAA0B;YAC5C,aAAa,EAAE,yBAAyB;SAC3C,CAAC;QACF,OAAO,QAAQ,CAAC,QAAQ,CAAC,IAAI,yBAAyB,CAAC;IAC3D,CAAC;wGAjTQ,gCAAgC;4FAAhC,gCAAgC,kPCzB7C,ujUA4OA;;4FDnNa,gCAAgC;kBAP5C,SAAS;iCACI,KAAK,YACL,+BAA+B,mBAGxB,uBAAuB,CAAC,MAAM;;sBAG9C,KAAK;;sBACL,KAAK;;sBAEL,MAAM;;sBACN,MAAM;;sBACN,MAAM","sourcesContent":["import { Component, Input, Output, EventEmitter, ChangeDetectorRef, ChangeDetectionStrategy, OnInit } from '@angular/core';\nimport { MJCredentialTypeEntity } from '@memberjunction/core-entities';\nimport { MJNotificationService } from '@memberjunction/ng-notifications';\nimport { MJConfirmService } from '@memberjunction/ng-ui-components';\nimport { BaseAngularComponent } from '@memberjunction/ng-base-types';\n\ntype CategoryType = 'AI' | 'Authentication' | 'Communication' | 'Database' | 'Integration' | 'Storage';\n\ninterface SchemaField {\n name: string;\n type: string;\n title: string;\n description: string;\n isSecret: boolean;\n required: boolean;\n order: number;\n}\n\n@Component({\n standalone: false,\n selector: 'mj-credential-type-edit-panel',\n templateUrl: './credential-type-edit-panel.component.html',\n styleUrls: ['./credential-type-edit-panel.component.css'],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class CredentialTypeEditPanelComponent extends BaseAngularComponent implements OnInit {\n @Input() credentialType: MJCredentialTypeEntity | null = null;\n @Input() isOpen = false;\n\n @Output() close = new EventEmitter<void>();\n @Output() saved = new EventEmitter<MJCredentialTypeEntity>();\n @Output() deleted = new EventEmitter<string>();\n\n public isLoading = false;\n public isSaving = false;\n public isNew = false;\n\n // Form fields\n public name = '';\n public description = '';\n public category: CategoryType = 'Integration';\n public iconClass = '';\n public validationEndpoint = '';\n public schemaFields: SchemaField[] = [];\n\n // Available categories\n public categories: CategoryType[] = ['AI', 'Authentication', 'Communication', 'Database', 'Integration', 'Storage'];\n\n private get _metadata() { return this.ProviderToUse; }\n\n constructor(private cdr: ChangeDetectorRef, private confirmService: MJConfirmService) { super(); }\n\n ngOnInit(): void {}\n\n public get panelTitle(): string {\n return this.isNew ? 'Create Credential Type' : 'Edit Credential Type';\n }\n\n public get canSave(): boolean {\n return this.name.trim().length > 0 && this.category.length > 0;\n }\n\n public async open(credentialType: MJCredentialTypeEntity | null): Promise<void> {\n this.isLoading = true;\n this.isOpen = true;\n this.credentialType = credentialType;\n this.isNew = !credentialType || !credentialType.ID;\n this.cdr.markForCheck();\n\n this.resetForm();\n\n if (credentialType && credentialType.ID) {\n this.populateFromType(credentialType);\n }\n\n this.isLoading = false;\n this.cdr.markForCheck();\n }\n\n private resetForm(): void {\n this.name = '';\n this.description = '';\n this.category = 'Integration';\n this.iconClass = '';\n this.validationEndpoint = '';\n this.schemaFields = [];\n }\n\n private populateFromType(credentialType: MJCredentialTypeEntity): void {\n this.name = credentialType.Name || '';\n this.description = credentialType.Description || '';\n this.category = credentialType.Category || 'Integration';\n this.iconClass = credentialType.IconClass || '';\n this.validationEndpoint = credentialType.ValidationEndpoint || '';\n\n // Parse field schema\n this.parseFieldSchema(credentialType.FieldSchema);\n }\n\n private parseFieldSchema(schemaJson: string): void {\n try {\n if (!schemaJson) {\n this.schemaFields = [];\n return;\n }\n const schema = JSON.parse(schemaJson) as {\n properties?: Record<string, Record<string, unknown>>;\n required?: string[]\n };\n const properties = schema.properties || {};\n const required = schema.required || [];\n\n this.schemaFields = Object.entries(properties).map(([name, prop]) => ({\n name,\n type: (prop.type as string) || 'string',\n title: (prop.title as string) || name,\n description: (prop.description as string) || '',\n isSecret: prop.isSecret === true,\n required: required.includes(name),\n order: typeof prop.order === 'number' ? prop.order : 999\n }));\n\n this.schemaFields.sort((a, b) => a.order - b.order);\n } catch (e) {\n console.error('Error parsing field schema:', e);\n this.schemaFields = [];\n }\n }\n\n private buildFieldSchema(): string {\n if (this.schemaFields.length === 0) {\n return JSON.stringify({ type: 'object', properties: {}, required: [] });\n }\n\n const properties: Record<string, Record<string, unknown>> = {};\n const required: string[] = [];\n\n for (let i = 0; i < this.schemaFields.length; i++) {\n const field = this.schemaFields[i];\n properties[field.name] = {\n type: field.type,\n title: field.title,\n description: field.description,\n isSecret: field.isSecret,\n order: i\n };\n if (field.required) {\n required.push(field.name);\n }\n }\n\n return JSON.stringify({\n $schema: 'http://json-schema.org/draft-07/schema#',\n type: 'object',\n properties,\n required\n }, null, 2);\n }\n\n // Schema field management\n public addSchemaField(): void {\n this.schemaFields.push({\n name: '',\n type: 'string',\n title: '',\n description: '',\n isSecret: false,\n required: false,\n order: this.schemaFields.length\n });\n this.cdr.markForCheck();\n }\n\n public removeSchemaField(index: number): void {\n this.schemaFields.splice(index, 1);\n this.cdr.markForCheck();\n }\n\n public moveFieldUp(index: number): void {\n if (index > 0) {\n const temp = this.schemaFields[index];\n this.schemaFields[index] = this.schemaFields[index - 1];\n this.schemaFields[index - 1] = temp;\n this.cdr.markForCheck();\n }\n }\n\n public moveFieldDown(index: number): void {\n if (index < this.schemaFields.length - 1) {\n const temp = this.schemaFields[index];\n this.schemaFields[index] = this.schemaFields[index + 1];\n this.schemaFields[index + 1] = temp;\n this.cdr.markForCheck();\n }\n }\n\n public async save(): Promise<void> {\n if (!this.canSave) {\n MJNotificationService.Instance.CreateSimpleNotification('Please fill in all required fields', 'warning', 3000);\n return;\n }\n\n this.isSaving = true;\n this.cdr.markForCheck();\n\n try {\n let entity: MJCredentialTypeEntity;\n\n if (this.isNew) {\n entity = await this._metadata.GetEntityObject<MJCredentialTypeEntity>('MJ: Credential Types');\n } else {\n entity = this.credentialType!;\n }\n\n entity.Name = this.name.trim();\n entity.Description = this.description.trim() || null;\n entity.Category = this.category;\n entity.IconClass = this.iconClass.trim() || null;\n entity.ValidationEndpoint = this.validationEndpoint.trim() || null;\n entity.FieldSchema = this.buildFieldSchema();\n\n const success = await entity.Save();\n\n if (success) {\n const action = this.isNew ? 'created' : 'updated';\n MJNotificationService.Instance.CreateSimpleNotification(\n `Credential type \"${entity.Name}\" ${action} successfully`,\n 'success',\n 3000\n );\n this.saved.emit(entity);\n this.closePanel();\n } else {\n const errorMessage = entity.LatestResult?.Message || 'Unknown error';\n console.error('Save failed:', errorMessage);\n MJNotificationService.Instance.CreateSimpleNotification(\n `Failed to save credential type: ${errorMessage}`,\n 'error',\n 5000\n );\n }\n } catch (error) {\n console.error('Error saving credential type:', error);\n MJNotificationService.Instance.CreateSimpleNotification(\n 'Error saving credential type',\n 'error',\n 3000\n );\n } finally {\n this.isSaving = false;\n this.cdr.markForCheck();\n }\n }\n\n public async deleteType(): Promise<void> {\n if (this.isNew || !this.credentialType) return;\n\n const confirmed = await this.confirmService.ConfirmDelete({ title: 'Delete Type', message: `Delete \"${this.credentialType.Name}\"?`, detail: 'This action cannot be undone.' });\n if (!confirmed) return;\n\n this.isSaving = true;\n this.cdr.markForCheck();\n\n try {\n const success = await this.credentialType.Delete();\n if (success) {\n MJNotificationService.Instance.CreateSimpleNotification(\n `Credential type \"${this.credentialType.Name}\" deleted successfully`,\n 'success',\n 3000\n );\n this.deleted.emit(this.credentialType.ID);\n this.closePanel();\n } else {\n const errorMessage = this.credentialType.LatestResult?.Message || 'Unknown error';\n MJNotificationService.Instance.CreateSimpleNotification(\n `Failed to delete credential type: ${errorMessage}`,\n 'error',\n 5000\n );\n }\n } catch (error) {\n console.error('Error deleting credential type:', error);\n MJNotificationService.Instance.CreateSimpleNotification(\n 'Error deleting credential type',\n 'error',\n 3000\n );\n } finally {\n this.isSaving = false;\n this.cdr.markForCheck();\n }\n }\n\n public closePanel(): void {\n this.isOpen = false;\n this.credentialType = null;\n this.resetForm();\n this.close.emit();\n this.cdr.markForCheck();\n }\n\n public onBackdropClick(event: MouseEvent): void {\n if ((event.target as HTMLElement).classList.contains('panel-backdrop')) {\n this.closePanel();\n }\n }\n\n public getCategoryIcon(category: string): string {\n const iconMap: Record<string, string> = {\n 'AI': 'fa-solid fa-brain',\n 'Communication': 'fa-solid fa-envelope',\n 'Storage': 'fa-solid fa-cloud',\n 'Database': 'fa-solid fa-database',\n 'Authentication': 'fa-solid fa-shield-halved',\n 'Integration': 'fa-solid fa-plug'\n };\n return iconMap[category] || 'fa-solid fa-key';\n }\n\n public getCategoryColor(category: string): string {\n const colorMap: Record<string, string> = {\n 'AI': 'var(--mj-brand-primary)',\n 'Communication': 'var(--mj-brand-primary)',\n 'Storage': 'var(--mj-brand-primary)',\n 'Database': 'var(--mj-status-warning)',\n 'Authentication': 'var(--mj-status-success)',\n 'Integration': 'var(--mj-brand-primary)'\n };\n return colorMap[category] || 'var(--mj-brand-primary)';\n }\n}\n","@if (isOpen) {\n <div class=\"panel-backdrop\" (click)=\"onBackdropClick($event)\">\n <div class=\"edit-panel\" [class.open]=\"isOpen\">\n <!-- Panel Header -->\n <div class=\"panel-header\">\n <div class=\"header-content\">\n <div class=\"header-icon\" [style.backgroundColor]=\"getCategoryColor(category) + '15'\" [style.color]=\"getCategoryColor(category)\">\n <i [class]=\"iconClass || getCategoryIcon(category)\"></i>\n </div>\n <div class=\"header-text\">\n <h2>{{panelTitle}}</h2>\n <span class=\"header-subtitle\">{{category}} credential type</span>\n </div>\n </div>\n <button class=\"close-btn\" (click)=\"closePanel()\" [disabled]=\"isSaving\">\n <i class=\"fa-solid fa-times\"></i>\n </button>\n </div>\n <!-- Panel Body -->\n <div class=\"panel-body\">\n @if (isLoading) {\n <mj-loading text=\"Loading...\"></mj-loading>\n }\n @if (!isLoading) {\n <form class=\"type-form\" (submit)=\"$event.preventDefault(); save()\">\n <!-- Basic Info Section -->\n <div class=\"form-section\">\n <h3 class=\"section-title\">\n <i class=\"fa-solid fa-info-circle\"></i>\n Basic Information\n </h3>\n <div class=\"form-group\">\n <label for=\"typeName\" class=\"required\">Name</label>\n <input\n type=\"text\"\n id=\"typeName\"\n name=\"typeName\"\n [(ngModel)]=\"name\"\n placeholder=\"e.g., OpenAI, SendGrid, AWS S3\"\n [disabled]=\"isSaving\"\n required\n />\n </div>\n <div class=\"form-group\">\n <label for=\"typeCategory\" class=\"required\">Category</label>\n <div class=\"category-selector\">\n @for (cat of categories; track cat) {\n <button\n type=\"button\"\n class=\"category-btn\"\n [class.selected]=\"category === cat\"\n [style.--cat-color]=\"getCategoryColor(cat)\"\n (click)=\"category = cat\"\n [disabled]=\"isSaving\"\n >\n <i [class]=\"getCategoryIcon(cat)\"></i>\n <span>{{cat}}</span>\n </button>\n }\n </div>\n </div>\n <div class=\"form-group\">\n <label for=\"typeDescription\">Description</label>\n <textarea\n id=\"typeDescription\"\n name=\"typeDescription\"\n [(ngModel)]=\"description\"\n placeholder=\"Optional description of this credential type...\"\n rows=\"3\"\n [disabled]=\"isSaving\"\n ></textarea>\n </div>\n <div class=\"form-row\">\n <div class=\"form-group\">\n <label for=\"typeIcon\">Icon Class</label>\n <input\n type=\"text\"\n id=\"typeIcon\"\n name=\"typeIcon\"\n [(ngModel)]=\"iconClass\"\n placeholder=\"e.g., fa-brands fa-openai\"\n [disabled]=\"isSaving\"\n />\n <span class=\"field-hint\">Font Awesome icon class</span>\n </div>\n <div class=\"form-group\">\n <label for=\"validationEndpoint\">Validation Endpoint</label>\n <input\n type=\"text\"\n id=\"validationEndpoint\"\n name=\"validationEndpoint\"\n [(ngModel)]=\"validationEndpoint\"\n placeholder=\"https://api.example.com/validate\"\n [disabled]=\"isSaving\"\n />\n <span class=\"field-hint\">Optional API endpoint to validate credentials</span>\n </div>\n </div>\n </div>\n <!-- Field Schema Section -->\n <div class=\"form-section\">\n <div class=\"section-header-row\">\n <h3 class=\"section-title\">\n <i class=\"fa-solid fa-list-check\"></i>\n Field Schema\n </h3>\n <button\n type=\"button\"\n class=\"btn-add-field\"\n (click)=\"addSchemaField()\"\n [disabled]=\"isSaving\"\n >\n <i class=\"fa-solid fa-plus\"></i>\n Add Field\n </button>\n </div>\n @if (schemaFields.length > 0) {\n <div class=\"schema-fields\">\n @for (field of schemaFields; track field; let i = $index) {\n <div class=\"schema-field\">\n <div class=\"field-drag-handle\">\n <button type=\"button\" class=\"move-btn\" (click)=\"moveFieldUp(i)\" [disabled]=\"i === 0 || isSaving\">\n <i class=\"fa-solid fa-chevron-up\"></i>\n </button>\n <button type=\"button\" class=\"move-btn\" (click)=\"moveFieldDown(i)\" [disabled]=\"i === schemaFields.length - 1 || isSaving\">\n <i class=\"fa-solid fa-chevron-down\"></i>\n </button>\n </div>\n <div class=\"field-content\">\n <div class=\"field-row\">\n <input\n type=\"text\"\n [name]=\"'fieldName_' + i\"\n [(ngModel)]=\"field.name\"\n placeholder=\"Field name (e.g., apiKey)\"\n class=\"field-name-input\"\n [disabled]=\"isSaving\"\n />\n <input\n type=\"text\"\n [name]=\"'fieldTitle_' + i\"\n [(ngModel)]=\"field.title\"\n placeholder=\"Display title\"\n class=\"field-title-input\"\n [disabled]=\"isSaving\"\n />\n <select [name]=\"'fieldType_' + i\" [(ngModel)]=\"field.type\" class=\"field-type-select\" [disabled]=\"isSaving\">\n <option value=\"string\">String</option>\n <option value=\"number\">Number</option>\n <option value=\"boolean\">Boolean</option>\n </select>\n </div>\n <div class=\"field-row\">\n <input\n type=\"text\"\n [name]=\"'fieldDesc_' + i\"\n [(ngModel)]=\"field.description\"\n placeholder=\"Field description (optional)\"\n class=\"field-desc-input\"\n [disabled]=\"isSaving\"\n />\n </div>\n <div class=\"field-options\">\n <label class=\"checkbox-label\">\n <input type=\"checkbox\" [name]=\"'fieldRequired_' + i\" [(ngModel)]=\"field.required\" [disabled]=\"isSaving\" />\n <span>Required</span>\n </label>\n <label class=\"checkbox-label\">\n <input type=\"checkbox\" [name]=\"'fieldSecret_' + i\" [(ngModel)]=\"field.isSecret\" [disabled]=\"isSaving\" />\n <span><i class=\"fa-solid fa-lock\"></i> Secret</span>\n </label>\n </div>\n </div>\n <button\n type=\"button\"\n class=\"remove-field-btn\"\n (click)=\"removeSchemaField(i)\"\n [disabled]=\"isSaving\"\n title=\"Remove field\"\n >\n <i class=\"fa-solid fa-trash\"></i>\n </button>\n </div>\n }\n </div>\n }\n @if (schemaFields.length === 0) {\n <div class=\"no-fields-message\">\n <i class=\"fa-solid fa-info-circle\"></i>\n <span>No fields defined. Add fields that credentials of this type will need to store.</span>\n </div>\n }\n </div>\n </form>\n }\n </div>\n <!-- Panel Footer -->\n <div class=\"panel-footer\">\n <div class=\"footer-left\">\n @if (!isNew) {\n <button\n class=\"btn-delete\"\n (click)=\"deleteType()\"\n [disabled]=\"isSaving\"\n >\n <i class=\"fa-solid fa-trash\"></i>\n <span>Delete</span>\n </button>\n }\n </div>\n <div class=\"footer-right\">\n <button\n class=\"btn-secondary\"\n (click)=\"closePanel()\"\n [disabled]=\"isSaving\"\n >\n Cancel\n </button>\n <button\n class=\"btn-primary\"\n (click)=\"save()\"\n [disabled]=\"isSaving || !canSave\"\n >\n @if (isSaving) {\n <i class=\"fa-solid fa-spinner fa-spin\"></i>\n }\n @if (!isSaving) {\n <i class=\"fa-solid fa-check\"></i>\n }\n <span>{{isNew ? 'Create' : 'Save'}}</span>\n </button>\n </div>\n </div>\n </div>\n </div>\n}\n"]}
1
+ {"version":3,"file":"credential-type-edit-panel.component.js","sourceRoot":"","sources":["../../../../src/lib/panels/credential-type-edit-panel/credential-type-edit-panel.component.ts","../../../../src/lib/panels/credential-type-edit-panel/credential-type-edit-panel.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,YAAY,EAAqB,uBAAuB,EAAU,MAAM,eAAe,CAAC;AAE3H,OAAO,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AAEzE,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;;;;;AAqBrE,MAAM,OAAO,gCAAiC,SAAQ,oBAAoB;IAmHlD;IAAgC;IAlH3C,cAAc,GAAkC,IAAI,CAAC;IAE9D,8CAA8C;IAC9C,IAAa,cAAc,CAAC,KAAoC;QAC9D,IAAI,CAAC,cAAc,GAAG,KAAK,CAAC;IAC9B,CAAC;IACD,8CAA8C;IAC9C,IAAI,cAAc;QAChB,OAAO,IAAI,CAAC,cAAc,CAAC;IAC7B,CAAC;IACQ,MAAM,GAAG,KAAK,CAAC;IAExB,sCAAsC;IACtC,IAAa,MAAM,CAAC,KAAiD;QACnE,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;IACtB,CAAC;IACD,sCAAsC;IACtC,IAAI,MAAM;QACR,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IAES,KAAK,GAAG,IAAI,YAAY,EAAQ,CAAC;IACjC,KAAK,GAAG,IAAI,YAAY,EAA0B,CAAC;IAE7D;;;;;;OAMG;IACO,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;IACnB,OAAO,GAAG,IAAI,YAAY,EAAU,CAAC;IAE/C;;;;;;OAMG;IACO,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;IAE1B,SAAS,GAAG,KAAK,CAAC;IAClB,QAAQ,GAAG,KAAK,CAAC;IAExB,wCAAwC;I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kBAP5C,SAAS;iCACI,KAAK,YACL,+BAA+B,mBAGxB,uBAAuB,CAAC,MAAM;;sBAG9C,KAAK;;sBAGL,KAAK;;sBAOL,KAAK;;sBAGL,KAAK;;sBAQL,MAAM;;sBACN,MAAM;;sBASN,MAAM;;sBACN,MAAM;;sBASN,MAAM","sourcesContent":["import { Component, Input, Output, EventEmitter, ChangeDetectorRef, ChangeDetectionStrategy, OnInit } from '@angular/core';\nimport { MJCredentialTypeEntity } from '@memberjunction/core-entities';\nimport { MJNotificationService } from '@memberjunction/ng-notifications';\nimport { MJConfirmService } from '@memberjunction/ng-ui-components';\nimport { BaseAngularComponent } from '@memberjunction/ng-base-types';\n\ntype CategoryType = 'AI' | 'Authentication' | 'Communication' | 'Database' | 'Integration' | 'Storage';\n\ninterface SchemaField {\n name: string;\n type: string;\n title: string;\n description: string;\n isSecret: boolean;\n required: boolean;\n order: number;\n}\n\n@Component({\n standalone: false,\n selector: 'mj-credential-type-edit-panel',\n templateUrl: './credential-type-edit-panel.component.html',\n styleUrls: ['./credential-type-edit-panel.component.css'],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class CredentialTypeEditPanelComponent extends BaseAngularComponent implements OnInit {\n @Input() CredentialType: MJCredentialTypeEntity | null = null;\n\n /** @deprecated Use {@link CredentialType}. */\n @Input() set credentialType(value: MJCredentialTypeEntity | null) {\n this.CredentialType = value;\n }\n /** @deprecated Use {@link CredentialType}. */\n get credentialType(): MJCredentialTypeEntity | null {\n return this.CredentialType;\n }\n @Input() IsOpen = false;\n\n /** @deprecated Use {@link IsOpen}. */\n @Input() set isOpen(value: CredentialTypeEditPanelComponent['IsOpen']) {\n this.IsOpen = value;\n }\n /** @deprecated Use {@link IsOpen}. */\n get isOpen(): CredentialTypeEditPanelComponent['IsOpen'] {\n return this.IsOpen;\n }\n\n @Output() close = new EventEmitter<void>();\n @Output() Saved = new EventEmitter<MJCredentialTypeEntity>();\n\n /**\n * @deprecated Use {@link Saved}.\n *\n * The same emitter under the old binding name, so a template still binding\n * (saved) keeps working. Must stay AFTER Saved: class fields\n * initialise in order, and the other way round this captures undefined.\n */\n @Output() saved = this.Saved;\n @Output() Deleted = new EventEmitter<string>();\n\n /**\n * @deprecated Use {@link Deleted}.\n *\n * The same emitter under the old binding name, so a template still binding\n * (deleted) keeps working. Must stay AFTER Deleted: class fields\n * initialise in order, and the other way round this captures undefined.\n */\n @Output() deleted = this.Deleted;\n\n public isLoading = false;\n public IsSaving = false;\n\n /** @deprecated Use {@link IsSaving}. */\n public get isSaving() {\n return this.IsSaving;\n }\n /** @deprecated Use {@link IsSaving}. */\n public set isSaving(value) {\n this.IsSaving = value;\n }\n public IsNew = false;\n\n /** @deprecated Use {@link IsNew}. */\n public get isNew() {\n return this.IsNew;\n }\n /** @deprecated Use {@link IsNew}. */\n public set isNew(value) {\n this.IsNew = value;\n }\n\n // Form fields\n public name = '';\n public description = '';\n public category: CategoryType = 'Integration';\n public IconClass = '';\n\n /** @deprecated Use {@link IconClass}. */\n public get iconClass() {\n return this.IconClass;\n }\n /** @deprecated Use {@link IconClass}. */\n public set iconClass(value) {\n this.IconClass = value;\n }\n public ValidationEndpoint = '';\n\n /** @deprecated Use {@link ValidationEndpoint}. */\n public get validationEndpoint() {\n return this.ValidationEndpoint;\n }\n /** @deprecated Use {@link ValidationEndpoint}. */\n public set validationEndpoint(value) {\n this.ValidationEndpoint = value;\n }\n public SchemaFields: SchemaField[] = [];\n\n /** @deprecated Use {@link SchemaFields}. */\n public get schemaFields(): SchemaField[] {\n return this.SchemaFields;\n }\n /** @deprecated Use {@link SchemaFields}. */\n public set schemaFields(value: SchemaField[]) {\n this.SchemaFields = value;\n }\n\n // Available categories\n public Categories: CategoryType[] = ['AI', 'Authentication', 'Communication', 'Database', 'Integration', 'Storage'];\n\n /** @deprecated Use {@link Categories}. */\n public get categories(): CategoryType[] {\n return this.Categories;\n }\n /** @deprecated Use {@link Categories}. */\n public set categories(value: CategoryType[]) {\n this.Categories = value;\n }\n\n private get _metadata() { return this.ProviderToUse; }\n\n constructor(private cdr: ChangeDetectorRef, private confirmService: MJConfirmService) { super(); }\n\n ngOnInit(): void {}\n\n public get PanelTitle(): string {\n return this.IsNew ? 'Create Credential Type' : 'Edit Credential Type';\n }\n\n /** @deprecated Use {@link PanelTitle}. */\n public get panelTitle(): string {\n return this.PanelTitle;\n }\n\n public get CanSave(): boolean {\n return this.name.trim().length > 0 && this.category.length > 0;\n }\n\n /** @deprecated Use {@link CanSave}. */\n public get canSave(): boolean {\n return this.CanSave;\n }\n\n public async Open(credentialType: MJCredentialTypeEntity | null): Promise<void> {\n this.isLoading = true;\n this.IsOpen = true;\n this.CredentialType = credentialType;\n this.IsNew = !credentialType || !credentialType.ID;\n this.cdr.markForCheck();\n\n this.resetForm();\n\n if (credentialType && credentialType.ID) {\n this.populateFromType(credentialType);\n }\n\n this.isLoading = false;\n this.cdr.markForCheck();\n }\n\n /** @deprecated Use {@link Open}. */\n public async open(credentialType: MJCredentialTypeEntity | null): Promise<void> {\n return this.Open(credentialType);\n }\n\n private resetForm(): void {\n this.name = '';\n this.description = '';\n this.category = 'Integration';\n this.IconClass = '';\n this.ValidationEndpoint = '';\n this.SchemaFields = [];\n }\n\n private populateFromType(credentialType: MJCredentialTypeEntity): void {\n this.name = credentialType.Name || '';\n this.description = credentialType.Description || '';\n this.category = credentialType.Category || 'Integration';\n this.IconClass = credentialType.IconClass || '';\n this.ValidationEndpoint = credentialType.ValidationEndpoint || '';\n\n // Parse field schema\n this.parseFieldSchema(credentialType.FieldSchema);\n }\n\n private parseFieldSchema(schemaJson: string): void {\n try {\n if (!schemaJson) {\n this.SchemaFields = [];\n return;\n }\n const schema = JSON.parse(schemaJson) as {\n properties?: Record<string, Record<string, unknown>>;\n required?: string[]\n };\n const properties = schema.properties || {};\n const required = schema.required || [];\n\n this.SchemaFields = Object.entries(properties).map(([name, prop]) => ({\n name,\n type: (prop.type as string) || 'string',\n title: (prop.title as string) || name,\n description: (prop.description as string) || '',\n isSecret: prop.isSecret === true,\n required: required.includes(name),\n order: typeof prop.order === 'number' ? prop.order : 999\n }));\n\n this.SchemaFields.sort((a, b) => a.order - b.order);\n } catch (e) {\n console.error('Error parsing field schema:', e);\n this.SchemaFields = [];\n }\n }\n\n private buildFieldSchema(): string {\n if (this.SchemaFields.length === 0) {\n return JSON.stringify({ type: 'object', properties: {}, required: [] });\n }\n\n const properties: Record<string, Record<string, unknown>> = {};\n const required: string[] = [];\n\n for (let i = 0; i < this.SchemaFields.length; i++) {\n const field = this.SchemaFields[i];\n properties[field.name] = {\n type: field.type,\n title: field.title,\n description: field.description,\n isSecret: field.isSecret,\n order: i\n };\n if (field.required) {\n required.push(field.name);\n }\n }\n\n return JSON.stringify({\n $schema: 'http://json-schema.org/draft-07/schema#',\n type: 'object',\n properties,\n required\n }, null, 2);\n }\n\n // Schema field management\n public AddSchemaField(): void {\n this.SchemaFields.push({\n name: '',\n type: 'string',\n title: '',\n description: '',\n isSecret: false,\n required: false,\n order: this.SchemaFields.length\n });\n this.cdr.markForCheck();\n }\n\n /** @deprecated Use {@link AddSchemaField}. */\n public addSchemaField(): void {\n return this.AddSchemaField();\n }\n\n public RemoveSchemaField(index: number): void {\n this.SchemaFields.splice(index, 1);\n this.cdr.markForCheck();\n }\n\n /** @deprecated Use {@link RemoveSchemaField}. */\n public removeSchemaField(index: number): void {\n return this.RemoveSchemaField(index);\n }\n\n public MoveFieldUp(index: number): void {\n if (index > 0) {\n const temp = this.SchemaFields[index];\n this.SchemaFields[index] = this.SchemaFields[index - 1];\n this.SchemaFields[index - 1] = temp;\n this.cdr.markForCheck();\n }\n }\n\n /** @deprecated Use {@link MoveFieldUp}. */\n public moveFieldUp(index: number): void {\n return this.MoveFieldUp(index);\n }\n\n public MoveFieldDown(index: number): void {\n if (index < this.SchemaFields.length - 1) {\n const temp = this.SchemaFields[index];\n this.SchemaFields[index] = this.SchemaFields[index + 1];\n this.SchemaFields[index + 1] = temp;\n this.cdr.markForCheck();\n }\n }\n\n /** @deprecated Use {@link MoveFieldDown}. */\n public moveFieldDown(index: number): void {\n return this.MoveFieldDown(index);\n }\n\n public async save(): Promise<void> {\n if (!this.CanSave) {\n MJNotificationService.Instance.CreateSimpleNotification('Please fill in all required fields', 'warning', 3000);\n return;\n }\n\n this.IsSaving = true;\n this.cdr.markForCheck();\n\n try {\n let entity: MJCredentialTypeEntity;\n\n if (this.IsNew) {\n entity = await this._metadata.GetEntityObject<MJCredentialTypeEntity>('MJ: Credential Types');\n } else {\n entity = this.CredentialType!;\n }\n\n entity.Name = this.name.trim();\n entity.Description = this.description.trim() || null;\n entity.Category = this.category;\n entity.IconClass = this.IconClass.trim() || null;\n entity.ValidationEndpoint = this.ValidationEndpoint.trim() || null;\n entity.FieldSchema = this.buildFieldSchema();\n\n const success = await entity.Save();\n\n if (success) {\n const action = this.IsNew ? 'created' : 'updated';\n MJNotificationService.Instance.CreateSimpleNotification(\n `Credential type \"${entity.Name}\" ${action} successfully`,\n 'success',\n 3000\n );\n this.Saved.emit(entity);\n this.ClosePanel();\n } else {\n const errorMessage = entity.LatestResult?.Message || 'Unknown error';\n console.error('Save failed:', errorMessage);\n MJNotificationService.Instance.CreateSimpleNotification(\n `Failed to save credential type: ${errorMessage}`,\n 'error',\n 5000\n );\n }\n } catch (error) {\n console.error('Error saving credential type:', error);\n MJNotificationService.Instance.CreateSimpleNotification(\n 'Error saving credential type',\n 'error',\n 3000\n );\n } finally {\n this.IsSaving = false;\n this.cdr.markForCheck();\n }\n }\n\n public async DeleteType(): Promise<void> {\n if (this.IsNew || !this.CredentialType) return;\n\n const confirmed = await this.confirmService.ConfirmDelete({ title: 'Delete Type', message: `Delete \"${this.CredentialType.Name}\"?`, detail: 'This action cannot be undone.' });\n if (!confirmed) return;\n\n this.IsSaving = true;\n this.cdr.markForCheck();\n\n try {\n const success = await this.CredentialType.Delete();\n if (success) {\n MJNotificationService.Instance.CreateSimpleNotification(\n `Credential type \"${this.CredentialType.Name}\" deleted successfully`,\n 'success',\n 3000\n );\n this.Deleted.emit(this.CredentialType.ID);\n this.ClosePanel();\n } else {\n const errorMessage = this.CredentialType.LatestResult?.Message || 'Unknown error';\n MJNotificationService.Instance.CreateSimpleNotification(\n `Failed to delete credential type: ${errorMessage}`,\n 'error',\n 5000\n );\n }\n } catch (error) {\n console.error('Error deleting credential type:', error);\n MJNotificationService.Instance.CreateSimpleNotification(\n 'Error deleting credential type',\n 'error',\n 3000\n );\n } finally {\n this.IsSaving = false;\n this.cdr.markForCheck();\n }\n }\n\n /** @deprecated Use {@link DeleteType}. */\n public async deleteType(): Promise<void> {\n return this.DeleteType();\n }\n\n public ClosePanel(): void {\n this.IsOpen = false;\n this.CredentialType = null;\n this.resetForm();\n this.close.emit();\n this.cdr.markForCheck();\n }\n\n /** @deprecated Use {@link ClosePanel}. */\n public closePanel(): void {\n return this.ClosePanel();\n }\n\n public OnBackdropClick(event: MouseEvent): void {\n if ((event.target as HTMLElement).classList.contains('panel-backdrop')) {\n this.ClosePanel();\n }\n }\n\n /** @deprecated Use {@link OnBackdropClick}. */\n public onBackdropClick(event: MouseEvent): void {\n return this.OnBackdropClick(event);\n }\n\n public GetCategoryIcon(category: string): string {\n const iconMap: Record<string, string> = {\n 'AI': 'fa-solid fa-brain',\n 'Communication': 'fa-solid fa-envelope',\n 'Storage': 'fa-solid fa-cloud',\n 'Database': 'fa-solid fa-database',\n 'Authentication': 'fa-solid fa-shield-halved',\n 'Integration': 'fa-solid fa-plug'\n };\n return iconMap[category] || 'fa-solid fa-key';\n }\n\n /** @deprecated Use {@link GetCategoryIcon}. */\n public getCategoryIcon(category: string): string {\n return this.GetCategoryIcon(category);\n }\n\n public GetCategoryColor(category: string): string {\n const colorMap: Record<string, string> = {\n 'AI': 'var(--mj-brand-primary)',\n 'Communication': 'var(--mj-brand-primary)',\n 'Storage': 'var(--mj-brand-primary)',\n 'Database': 'var(--mj-status-warning)',\n 'Authentication': 'var(--mj-status-success)',\n 'Integration': 'var(--mj-brand-primary)'\n };\n return colorMap[category] || 'var(--mj-brand-primary)';\n }\n\n /** @deprecated Use {@link GetCategoryColor}. */\n public getCategoryColor(category: string): string {\n return this.GetCategoryColor(category);\n }\n}\n","@if (isOpen) {\n <div class=\"panel-backdrop\" (click)=\"onBackdropClick($event)\">\n <div class=\"edit-panel\" [class.open]=\"isOpen\">\n <!-- Panel Header -->\n <div class=\"panel-header\">\n <div class=\"header-content\">\n <div class=\"header-icon\" [style.backgroundColor]=\"getCategoryColor(category) + '15'\" [style.color]=\"getCategoryColor(category)\">\n <i [class]=\"iconClass || getCategoryIcon(category)\"></i>\n </div>\n <div class=\"header-text\">\n <h2>{{panelTitle}}</h2>\n <span class=\"header-subtitle\">{{category}} credential type</span>\n </div>\n </div>\n <button class=\"close-btn\" (click)=\"closePanel()\" [disabled]=\"isSaving\">\n <i class=\"fa-solid fa-times\"></i>\n </button>\n </div>\n <!-- Panel Body -->\n <div class=\"panel-body\">\n @if (isLoading) {\n <mj-loading text=\"Loading...\"></mj-loading>\n }\n @if (!isLoading) {\n <form class=\"type-form\" (submit)=\"$event.preventDefault(); save()\">\n <!-- Basic Info Section -->\n <div class=\"form-section\">\n <h3 class=\"section-title\">\n <i class=\"fa-solid fa-info-circle\"></i>\n Basic Information\n </h3>\n <div class=\"form-group\">\n <label for=\"typeName\" class=\"required\">Name</label>\n <input\n type=\"text\"\n id=\"typeName\"\n name=\"typeName\"\n [(ngModel)]=\"name\"\n placeholder=\"e.g., OpenAI, SendGrid, AWS S3\"\n [disabled]=\"isSaving\"\n required\n />\n </div>\n <div class=\"form-group\">\n <label for=\"typeCategory\" class=\"required\">Category</label>\n <div class=\"category-selector\">\n @for (cat of categories; track cat) {\n <button\n type=\"button\"\n class=\"category-btn\"\n [class.selected]=\"category === cat\"\n [style.--cat-color]=\"getCategoryColor(cat)\"\n (click)=\"category = cat\"\n [disabled]=\"isSaving\"\n >\n <i [class]=\"getCategoryIcon(cat)\"></i>\n <span>{{cat}}</span>\n </button>\n }\n </div>\n </div>\n <div class=\"form-group\">\n <label for=\"typeDescription\">Description</label>\n <textarea\n id=\"typeDescription\"\n name=\"typeDescription\"\n [(ngModel)]=\"description\"\n placeholder=\"Optional description of this credential type...\"\n rows=\"3\"\n [disabled]=\"isSaving\"\n ></textarea>\n </div>\n <div class=\"form-row\">\n <div class=\"form-group\">\n <label for=\"typeIcon\">Icon Class</label>\n <input\n type=\"text\"\n id=\"typeIcon\"\n name=\"typeIcon\"\n [(ngModel)]=\"iconClass\"\n placeholder=\"e.g., fa-brands fa-openai\"\n [disabled]=\"isSaving\"\n />\n <span class=\"field-hint\">Font Awesome icon class</span>\n </div>\n <div class=\"form-group\">\n <label for=\"validationEndpoint\">Validation Endpoint</label>\n <input\n type=\"text\"\n id=\"validationEndpoint\"\n name=\"validationEndpoint\"\n [(ngModel)]=\"validationEndpoint\"\n placeholder=\"https://api.example.com/validate\"\n [disabled]=\"isSaving\"\n />\n <span class=\"field-hint\">Optional API endpoint to validate credentials</span>\n </div>\n </div>\n </div>\n <!-- Field Schema Section -->\n <div class=\"form-section\">\n <div class=\"section-header-row\">\n <h3 class=\"section-title\">\n <i class=\"fa-solid fa-list-check\"></i>\n Field Schema\n </h3>\n <button\n type=\"button\"\n class=\"btn-add-field\"\n (click)=\"addSchemaField()\"\n [disabled]=\"isSaving\"\n >\n <i class=\"fa-solid fa-plus\"></i>\n Add Field\n </button>\n </div>\n @if (schemaFields.length > 0) {\n <div class=\"schema-fields\">\n @for (field of schemaFields; track field; let i = $index) {\n <div class=\"schema-field\">\n <div class=\"field-drag-handle\">\n <button type=\"button\" class=\"move-btn\" (click)=\"moveFieldUp(i)\" [disabled]=\"i === 0 || isSaving\">\n <i class=\"fa-solid fa-chevron-up\"></i>\n </button>\n <button type=\"button\" class=\"move-btn\" (click)=\"moveFieldDown(i)\" [disabled]=\"i === schemaFields.length - 1 || isSaving\">\n <i class=\"fa-solid fa-chevron-down\"></i>\n </button>\n </div>\n <div class=\"field-content\">\n <div class=\"field-row\">\n <input\n type=\"text\"\n [name]=\"'fieldName_' + i\"\n [(ngModel)]=\"field.name\"\n placeholder=\"Field name (e.g., apiKey)\"\n class=\"field-name-input\"\n [disabled]=\"isSaving\"\n />\n <input\n type=\"text\"\n [name]=\"'fieldTitle_' + i\"\n [(ngModel)]=\"field.title\"\n placeholder=\"Display title\"\n class=\"field-title-input\"\n [disabled]=\"isSaving\"\n />\n <select [name]=\"'fieldType_' + i\" [(ngModel)]=\"field.type\" class=\"field-type-select\" [disabled]=\"isSaving\">\n <option value=\"string\">String</option>\n <option value=\"number\">Number</option>\n <option value=\"boolean\">Boolean</option>\n </select>\n </div>\n <div class=\"field-row\">\n <input\n type=\"text\"\n [name]=\"'fieldDesc_' + i\"\n [(ngModel)]=\"field.description\"\n placeholder=\"Field description (optional)\"\n class=\"field-desc-input\"\n [disabled]=\"isSaving\"\n />\n </div>\n <div class=\"field-options\">\n <label class=\"checkbox-label\">\n <input type=\"checkbox\" [name]=\"'fieldRequired_' + i\" [(ngModel)]=\"field.required\" [disabled]=\"isSaving\" />\n <span>Required</span>\n </label>\n <label class=\"checkbox-label\">\n <input type=\"checkbox\" [name]=\"'fieldSecret_' + i\" [(ngModel)]=\"field.isSecret\" [disabled]=\"isSaving\" />\n <span><i class=\"fa-solid fa-lock\"></i> Secret</span>\n </label>\n </div>\n </div>\n <button\n type=\"button\"\n class=\"remove-field-btn\"\n (click)=\"removeSchemaField(i)\"\n [disabled]=\"isSaving\"\n title=\"Remove field\"\n >\n <i class=\"fa-solid fa-trash\"></i>\n </button>\n </div>\n }\n </div>\n }\n @if (schemaFields.length === 0) {\n <div class=\"no-fields-message\">\n <i class=\"fa-solid fa-info-circle\"></i>\n <span>No fields defined. Add fields that credentials of this type will need to store.</span>\n </div>\n }\n </div>\n </form>\n }\n </div>\n <!-- Panel Footer -->\n <div class=\"panel-footer\">\n <div class=\"footer-left\">\n @if (!isNew) {\n <button\n class=\"btn-delete\"\n (click)=\"deleteType()\"\n [disabled]=\"isSaving\"\n >\n <i class=\"fa-solid fa-trash\"></i>\n <span>Delete</span>\n </button>\n }\n </div>\n <div class=\"footer-right\">\n <button\n class=\"btn-secondary\"\n (click)=\"closePanel()\"\n [disabled]=\"isSaving\"\n >\n Cancel\n </button>\n <button\n class=\"btn-primary\"\n (click)=\"save()\"\n [disabled]=\"isSaving || !canSave\"\n >\n @if (isSaving) {\n <i class=\"fa-solid fa-spinner fa-spin\"></i>\n }\n @if (!isSaving) {\n <i class=\"fa-solid fa-check\"></i>\n }\n <span>{{isNew ? 'Create' : 'Save'}}</span>\n </button>\n </div>\n </div>\n </div>\n </div>\n}\n"]}
@@ -62,6 +62,8 @@ export declare class CredentialDialogService {
62
62
  * @param options - Optional configuration for the dialog
63
63
  * @returns Promise resolving to the dialog result
64
64
  */
65
+ OpenDialog(viewContainerRef: ViewContainerRef, options?: CredentialDialogOptions): Promise<CredentialDialogResult>;
66
+ /** @deprecated Use {@link OpenDialog}. */
65
67
  openDialog(viewContainerRef: ViewContainerRef, options?: CredentialDialogOptions): Promise<CredentialDialogResult>;
66
68
  /**
67
69
  * Opens a dialog to create a new credential with optional pre-selections.
@@ -72,6 +74,8 @@ export declare class CredentialDialogService {
72
74
  * @param preselectedCategoryId - Optional category to pre-select
73
75
  * @returns Promise resolving to the dialog result
74
76
  */
77
+ CreateCredential(viewContainerRef: ViewContainerRef, preselectedTypeId?: string, preselectedCategoryId?: string): Promise<CredentialDialogResult>;
78
+ /** @deprecated Use {@link CreateCredential}. */
75
79
  createCredential(viewContainerRef: ViewContainerRef, preselectedTypeId?: string, preselectedCategoryId?: string): Promise<CredentialDialogResult>;
76
80
  /**
77
81
  * Opens a dialog to edit an existing credential.
@@ -81,16 +85,22 @@ export declare class CredentialDialogService {
81
85
  * @param credential - The credential to edit
82
86
  * @returns Promise resolving to the dialog result
83
87
  */
88
+ EditCredential(viewContainerRef: ViewContainerRef, credential: MJCredentialEntity): Promise<CredentialDialogResult>;
89
+ /** @deprecated Use {@link EditCredential}. */
84
90
  editCredential(viewContainerRef: ViewContainerRef, credential: MJCredentialEntity): Promise<CredentialDialogResult>;
85
91
  /**
86
92
  * Gets cached credential types or loads them if not cached.
87
93
  * Types are cached to avoid repeated database calls.
88
94
  */
95
+ GetCredentialTypes(): Promise<MJCredentialTypeEntity[]>;
96
+ /** @deprecated Use {@link GetCredentialTypes}. */
89
97
  getCredentialTypes(): Promise<MJCredentialTypeEntity[]>;
90
98
  /**
91
99
  * Clears the cached credential types.
92
100
  * Call this if you need to refresh the list after adding new types.
93
101
  */
102
+ ClearCache(): void;
103
+ /** @deprecated Use {@link ClearCache}. */
94
104
  clearCache(): void;
95
105
  private loadCredentialTypes;
96
106
  private doLoadCredentialTypes;
@@ -1 +1 @@
1
- {"version":3,"file":"credential-dialog.service.d.ts","sourceRoot":"","sources":["../../../src/lib/services/credential-dialog.service.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAA4B,gBAAgB,EAAQ,MAAM,eAAe,CAAC;AACjF,OAAO,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AAC3F,OAAO,EAAqB,KAAK,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAEjF,OAAO,EAA6B,uBAAuB,EAAE,sBAAsB,EAAE,MAAM,wCAAwC,CAAC;;AAEpI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,qBAGa,uBAAuB;IAChC;;;;;;OAMG;IACI,QAAQ,EAAE,iBAAiB,GAAG,IAAI,CAAQ;IAEjD,8EAA8E;IAC9E,IAAW,aAAa,IAAI,iBAAiB,CAE5C;IAED,OAAO,CAAC,gBAAgB,CAAyC;IACjE,OAAO,CAAC,uBAAuB,CAAS;IACxC,OAAO,CAAC,2BAA2B,CAAkD;IAErF;;;;;;OAMG;IACU,UAAU,CACnB,gBAAgB,EAAE,gBAAgB,EAClC,OAAO,CAAC,EAAE,uBAAuB,GAClC,OAAO,CAAC,sBAAsB,CAAC;IAwBlC;;;;;;;;OAQG;IACU,gBAAgB,CACzB,gBAAgB,EAAE,gBAAgB,EAClC,iBAAiB,CAAC,EAAE,MAAM,EAC1B,qBAAqB,CAAC,EAAE,MAAM,GAC/B,OAAO,CAAC,sBAAsB,CAAC;IASlC;;;;;;;OAOG;IACU,cAAc,CACvB,gBAAgB,EAAE,gBAAgB,EAClC,UAAU,EAAE,kBAAkB,GAC/B,OAAO,CAAC,sBAAsB,CAAC;IAOlC;;;OAGG;IACU,kBAAkB,IAAI,OAAO,CAAC,sBAAsB,EAAE,CAAC;IAIpE;;;OAGG;IACI,UAAU,IAAI,IAAI;YAKX,mBAAmB;YAsBnB,qBAAqB;yCApI1B,uBAAuB;6CAAvB,uBAAuB;CAwJnC"}
1
+ {"version":3,"file":"credential-dialog.service.d.ts","sourceRoot":"","sources":["../../../src/lib/services/credential-dialog.service.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAA4B,gBAAgB,EAAQ,MAAM,eAAe,CAAC;AACjF,OAAO,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AAC3F,OAAO,EAAqB,KAAK,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAEjF,OAAO,EAA6B,uBAAuB,EAAE,sBAAsB,EAAE,MAAM,wCAAwC,CAAC;;AAEpI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,qBAGa,uBAAuB;IAChC;;;;;;OAMG;IACI,QAAQ,EAAE,iBAAiB,GAAG,IAAI,CAAQ;IAEjD,8EAA8E;IAC9E,IAAW,aAAa,IAAI,iBAAiB,CAE5C;IAED,OAAO,CAAC,gBAAgB,CAAyC;IACjE,OAAO,CAAC,uBAAuB,CAAS;IACxC,OAAO,CAAC,2BAA2B,CAAkD;IAErF;;;;;;OAMG;IACU,UAAU,CACnB,gBAAgB,EAAE,gBAAgB,EAClC,OAAO,CAAC,EAAE,uBAAuB,GAClC,OAAO,CAAC,sBAAsB,CAAC;IAwBlC,0CAA0C;IAC7B,UAAU,CACnB,gBAAgB,EAAE,gBAAgB,EAClC,OAAO,CAAC,EAAE,uBAAuB,GAClC,OAAO,CAAC,sBAAsB,CAAC;IAIlC;;;;;;;;OAQG;IACU,gBAAgB,CACzB,gBAAgB,EAAE,gBAAgB,EAClC,iBAAiB,CAAC,EAAE,MAAM,EAC1B,qBAAqB,CAAC,EAAE,MAAM,GAC/B,OAAO,CAAC,sBAAsB,CAAC;IASlC,gDAAgD;IACnC,gBAAgB,CACzB,gBAAgB,EAAE,gBAAgB,EAClC,iBAAiB,CAAC,EAAE,MAAM,EAC1B,qBAAqB,CAAC,EAAE,MAAM,GAC/B,OAAO,CAAC,sBAAsB,CAAC;IAIlC;;;;;;;OAOG;IACU,cAAc,CACvB,gBAAgB,EAAE,gBAAgB,EAClC,UAAU,EAAE,kBAAkB,GAC/B,OAAO,CAAC,sBAAsB,CAAC;IAOlC,8CAA8C;IACjC,cAAc,CACvB,gBAAgB,EAAE,gBAAgB,EAClC,UAAU,EAAE,kBAAkB,GAC/B,OAAO,CAAC,sBAAsB,CAAC;IAIlC;;;OAGG;IACU,kBAAkB,IAAI,OAAO,CAAC,sBAAsB,EAAE,CAAC;IAIpE,kDAAkD;IACrC,kBAAkB,IAAI,OAAO,CAAC,sBAAsB,EAAE,CAAC;IAIpE;;;OAGG;IACI,UAAU,IAAI,IAAI;IAKzB,0CAA0C;IACnC,UAAU,IAAI,IAAI;YAIX,mBAAmB;YAsBnB,qBAAqB;yCAvK1B,uBAAuB;6CAAvB,uBAAuB;CA2LnC"}
@@ -64,7 +64,7 @@ export class CredentialDialogService {
64
64
  * @param options - Optional configuration for the dialog
65
65
  * @returns Promise resolving to the dialog result
66
66
  */
67
- async openDialog(viewContainerRef, options) {
67
+ async OpenDialog(viewContainerRef, options) {
68
68
  // Pre-load credential types
69
69
  await this.loadCredentialTypes();
70
70
  // Create the dialog component dynamically
@@ -82,6 +82,10 @@ export class CredentialDialogService {
82
82
  // Wait for the result
83
83
  return firstValueFrom(resultSubject);
84
84
  }
85
+ /** @deprecated Use {@link OpenDialog}. */
86
+ async openDialog(viewContainerRef, options) {
87
+ return this.OpenDialog(viewContainerRef, options);
88
+ }
85
89
  /**
86
90
  * Opens a dialog to create a new credential with optional pre-selections.
87
91
  * Convenience method that wraps openDialog with create-specific defaults.
@@ -91,14 +95,18 @@ export class CredentialDialogService {
91
95
  * @param preselectedCategoryId - Optional category to pre-select
92
96
  * @returns Promise resolving to the dialog result
93
97
  */
94
- async createCredential(viewContainerRef, preselectedTypeId, preselectedCategoryId) {
95
- return this.openDialog(viewContainerRef, {
98
+ async CreateCredential(viewContainerRef, preselectedTypeId, preselectedCategoryId) {
99
+ return this.OpenDialog(viewContainerRef, {
96
100
  credential: null,
97
101
  preselectedTypeId,
98
102
  preselectedCategoryId,
99
103
  title: 'Create Credential'
100
104
  });
101
105
  }
106
+ /** @deprecated Use {@link CreateCredential}. */
107
+ async createCredential(viewContainerRef, preselectedTypeId, preselectedCategoryId) {
108
+ return this.CreateCredential(viewContainerRef, preselectedTypeId, preselectedCategoryId);
109
+ }
102
110
  /**
103
111
  * Opens a dialog to edit an existing credential.
104
112
  * Convenience method that wraps openDialog with edit-specific defaults.
@@ -107,27 +115,39 @@ export class CredentialDialogService {
107
115
  * @param credential - The credential to edit
108
116
  * @returns Promise resolving to the dialog result
109
117
  */
110
- async editCredential(viewContainerRef, credential) {
111
- return this.openDialog(viewContainerRef, {
118
+ async EditCredential(viewContainerRef, credential) {
119
+ return this.OpenDialog(viewContainerRef, {
112
120
  credential,
113
121
  title: `Edit Credential: ${credential.Name}`
114
122
  });
115
123
  }
124
+ /** @deprecated Use {@link EditCredential}. */
125
+ async editCredential(viewContainerRef, credential) {
126
+ return this.EditCredential(viewContainerRef, credential);
127
+ }
116
128
  /**
117
129
  * Gets cached credential types or loads them if not cached.
118
130
  * Types are cached to avoid repeated database calls.
119
131
  */
120
- async getCredentialTypes() {
132
+ async GetCredentialTypes() {
121
133
  return this.loadCredentialTypes();
122
134
  }
135
+ /** @deprecated Use {@link GetCredentialTypes}. */
136
+ async getCredentialTypes() {
137
+ return this.GetCredentialTypes();
138
+ }
123
139
  /**
124
140
  * Clears the cached credential types.
125
141
  * Call this if you need to refresh the list after adding new types.
126
142
  */
127
- clearCache() {
143
+ ClearCache() {
128
144
  this._credentialTypes = null;
129
145
  this._credentialTypesLoadPromise = null;
130
146
  }
147
+ /** @deprecated Use {@link ClearCache}. */
148
+ clearCache() {
149
+ return this.ClearCache();
150
+ }
131
151
  async loadCredentialTypes() {
132
152
  // Return cached types if available
133
153
  if (this._credentialTypes) {
@@ -1 +1 @@
1
- {"version":3,"file":"credential-dialog.service.js","sourceRoot":"","sources":["../../../src/lib/services/credential-dialog.service.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,UAAU,EAAwC,MAAM,eAAe,CAAC;AAEjF,OAAO,EAAE,QAAQ,EAAE,OAAO,EAA0B,MAAM,sBAAsB,CAAC;AACjF,OAAO,EAAE,OAAO,EAAc,cAAc,EAAE,MAAM,MAAM,CAAC;AAC3D,OAAO,EAAE,yBAAyB,EAAmD,MAAM,wCAAwC,CAAC;;AAEpI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAIH,MAAM,OAAO,uBAAuB;IAChC;;;;;;OAMG;IACI,QAAQ,GAA6B,IAAI,CAAC;IAEjD,8EAA8E;IAC9E,IAAW,aAAa;QACpB,OAAO,IAAI,CAAC,QAAQ,IAAI,QAAQ,CAAC,QAAQ,CAAC;IAC9C,CAAC;IAEO,gBAAgB,GAAoC,IAAI,CAAC;IACzD,uBAAuB,GAAG,KAAK,CAAC;IAChC,2BAA2B,GAA6C,IAAI,CAAC;IAErF;;;;;;OAMG;IACI,KAAK,CAAC,UAAU,CACnB,gBAAkC,EAClC,OAAiC;QAEjC,4BAA4B;QAC5B,MAAM,IAAI,CAAC,mBAAmB,EAAE,CAAC;QAEjC,0CAA0C;QAC1C,MAAM,YAAY,GAAG,gBAAgB,CAA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BACrB","sourcesContent":["/**\n * @fileoverview Credential Dialog Service\n *\n * A service that provides easy programmatic access to credential dialogs.\n * Use this service to open credential creation/editing dialogs from anywhere\n * in your application without needing to include the component in your template.\n */\n\nimport { Injectable, ComponentRef, ViewContainerRef, Type } from '@angular/core';\nimport { MJCredentialEntity, MJCredentialTypeEntity } from '@memberjunction/core-entities';\nimport { Metadata, RunView, type IMetadataProvider } from '@memberjunction/core';\nimport { Subject, Observable, firstValueFrom } from 'rxjs';\nimport { CredentialDialogComponent, CredentialDialogOptions, CredentialDialogResult } from '../dialogs/credential-dialog.component';\n\n/**\n * Service for programmatically opening credential dialogs.\n *\n * @example\n * ```typescript\n * // Inject the service\n * constructor(private credentialDialog: CredentialDialogService) {}\n *\n * // Open dialog to create a new credential\n * async createCredential() {\n * const result = await this.credentialDialog.openDialog(this.viewContainerRef);\n * if (result.success && result.credential) {\n * console.log('Created credential:', result.credential.Name);\n * }\n * }\n *\n * // Open dialog with pre-selected type\n * async createApiKey() {\n * const result = await this.credentialDialog.openDialog(this.viewContainerRef, {\n * preselectedTypeId: 'api-key-type-id'\n * });\n * }\n *\n * // Edit an existing credential\n * async editCredential(credential: MJCredentialEntity) {\n * const result = await this.credentialDialog.openDialog(this.viewContainerRef, {\n * credential\n * });\n * }\n * ```\n */\n@Injectable({\n providedIn: 'root'\n})\nexport class CredentialDialogService {\n /**\n * The provider every read goes through.\n *\n * A `providedIn: 'root'` service that constructs its own `RunView` silently binds the global\n * default and ignores whichever provider its host was handed. Null means \"use the global\n * default\", so single-provider apps see no behaviour change.\n */\n public Provider: IMetadataProvider | null = null;\n\n /** The provider to actually use — the injected one, or the global default. */\n public get ProviderToUse(): IMetadataProvider {\n return this.Provider ?? Metadata.Provider;\n }\n\n private _credentialTypes: MJCredentialTypeEntity[] | null = null;\n private _credentialTypesLoading = false;\n private _credentialTypesLoadPromise: Promise<MJCredentialTypeEntity[]> | null = null;\n\n /**\n * Opens a credential dialog and returns a promise that resolves when the dialog closes.\n *\n * @param viewContainerRef - The ViewContainerRef to attach the dialog to\n * @param options - Optional configuration for the dialog\n * @returns Promise resolving to the dialog result\n */\n public async openDialog(\n viewContainerRef: ViewContainerRef,\n options?: CredentialDialogOptions\n ): Promise<CredentialDialogResult> {\n // Pre-load credential types\n await this.loadCredentialTypes();\n\n // Create the dialog component dynamically\n const componentRef = viewContainerRef.createComponent(CredentialDialogComponent);\n const instance = componentRef.instance;\n\n // Set up the result handling\n const resultSubject = new Subject<CredentialDialogResult>();\n\n instance.close.subscribe((result: CredentialDialogResult) => {\n resultSubject.next(result);\n resultSubject.complete();\n componentRef.destroy();\n });\n\n // Open the dialog\n await instance.open(options);\n\n // Wait for the result\n return firstValueFrom(resultSubject);\n }\n\n /**\n * Opens a dialog to create a new credential with optional pre-selections.\n * Convenience method that wraps openDialog with create-specific defaults.\n *\n * @param viewContainerRef - The ViewContainerRef to attach the dialog to\n * @param preselectedTypeId - Optional credential type to pre-select\n * @param preselectedCategoryId - Optional category to pre-select\n * @returns Promise resolving to the dialog result\n */\n public async createCredential(\n viewContainerRef: ViewContainerRef,\n preselectedTypeId?: string,\n preselectedCategoryId?: string\n ): Promise<CredentialDialogResult> {\n return this.openDialog(viewContainerRef, {\n credential: null,\n preselectedTypeId,\n preselectedCategoryId,\n title: 'Create Credential'\n });\n }\n\n /**\n * Opens a dialog to edit an existing credential.\n * Convenience method that wraps openDialog with edit-specific defaults.\n *\n * @param viewContainerRef - The ViewContainerRef to attach the dialog to\n * @param credential - The credential to edit\n * @returns Promise resolving to the dialog result\n */\n public async editCredential(\n viewContainerRef: ViewContainerRef,\n credential: MJCredentialEntity\n ): Promise<CredentialDialogResult> {\n return this.openDialog(viewContainerRef, {\n credential,\n title: `Edit Credential: ${credential.Name}`\n });\n }\n\n /**\n * Gets cached credential types or loads them if not cached.\n * Types are cached to avoid repeated database calls.\n */\n public async getCredentialTypes(): Promise<MJCredentialTypeEntity[]> {\n return this.loadCredentialTypes();\n }\n\n /**\n * Clears the cached credential types.\n * Call this if you need to refresh the list after adding new types.\n */\n public clearCache(): void {\n this._credentialTypes = null;\n this._credentialTypesLoadPromise = null;\n }\n\n private async loadCredentialTypes(): Promise<MJCredentialTypeEntity[]> {\n // Return cached types if available\n if (this._credentialTypes) {\n return this._credentialTypes;\n }\n\n // Return existing load promise if already loading\n if (this._credentialTypesLoadPromise) {\n return this._credentialTypesLoadPromise;\n }\n\n // Start loading\n this._credentialTypesLoadPromise = this.doLoadCredentialTypes();\n\n try {\n this._credentialTypes = await this._credentialTypesLoadPromise;\n return this._credentialTypes;\n } finally {\n this._credentialTypesLoadPromise = null;\n }\n }\n\n private async doLoadCredentialTypes(): Promise<MJCredentialTypeEntity[]> {\n try {\n const rv = RunView.FromMetadataProvider(this.ProviderToUse);\n const result = await rv.RunView<MJCredentialTypeEntity>({\n EntityName: 'MJ: Credential Types',\n OrderBy: 'Category, Name',\n ResultType: 'entity_object'\n });\n\n if (result.Success) {\n return result.Results;\n }\n\n console.error('Failed to load credential types:', result.ErrorMessage);\n return [];\n } catch (error) {\n console.error('Error loading credential types:', error);\n return [];\n }\n }\n}\n"]}
1
+ {"version":3,"file":"credential-dialog.service.js","sourceRoot":"","sources":["../../../src/lib/services/credential-dialog.service.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,UAAU,EAAwC,MAAM,eAAe,CAAC;AAEjF,OAAO,EAAE,QAAQ,EAAE,OAAO,EAA0B,MAAM,sBAAsB,CAAC;AACjF,OAAO,EAAE,OAAO,EAAc,cAAc,EAAE,MAAM,MAAM,CAAC;AAC3D,OAAO,EAAE,yBAAyB,EAAmD,MAAM,wCAAwC,CAAC;;AAEpI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAIH,MAAM,OAAO,uBAAuB;IAChC;;;;;;OAMG;IACI,QAAQ,GAA6B,IAAI,CAAC;IAEjD,8EAA8E;IAC9E,IAAW,aAAa;QACpB,OAAO,IAAI,CAAC,QAAQ,IAAI,QAAQ,CAA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AAC,qBAAqB,EAAE,CAAC;QAEhE,IAAI,CAAC;YACD,IAAI,CAAC,gBAAgB,GAAG,MAAM,IAAI,CAAC,2BAA2B,CAAC;YAC/D,OAAO,IAAI,CAAC,gBAAgB,CAAC;QACjC,CAAC;gBAAS,CAAC;YACP,IAAI,CAAC,2BAA2B,GAAG,IAAI,CAAC;QAC5C,CAAC;IACL,CAAC;IAEO,KAAK,CAAC,qBAAqB;QAC/B,IAAI,CAAC;YACD,MAAM,EAAE,GAAG,OAAO,CAAC,oBAAoB,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;YAC5D,MAAM,MAAM,GAAG,MAAM,EAAE,CAAC,OAAO,CAAyB;gBACpD,UAAU,EAAE,sBAAsB;gBAClC,OAAO,EAAE,gBAAgB;gBACzB,UAAU,EAAE,eAAe;aAC9B,CAAC,CAAC;YAEH,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;gBACjB,OAAO,MAAM,CAAC,OAAO,CAAC;YAC1B,CAAC;YAED,OAAO,CAAC,KAAK,CAAC,kCAAkC,EAAE,MAAM,CAAC,YAAY,CAAC,CAAC;YACvE,OAAO,EAAE,CAAC;QACd,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACb,OAAO,CAAC,KAAK,CAAC,iCAAiC,EAAE,KAAK,CAAC,CAAC;YACxD,OAAO,EAAE,CAAC;QACd,CAAC;IACL,CAAC;wGA1LQ,uBAAuB;4GAAvB,uBAAuB,cAFpB,MAAM;;4FAET,uBAAuB;kBAHnC,UAAU;mBAAC;oBACR,UAAU,EAAE,MAAM;iBACrB","sourcesContent":["/**\n * @fileoverview Credential Dialog Service\n *\n * A service that provides easy programmatic access to credential dialogs.\n * Use this service to open credential creation/editing dialogs from anywhere\n * in your application without needing to include the component in your template.\n */\n\nimport { Injectable, ComponentRef, ViewContainerRef, Type } from '@angular/core';\nimport { MJCredentialEntity, MJCredentialTypeEntity } from '@memberjunction/core-entities';\nimport { Metadata, RunView, type IMetadataProvider } from '@memberjunction/core';\nimport { Subject, Observable, firstValueFrom } from 'rxjs';\nimport { CredentialDialogComponent, CredentialDialogOptions, CredentialDialogResult } from '../dialogs/credential-dialog.component';\n\n/**\n * Service for programmatically opening credential dialogs.\n *\n * @example\n * ```typescript\n * // Inject the service\n * constructor(private credentialDialog: CredentialDialogService) {}\n *\n * // Open dialog to create a new credential\n * async createCredential() {\n * const result = await this.credentialDialog.openDialog(this.viewContainerRef);\n * if (result.success && result.credential) {\n * console.log('Created credential:', result.credential.Name);\n * }\n * }\n *\n * // Open dialog with pre-selected type\n * async createApiKey() {\n * const result = await this.credentialDialog.openDialog(this.viewContainerRef, {\n * preselectedTypeId: 'api-key-type-id'\n * });\n * }\n *\n * // Edit an existing credential\n * async editCredential(credential: MJCredentialEntity) {\n * const result = await this.credentialDialog.openDialog(this.viewContainerRef, {\n * credential\n * });\n * }\n * ```\n */\n@Injectable({\n providedIn: 'root'\n})\nexport class CredentialDialogService {\n /**\n * The provider every read goes through.\n *\n * A `providedIn: 'root'` service that constructs its own `RunView` silently binds the global\n * default and ignores whichever provider its host was handed. Null means \"use the global\n * default\", so single-provider apps see no behaviour change.\n */\n public Provider: IMetadataProvider | null = null;\n\n /** The provider to actually use — the injected one, or the global default. */\n public get ProviderToUse(): IMetadataProvider {\n return this.Provider ?? Metadata.Provider;\n }\n\n private _credentialTypes: MJCredentialTypeEntity[] | null = null;\n private _credentialTypesLoading = false;\n private _credentialTypesLoadPromise: Promise<MJCredentialTypeEntity[]> | null = null;\n\n /**\n * Opens a credential dialog and returns a promise that resolves when the dialog closes.\n *\n * @param viewContainerRef - The ViewContainerRef to attach the dialog to\n * @param options - Optional configuration for the dialog\n * @returns Promise resolving to the dialog result\n */\n public async OpenDialog(\n viewContainerRef: ViewContainerRef,\n options?: CredentialDialogOptions\n ): Promise<CredentialDialogResult> {\n // Pre-load credential types\n await this.loadCredentialTypes();\n\n // Create the dialog component dynamically\n const componentRef = viewContainerRef.createComponent(CredentialDialogComponent);\n const instance = componentRef.instance;\n\n // Set up the result handling\n const resultSubject = new Subject<CredentialDialogResult>();\n\n instance.close.subscribe((result: CredentialDialogResult) => {\n resultSubject.next(result);\n resultSubject.complete();\n componentRef.destroy();\n });\n\n // Open the dialog\n await instance.open(options);\n\n // Wait for the result\n return firstValueFrom(resultSubject);\n }\n\n /** @deprecated Use {@link OpenDialog}. */\n public async openDialog(\n viewContainerRef: ViewContainerRef,\n options?: CredentialDialogOptions\n ): Promise<CredentialDialogResult> {\n return this.OpenDialog(viewContainerRef, options);\n }\n\n /**\n * Opens a dialog to create a new credential with optional pre-selections.\n * Convenience method that wraps openDialog with create-specific defaults.\n *\n * @param viewContainerRef - The ViewContainerRef to attach the dialog to\n * @param preselectedTypeId - Optional credential type to pre-select\n * @param preselectedCategoryId - Optional category to pre-select\n * @returns Promise resolving to the dialog result\n */\n public async CreateCredential(\n viewContainerRef: ViewContainerRef,\n preselectedTypeId?: string,\n preselectedCategoryId?: string\n ): Promise<CredentialDialogResult> {\n return this.OpenDialog(viewContainerRef, {\n credential: null,\n preselectedTypeId,\n preselectedCategoryId,\n title: 'Create Credential'\n });\n }\n\n /** @deprecated Use {@link CreateCredential}. */\n public async createCredential(\n viewContainerRef: ViewContainerRef,\n preselectedTypeId?: string,\n preselectedCategoryId?: string\n ): Promise<CredentialDialogResult> {\n return this.CreateCredential(viewContainerRef, preselectedTypeId, preselectedCategoryId);\n }\n\n /**\n * Opens a dialog to edit an existing credential.\n * Convenience method that wraps openDialog with edit-specific defaults.\n *\n * @param viewContainerRef - The ViewContainerRef to attach the dialog to\n * @param credential - The credential to edit\n * @returns Promise resolving to the dialog result\n */\n public async EditCredential(\n viewContainerRef: ViewContainerRef,\n credential: MJCredentialEntity\n ): Promise<CredentialDialogResult> {\n return this.OpenDialog(viewContainerRef, {\n credential,\n title: `Edit Credential: ${credential.Name}`\n });\n }\n\n /** @deprecated Use {@link EditCredential}. */\n public async editCredential(\n viewContainerRef: ViewContainerRef,\n credential: MJCredentialEntity\n ): Promise<CredentialDialogResult> {\n return this.EditCredential(viewContainerRef, credential);\n }\n\n /**\n * Gets cached credential types or loads them if not cached.\n * Types are cached to avoid repeated database calls.\n */\n public async GetCredentialTypes(): Promise<MJCredentialTypeEntity[]> {\n return this.loadCredentialTypes();\n }\n\n /** @deprecated Use {@link GetCredentialTypes}. */\n public async getCredentialTypes(): Promise<MJCredentialTypeEntity[]> {\n return this.GetCredentialTypes();\n }\n\n /**\n * Clears the cached credential types.\n * Call this if you need to refresh the list after adding new types.\n */\n public ClearCache(): void {\n this._credentialTypes = null;\n this._credentialTypesLoadPromise = null;\n }\n\n /** @deprecated Use {@link ClearCache}. */\n public clearCache(): void {\n return this.ClearCache();\n }\n\n private async loadCredentialTypes(): Promise<MJCredentialTypeEntity[]> {\n // Return cached types if available\n if (this._credentialTypes) {\n return this._credentialTypes;\n }\n\n // Return existing load promise if already loading\n if (this._credentialTypesLoadPromise) {\n return this._credentialTypesLoadPromise;\n }\n\n // Start loading\n this._credentialTypesLoadPromise = this.doLoadCredentialTypes();\n\n try {\n this._credentialTypes = await this._credentialTypesLoadPromise;\n return this._credentialTypes;\n } finally {\n this._credentialTypesLoadPromise = null;\n }\n }\n\n private async doLoadCredentialTypes(): Promise<MJCredentialTypeEntity[]> {\n try {\n const rv = RunView.FromMetadataProvider(this.ProviderToUse);\n const result = await rv.RunView<MJCredentialTypeEntity>({\n EntityName: 'MJ: Credential Types',\n OrderBy: 'Category, Name',\n ResultType: 'entity_object'\n });\n\n if (result.Success) {\n return result.Results;\n }\n\n console.error('Failed to load credential types:', result.ErrorMessage);\n return [];\n } catch (error) {\n console.error('Error loading credential types:', error);\n return [];\n }\n }\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@memberjunction/ng-credentials",
3
- "version": "6.1.4",
3
+ "version": "6.2.0-edge.1",
4
4
  "description": "MemberJunction: Angular components for credential management - panels and dialogs for creating and editing credentials",
5
5
  "main": "./dist/public-api.js",
6
6
  "typings": "./dist/public-api.d.ts",
@@ -18,7 +18,7 @@
18
18
  "devDependencies": {
19
19
  "@angular/compiler": "21.2.22",
20
20
  "@angular/compiler-cli": "21.2.22",
21
- "@memberjunction/ng-test-utils": "6.1.4",
21
+ "@memberjunction/ng-test-utils": "6.2.0-edge.1",
22
22
  "vitest": "^4.0.18"
23
23
  },
24
24
  "peerDependencies": {
@@ -27,13 +27,13 @@
27
27
  "@angular/forms": "^21.2.22"
28
28
  },
29
29
  "dependencies": {
30
- "@memberjunction/core": "6.1.4",
31
- "@memberjunction/ng-base-types": "6.1.4",
32
- "@memberjunction/core-entities": "6.1.4",
33
- "@memberjunction/global": "6.1.4",
34
- "@memberjunction/ng-notifications": "6.1.4",
35
- "@memberjunction/ng-shared-generic": "6.1.4",
36
- "@memberjunction/ng-ui-components": "6.1.4",
30
+ "@memberjunction/core": "6.2.0-edge.1",
31
+ "@memberjunction/ng-base-types": "6.2.0-edge.1",
32
+ "@memberjunction/core-entities": "6.2.0-edge.1",
33
+ "@memberjunction/global": "6.2.0-edge.1",
34
+ "@memberjunction/ng-notifications": "6.2.0-edge.1",
35
+ "@memberjunction/ng-shared-generic": "6.2.0-edge.1",
36
+ "@memberjunction/ng-ui-components": "6.2.0-edge.1",
37
37
  "tslib": "^2.8.1",
38
38
  "rxjs": "^7.8.2"
39
39
  },