{ "version": 3, "sources": ["src/app/store/support-issues/support-issues.actions.ts", "src/app/shared/services/jira-management.service.ts", "src/app/store/support-issues/support-issues.state.ts", "src/app/store/support/support.state.ts"], "sourcesContent": ["export class GetInternalRecordsForJiraTicket {\n public static readonly type = '[Support] Get internal records';\n}\n\nexport class CreateInternalRecordForJiraTicket {\n public static readonly type = '[Support] Create internal record';\n constructor(public jiraIssue: any) {}\n}\n\nexport class UpdateInternalRecordForJiraTicket {\n public static readonly type = '[Support] Update internal record';\n constructor(public jiraKey: string) {}\n}\n\nexport class RemoveInternalRecordForJiraTicket {\n public static readonly type = '[Support] Remove internal record';\n constructor(public jiraKey: string) {}\n}\n", "import {\n HttpClient,\n HttpEvent,\n HttpHeaders,\n HttpResponse,\n} from '@angular/common/http';\nimport {Injectable} from '@angular/core';\nimport {Observable} from 'rxjs';\nimport {ConfigurationService} from 'src/app/core/config/configuration.service';\nimport {\n IJiraCustomer,\n IJiraQueryPage,\n} from 'src/app/interfaces/general/responses/jira-query-page.interface';\nimport {IJiraTempAttachments} from 'src/app/interfaces/general/responses/jira-temp-attachments.interface';\nimport {uploadProgress} from 'src/app/shared/helpers/upload-progress';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class JiraManagementService {\n private readonly _jiraApiUrl;\n private readonly _serviceDeskId;\n private readonly _commonRequestTypeId;\n private readonly _deleteAccountRequestTypeId;\n private readonly _userProfileIdCustomField;\n\n constructor(private http: HttpClient, private config: ConfigurationService) {\n this._jiraApiUrl = this.config.get('jiraManagementApiUrl');\n this._serviceDeskId = this.config.get('jiraServiceDeskId');\n this._commonRequestTypeId = this.config.get('jiraCommonRequestTypeId');\n this._deleteAccountRequestTypeId = this.config.get('jiraDeleteAccountRequestTypeId');\n this._userProfileIdCustomField = this.config.get('jiraUserProfileIdCustomField');\n }\n\n public getCustomer(email: string): Observable> {\n return this.http.get>(\n `${this._jiraApiUrl}/customer?query=${email}`\n );\n }\n\n public createCustomer(displayName: string, email: string): Observable {\n const newCustomer = {displayName, email};\n return this.http.post(`${this._jiraApiUrl}/customer`, newCustomer);\n }\n\n public uploadAttachments(\n files: File[],\n uploadCallback: (progress: number) => void\n ): Observable | HttpEvent> {\n const formData = new FormData();\n files.forEach((f) => formData.append('file', f));\n\n let headers = new HttpHeaders();\n headers = headers.append('X-Atlassian-Token', 'no-check');\n\n return this.http\n .post(`${this._jiraApiUrl}/attachTemporaryFile`, formData, {\n reportProgress: true,\n observe: 'events',\n headers,\n })\n .pipe(uploadProgress(uploadCallback));\n }\n\n public getRequest(jiraKey: string): Observable {\n return this.http.get(`${this._jiraApiUrl}/request/${jiraKey}`);\n }\n\n public createRequest(\n jiraAccountId: string,\n payload: {summary: string; description?: string; profileId: string}\n ): Observable {\n const body = {\n serviceDeskId: this._serviceDeskId,\n requestTypeId: this._commonRequestTypeId,\n raiseOnBehalfOf: jiraAccountId,\n requestFieldValues: this._payloadConverter(payload),\n };\n\n return this.http.post(`${this._jiraApiUrl}/request`, body);\n }\n\n public deleteAccountRequest(\n jiraAccountId: string,\n payload: {summary: string; description?: string; profileId: string}\n ): Observable {\n const body = {\n serviceDeskId: this._serviceDeskId,\n requestTypeId: this._deleteAccountRequestTypeId,\n raiseOnBehalfOf: jiraAccountId,\n requestFieldValues: this._payloadConverter(payload),\n };\n\n return this.http.post(`${this._jiraApiUrl}/request`, body);\n }\n\n public createAttachment(issueKey: string, temporaryAttachmentIds: string[]): Observable {\n const payload = {\n temporaryAttachmentIds,\n public: true,\n };\n return this.http.post(`${this._jiraApiUrl}/request/${issueKey}/attachment`, payload);\n }\n\n private _payloadConverter(payload: {\n summary: string;\n description?: string;\n profileId: string;\n }): {summary: string; description?: string} {\n const {profileId} = payload;\n delete payload.profileId;\n payload[this._userProfileIdCustomField] = profileId;\n return {...payload};\n }\n}\n", "/* eslint-disable @typescript-eslint/no-unused-vars */\nimport {Injectable} from '@angular/core';\nimport {Action, Selector, State, StateContext, Store} from '@ngxs/store';\nimport {ProfileService} from '../../modules/profile/profile.service';\nimport {JiraManagementService} from 'src/app/shared/services/jira-management.service';\nimport {\n CreateInternalRecordForJiraTicket,\n GetInternalRecordsForJiraTicket,\n RemoveInternalRecordForJiraTicket,\n UpdateInternalRecordForJiraTicket,\n} from 'src/app/store/support-issues/support-issues.actions';\nimport {EMPTY, Observable} from 'rxjs';\nimport {catchError, concatMap, map, switchMap, tap} from 'rxjs/operators';\nimport {HttpErrorResponse} from '@angular/common/http';\nimport {IJiraIssue} from 'src/app/modules/support/jira.issue.interface';\nimport {IPropertyValue} from 'src/app/interfaces/general/profile-definitions/property-value.interface';\n\nexport interface ISupportIssuesState {\n hasValue: boolean;\n loading: boolean;\n data: any[];\n error: any;\n}\n\n@State({\n name: 'supportIssues',\n defaults: {\n loading: false,\n hasValue: false,\n data: [],\n error: null,\n },\n})\n@Injectable()\nexport class SupportIssuesState {\n constructor(\n private store: Store,\n private profileService: ProfileService,\n private jiraService: JiraManagementService\n ) {}\n\n @Selector()\n public static error(state: ISupportIssuesState): any {\n return state.error;\n }\n\n @Selector()\n public static loading(state: ISupportIssuesState): boolean {\n return state.loading;\n }\n\n @Selector()\n public static data(state: ISupportIssuesState): any[] {\n return state.data;\n }\n\n @Action(GetInternalRecordsForJiraTicket)\n public getInternalRecords(ctx: StateContext): Observable {\n ctx.patchState({loading: true});\n const partnerDataName = 'jiraIssues';\n\n return this.profileService.getPartnerDataByName(partnerDataName).pipe(\n catchError((error) => {\n ctx.patchState({error, loading: false});\n console.error(error);\n return EMPTY;\n }),\n map((partnerData) => partnerData?.additionalProperty ?? []),\n map((rawIssues) => rawIssues?.map((issue) => stringifiedPropValueToPropValue(issue))),\n tap((issues) => {\n ctx.patchState({loading: false, data: issues, hasValue: issues?.length > 0});\n })\n );\n }\n\n @Action(CreateInternalRecordForJiraTicket)\n public createInternalRecord(\n ctx: StateContext,\n {jiraIssue}: any\n ): Observable {\n ctx.patchState({loading: true, data: [], hasValue: false});\n const partnerDataName = 'jiraIssues';\n\n return this.profileService.getPartnerDataByName(partnerDataName).pipe(\n catchError((error: HttpErrorResponse) => {\n if (error.status === 404) {\n return this.profileService\n .createPartnerData({\n name: partnerDataName,\n additionalProperty: [],\n })\n .pipe(\n catchError((err) => {\n ctx.patchState({error: err, loading: false});\n console.error(err);\n return EMPTY;\n })\n );\n }\n ctx.patchState({error, loading: false});\n console.error(error);\n return EMPTY;\n }),\n concatMap(({additionalProperty}) => {\n additionalProperty = additionalProperty ?? [];\n const propValue = jiraIssueToPropertyValue(jiraIssue);\n additionalProperty.unshift(propValue);\n return this.profileService\n .updatePartnerData(partnerDataName, {\n name: partnerDataName,\n additionalProperty,\n })\n .pipe(\n catchError((error) => {\n console.error(error);\n ctx.patchState({loading: false, error});\n return EMPTY;\n })\n );\n }),\n tap((partnerData) => {\n const issues = partnerData.additionalProperty?.map((i) =>\n stringifiedPropValueToPropValue(i)\n );\n ctx.patchState({loading: false, data: issues, hasValue: issues?.length > 0});\n })\n );\n }\n\n @Action(UpdateInternalRecordForJiraTicket)\n public updateInternalRecord(\n ctx: StateContext,\n {jiraKey}: any\n ): Observable {\n // ctx.patchState({loading: true, data: [], hasValue: false});\n const partnerDataName = 'jiraIssues';\n\n return this.jiraService.getRequest(jiraKey).pipe(\n catchError((error: HttpErrorResponse) => {\n if (error.status === 404) {\n this.store.dispatch(new RemoveInternalRecordForJiraTicket(jiraKey));\n }\n return EMPTY;\n }),\n switchMap((jiraIssue) => {\n const issue = jiraIssueToPropertyValue(jiraIssue);\n return this.profileService.updatePartnerDataByName(partnerDataName, issue);\n }),\n tap((partnerData) => {\n const issues = partnerData.additionalProperty?.map((i) =>\n stringifiedPropValueToPropValue(i)\n );\n ctx.patchState({loading: false, data: issues, hasValue: issues?.length > 0});\n })\n );\n }\n\n @Action(RemoveInternalRecordForJiraTicket)\n public removeInternalRecord(\n ctx: StateContext,\n {jiraKey}: any\n ): Observable {\n // ctx.patchState({loading: true, data: [], hasValue: false});\n const partnerDataName = 'jiraIssues';\n\n return this.profileService.removePartnerDataByNameAndId(partnerDataName, jiraKey).pipe(\n catchError((error: HttpErrorResponse) => {\n console.error(error);\n return EMPTY;\n }),\n tap((partnerData) => {\n const issues = partnerData.additionalProperty?.map((i) =>\n stringifiedPropValueToPropValue(i)\n );\n ctx.patchState({loading: false, data: issues, hasValue: issues?.length > 0});\n })\n );\n }\n}\n\nconst jiraIssueToPropertyValue = (issue: IJiraIssue): Partial => {\n const propValue: Partial = {};\n propValue.propertyId = issue.issueKey;\n const summary =\n issue.requestFieldValues.filter((i) => i.fieldId === 'summary')?.[0]?.value ??\n 'missing summary';\n const tempValue = {\n issueId: issue.issueId,\n status: issue.currentStatus.status,\n summary,\n createdDate: issue.createdDate.iso8601,\n };\n propValue.value = JSON.stringify(tempValue);\n return propValue;\n};\n\nconst stringifiedPropValueToPropValue = (propValue: any): IPropertyValue => {\n const strValue = (propValue.value as unknown as string) ?? '{}';\n let value = {};\n try {\n value = JSON.parse(strValue);\n } catch (error) {\n console.error(error);\n }\n return {...propValue, value};\n};\n", "/* eslint-disable @typescript-eslint/no-unused-vars */\nimport {Injectable} from '@angular/core';\nimport {Action, Selector, State, StateContext, Store} from '@ngxs/store';\nimport {ISupportForm} from 'src/app/interfaces/general/support.interface';\nimport {\n CancelDeletionAccountRequest,\n ConfirmDeletionAccountRequest,\n GoToSupportForm,\n InitiateDeletionAccountRequest,\n SendRequest,\n} from './support.actions';\nimport {UpdateFormValue} from '@ngxs/form-plugin';\nimport {GetProfile} from '../profile/profile.actions';\nimport {ProfileService} from '../../modules/profile/profile.service';\nimport {EMPTY, firstValueFrom, Observable, of, switchMap} from 'rxjs';\nimport {JiraManagementService} from 'src/app/shared/services/jira-management.service';\nimport {catchError, concatMap, map, mergeMap, tap} from 'rxjs/operators';\nimport {CreateInternalRecordForJiraTicket} from 'src/app/store/support-issues/support-issues.actions';\nimport {ProfileState} from 'src/app/store/profile/profile.state';\n\nexport interface ISupportState {\n supportForm: {model: ISupportForm};\n hasValue: boolean;\n loading: boolean;\n supportIssue: any;\n}\n\n@State({\n name: 'support',\n defaults: {\n supportForm: {\n model: null,\n },\n loading: false,\n hasValue: false,\n supportIssue: null,\n },\n})\n@Injectable()\nexport class SupportState {\n constructor(\n private store: Store,\n private profileService: ProfileService,\n private jiraService: JiraManagementService,\n ) {}\n\n @Selector()\n public static model(state: ISupportState): ISupportForm {\n return state.supportForm.model;\n }\n\n @Selector()\n public static loading(state: ISupportState): boolean {\n return state.loading;\n }\n\n @Selector()\n public static supportIssue(state: ISupportState): any {\n return state.supportIssue;\n }\n\n @Action(GoToSupportForm)\n public async goToSupportForm(ctx: StateContext): Promise {\n ctx.patchState({loading: true, supportIssue: null, hasValue: false});\n const {profile} = await firstValueFrom(this.store.dispatch(new GetProfile()));\n ctx.patchState({loading: false});\n this.store.dispatch(\n new UpdateFormValue({\n path: 'support.supportForm',\n value: {\n email: profile.data.email,\n },\n propertyPath: '',\n }),\n );\n }\n\n @Action(SendRequest)\n public sendRequest(ctx: StateContext): Observable {\n const state = ctx.getState();\n const form = state.supportForm.model;\n\n const email = form.email;\n const summary = form.title;\n const description = form.description;\n const attachments = form.attachment;\n\n return this.jiraService.getCustomer(email).pipe(\n tap(() => ctx.patchState({loading: true})),\n mergeMap((result) => {\n let accountId = result.size > 0 ? result.values[0].accountId : null;\n return accountId\n ? of(accountId)\n : this.profileService.getProfile().pipe(\n concatMap((profile) =>\n this.jiraService.createCustomer(profile.displayName, profile.email),\n ),\n map((newCustomer) => newCustomer.accountId),\n );\n }),\n catchError(() => {\n console.error('Can not get or create account for creating ticket');\n ctx.patchState({loading: false});\n return EMPTY;\n }),\n concatMap((accountId) => {\n const {profileId} = this.store.selectSnapshot(ProfileState.profile);\n return this.jiraService.createRequest(accountId, {summary, description, profileId});\n }),\n catchError(() => {\n console.error('An error appear during creating ticket');\n ctx.patchState({loading: false});\n return EMPTY;\n }),\n concatMap((issue) => {\n ctx.patchState({\n supportIssue: issue,\n });\n this.store.dispatch(new CreateInternalRecordForJiraTicket(issue));\n const attachmentIds = attachments\n .map((a) =>\n a.temporaryAttachments.map(\n (attachment) => attachment.temporaryAttachmentId,\n ),\n )\n .flat();\n return attachmentIds?.length\n ? this.jiraService.createAttachment(issue.issueKey, attachmentIds).pipe(\n catchError((error) => {\n console.error(error);\n ctx.patchState({loading: false});\n return of(issue.issueKey);\n }),\n switchMap(() => issue.issueKey),\n )\n : of(of(issue.issueKey));\n }),\n tap(() => ctx.patchState({loading: false})),\n );\n }\n\n @Action(InitiateDeletionAccountRequest)\n public InitiateDeletionAccountRequest(ctx: StateContext): Observable {\n ctx.patchState({loading: true});\n return this.profileService.initiateDeletionProfile().pipe(\n catchError((error) => {\n console.error('Can not initiate account deletion due to error: ', error);\n ctx.patchState({loading: false});\n return EMPTY;\n }),\n tap(() => {\n ctx.patchState({loading: false});\n }),\n );\n }\n\n @Action(CancelDeletionAccountRequest)\n public CancelDeletionAccountRequest(ctx: StateContext): Observable {\n ctx.patchState({loading: true});\n return this.profileService.cancelDeletionProfile().pipe(\n catchError((error) => {\n console.error('Can not cancel account deletion due to error: ', error);\n ctx.patchState({loading: false});\n return EMPTY;\n }),\n tap(() => {\n ctx.patchState({loading: false});\n this.store.dispatch(new GetProfile(true));\n }),\n );\n }\n\n @Action(ConfirmDeletionAccountRequest)\n public ConfirmDeletionAccountRequest(ctx: StateContext): Observable {\n ctx.patchState({loading: true});\n return this.profileService.confirmDeletionProfile().pipe(\n catchError((error) => {\n console.error('Can not confirm account deletion due to error: ', error);\n ctx.patchState({loading: false});\n return EMPTY;\n }),\n tap(() => {\n ctx.patchState({loading: false});\n this.store.dispatch(new GetProfile(true));\n }),\n );\n }\n\n /* @Action(InitiateDeletionAccountRequest)\npublic InitiateDeletionAccountRequest(ctx: StateContext): Observable {\n // const summary = 'Delete account request';\n const {email} = this.store.selectSnapshot(ProfileState.profile);\n return this.jiraService.getCustomer(email).pipe(\n tap(() => ctx.patchState({loading: true})),\n mergeMap((result) => {\n let accountId = result.size > 0 ? result.values[0].accountId : null;\n return accountId ? of(accountId) : this.profileService.getProfile().pipe(\n concatMap((profile) => this.jiraService.createCustomer(profile.displayName, profile.email)),\n map((newCustomer) => newCustomer.accountId)\n )\n }),\n catchError((error) => {\n console.error('Can not get or create account for creating ticket');\n ctx.patchState({loading: false});\n return EMPTY;\n }),\n concatMap((accountId) => {\n const {profileId} = this.store.selectSnapshot(ProfileState.profile);\n return this.jiraService.deleteAccountRequest(accountId, {summary, profileId})\n }),\n catchError((error) => {\n console.error('An error appear during creating ticket');\n ctx.patchState({loading: false});\n return EMPTY;\n }),\n concatMap((issue) => {\n ctx.patchState({\n supportIssue: issue,\n });\n return of(issue)\n }),\n concatMap((issue) => {\n return forkJoin([\n of(issue),\n this.profileService.deleteProfile().pipe(catchError((error) => {\n console.error(error);\n return EMPTY;\n }))\n ]);\n }),\n tap(([issue, profile]) => {\n ctx.patchState({loading: false});\n if (profile) {\n this.store.dispatch(new GetProfile());\n }\n if (issue) {\n this.store.dispatch(new CreateInternalRecordForJiraTicket(issue));\n }\n }),\n )\n} */\n}\n"], "mappings": "0eAAA,IAAaA,GAA+B,IAAA,CAAtC,MAAOA,CAA+B,QACjB,KAAAC,KAAO,gCAAiC,SADtDD,CAA+B,GAAA,EAI/BE,GAAiC,IAAA,CAAxC,MAAOA,CAAiC,QACnB,KAAAD,KAAO,kCAAmC,CACjEE,YAAmBC,EAAc,CAAd,KAAAA,UAAAA,CAAiB,SAF3BF,CAAiC,GAAA,EAKjCG,GAAiC,IAAA,CAAxC,MAAOA,CAAiC,QACnB,KAAAJ,KAAO,kCAAmC,CACjEE,YAAmBG,EAAe,CAAf,KAAAA,QAAAA,CAAkB,SAF5BD,CAAiC,GAAA,EAKjCE,GAAiC,IAAA,CAAxC,MAAOA,CAAiC,QACnB,KAAAN,KAAO,kCAAmC,CACjEE,YAAmBG,EAAe,CAAf,KAAAA,QAAAA,CAAkB,SAF5BC,CAAiC,GAAA,ECK9C,IAAaC,GAAqB,IAAA,CAA5B,MAAOA,CAAqB,CAO9BC,YAAoBC,EAA0BC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C+E,EAAA,CADNC,EAAOX,CAA4B,CAAC,EAAArE,EAAA,UAAA,+BAAA,IAAA,EAiB9B+E,EAAA,CADNC,EAAOT,CAA6B,CAAC,EAAAvE,EAAA,UAAA,gCAAA,IAAA,EA7HxB+E,EAAA,CADbI,EAAQ,CAAE,EAAAnF,EAAA,QAAA,IAAA,EAMG+E,EAAA,CADbI,EAAQ,CAAE,EAAAnF,EAAA,UAAA,IAAA,EAMG+E,EAAA,CADbI,EAAQ,CAAE,EAAAnF,EAAA,eAAA,IAAA,EAjBFA,EAAY+E,EAAA,CAZxBK,EAAqB,CAClBC,KAAM,UACNC,SAAU,CACN/E,YAAa,CACTF,MAAO,MAEXG,QAAS,GACTM,SAAU,GACVL,aAAc,MAErB,CAAC,EAEWT,CAAY", "names": ["GetInternalRecordsForJiraTicket", "type", "CreateInternalRecordForJiraTicket", "constructor", "jiraIssue", "UpdateInternalRecordForJiraTicket", "jiraKey", "RemoveInternalRecordForJiraTicket", "JiraManagementService", "constructor", "http", "config", "_jiraApiUrl", "get", "_serviceDeskId", "_commonRequestTypeId", "_deleteAccountRequestTypeId", "_userProfileIdCustomField", "getCustomer", "email", "createCustomer", "displayName", "newCustomer", "post", "uploadAttachments", "files", "uploadCallback", "formData", "FormData", "forEach", "f", "append", "headers", "HttpHeaders", "reportProgress", "observe", "pipe", "uploadProgress", "getRequest", "jiraKey", "createRequest", "jiraAccountId", "payload", "body", "serviceDeskId", "requestTypeId", "raiseOnBehalfOf", "requestFieldValues", "_payloadConverter", "deleteAccountRequest", "createAttachment", "issueKey", "temporaryAttachmentIds", "public", "profileId", "__spreadValues", "\u0275\u0275inject", "HttpClient", "ConfigurationService", "factory", "\u0275fac", "providedIn", "SupportIssuesState", "constructor", "store", "profileService", "jiraService", "error", "state", "loading", "data", "getInternalRecords", "ctx", "patchState", "getPartnerDataByName", "pipe", "catchError", "console", "EMPTY", "map", "partnerData", "additionalProperty", "rawIssues", "issue", "stringifiedPropValueToPropValue", "tap", "issues", "hasValue", "length", "createInternalRecord", "jiraIssue", "partnerDataName", "status", "createPartnerData", "name", "err", "concatMap", "propValue", "jiraIssueToPropertyValue", "unshift", "updatePartnerData", "i", "updateInternalRecord", "jiraKey", "getRequest", "dispatch", "RemoveInternalRecordForJiraTicket", "switchMap", "updatePartnerDataByName", "removeInternalRecord", "removePartnerDataByNameAndId", "\u0275\u0275inject", "Store", "ProfileService", "JiraManagementService", "factory", "\u0275fac", "__decorate", "Action", "GetInternalRecordsForJiraTicket", "CreateInternalRecordForJiraTicket", "UpdateInternalRecordForJiraTicket", "Selector", "State", "defaults", "jiraIssueToPropertyValue", "issue", "propValue", "propertyId", "issueKey", "summary", "requestFieldValues", "filter", "i", "fieldId", "value", "tempValue", "issueId", "status", "currentStatus", "createdDate", "iso8601", "JSON", "stringify", "stringifiedPropValueToPropValue", "strValue", "parse", "error", "console", "__spreadProps", "__spreadValues", "SupportState", "constructor", "store", "profileService", "jiraService", "model", "state", "supportForm", "loading", "supportIssue", "goToSupportForm", "ctx", "__async", "patchState", "hasValue", "profile", "firstValueFrom", "dispatch", "GetProfile", "UpdateFormValue", "path", "value", "email", "data", "propertyPath", "sendRequest", "form", "getState", "summary", "title", "description", "attachments", "attachment", "getCustomer", "pipe", "tap", "mergeMap", "result", "accountId", "size", "values", "of", "getProfile", "concatMap", "createCustomer", "displayName", "map", "newCustomer", "catchError", "console", "error", "EMPTY", "profileId", "selectSnapshot", "ProfileState", "createRequest", "issue", "CreateInternalRecordForJiraTicket", "attachmentIds", "a", "temporaryAttachments", "temporaryAttachmentId", "flat", "length", "createAttachment", "issueKey", "switchMap", "InitiateDeletionAccountRequest", "initiateDeletionProfile", "CancelDeletionAccountRequest", "cancelDeletionProfile", "ConfirmDeletionAccountRequest", "confirmDeletionProfile", "\u0275\u0275inject", "Store", "ProfileService", "JiraManagementService", "factory", "\u0275fac", "__decorate", "Action", "GoToSupportForm", "SendRequest", "Selector", "State", "name", "defaults"] }