{"version":3,"sources":["../../src/index.ts","../../src/abacusRoyaltiesClient.ts","../../src/types.ts"],"sourcesContent":["export { AbacusRoyaltiesClient } from \"./abacusRoyaltiesClient\";\n\nexport {\n // Configs\n type AbacusRoyaltiesClientOptions,\n // Requests\n // Responses\n type HelloResponse,\n // Types\n type StatementPeriodAdjustmentFile,\n StatementPeriodAdjustmentFileActionName,\n StatementPeriodAdjustmentFileErrorType,\n type StatementPeriodPaymentEntityState,\n} from \"./types\";\n","import { AbacusClient } from \"@abacus/api-client\";\n\nimport {\n AbacusRoyaltiesClientOptions,\n HelloResponse,\n StatementPeriodAdjustmentFile,\n StatementPeriodPaymentEntityState,\n} from \"./types\";\n\nexport class AbacusRoyaltiesClient {\n static readonly Domain = \"ows-royalties.theorchard.io\";\n\n client: AbacusClient;\n\n constructor(opts: AbacusRoyaltiesClientOptions) {\n this.client =\n opts.client ??\n new AbacusClient({\n domain: opts.domain ?? AbacusRoyaltiesClient.Domain,\n env: opts.env,\n identityId: opts.identityId,\n logger: opts.logger,\n throttler: opts.throttler,\n });\n }\n\n /**\n * Get statement period adjustment file by ID.\n *\n * @param adjustmentFileId - ID of the statement period adjustment file\n * @return - OWS Response\n */\n getStatementPeriodAdjustmentFile(\n adjustmentFileId: number,\n ): Promise {\n return this.client.get(\n `statement-period-adjustment-file/${adjustmentFileId}`,\n );\n }\n\n /**\n * Get statement_period_payment_entity states for the statement_period.\n * @param statementPeriodId ID of the statement_period to apply adjustments\n * @returns OWS Response\n */\n getStatementPeriodPaymentEntityStates(\n statementPeriodId: number,\n ): Promise {\n return this.client.get(\n `/statement-period/${statementPeriodId}/payment-entities/states`,\n );\n }\n\n hello(): Promise {\n return this.client.get(`hello`);\n }\n\n /**\n * Get statement_period_payment_entity states for the statement_period.\n * @param statementPeriodId ID of the statement_period to apply adjustments\n * @returns OWS Response\n */\n updateStatementPeriodAdjustmentFile(\n statementPeriodId: number,\n adjustmentFileId: number,\n data: unknown,\n ): Promise {\n return this.client.put(\n `/statement-period/${statementPeriodId}/adjustment-file/${adjustmentFileId}`,\n data,\n );\n }\n}\n","import { AbacusClient, AbacusClientOptions } from \"@abacus/api-client\";\nimport { AbacusStateActionStatus } from \"@abacus/api-state-client\";\nimport { Optional } from \"@abacus/common\";\n\n// Configs\n\nexport type AbacusRoyaltiesClientOptions =\n | { client: AbacusClient }\n | (Optional & { client?: undefined });\n\n// Requests\n\n// Responses\n\nexport interface HelloResponse {\n status: string;\n}\n\n// Types\n\nexport interface StatementPeriodAdjustmentFile {\n error_type?: StatementPeriodAdjustmentFileErrorType;\n file_name: string;\n invalid_file_location?: string;\n invalid_row_count: number;\n md5sum?: string;\n statement_period_adjustment_file_id: number;\n statement_period_id: number;\n total_file_amount_multicurrency: string;\n total_rounded_amount_multicurrency: string;\n valid_file_location: string;\n valid_row_count: number;\n}\n\nexport enum StatementPeriodAdjustmentFileActionName {\n UploadFile = \"upload_file\",\n}\n\nexport enum StatementPeriodAdjustmentFileErrorType {\n ContentError = \"content_error\",\n FormatError = \"format_error\",\n}\n\nexport interface StatementPeriodPaymentEntityState {\n abacus_state_id: number;\n action_name: string;\n action_status: AbacusStateActionStatus;\n reference_payment_entity_id: number;\n statement_period_id: number;\n statement_period_payment_entity_id: number;\n}\n"],"mappings":"yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,2BAAAE,EAAA,4CAAAC,EAAA,2CAAAC,IAAA,eAAAC,EAAAL,GCAA,IAAAM,EAA6B,8BAShBC,EAAN,MAAMC,CAAsB,CACjC,OAAgB,OAAS,8BAEzB,OAEA,YAAYC,EAAoC,CAC9C,KAAK,OACHA,EAAK,QACL,IAAI,eAAa,CACf,OAAQA,EAAK,QAAUD,EAAsB,OAC7C,IAAKC,EAAK,IACV,WAAYA,EAAK,WACjB,OAAQA,EAAK,OACb,UAAWA,EAAK,SAClB,CAAC,CACL,CAQA,iCACEC,EACwC,CACxC,OAAO,KAAK,OAAO,IACjB,oCAAoCA,CAAgB,EACtD,CACF,CAOA,sCACEC,EAC8C,CAC9C,OAAO,KAAK,OAAO,IACjB,qBAAqBA,CAAiB,0BACxC,CACF,CAEA,OAAgC,CAC9B,OAAO,KAAK,OAAO,IAAI,OAAO,CAChC,CAOA,oCACEA,EACAD,EACAE,EACwC,CACxC,OAAO,KAAK,OAAO,IACjB,qBAAqBD,CAAiB,oBAAoBD,CAAgB,GAC1EE,CACF,CACF,CACF,ECtCO,IAAKC,OACVA,EAAA,WAAa,cADHA,OAAA,IAIAC,OACVA,EAAA,aAAe,gBACfA,EAAA,YAAc,eAFJA,OAAA","names":["index_exports","__export","AbacusRoyaltiesClient","StatementPeriodAdjustmentFileActionName","StatementPeriodAdjustmentFileErrorType","__toCommonJS","import_api_client","AbacusRoyaltiesClient","_AbacusRoyaltiesClient","opts","adjustmentFileId","statementPeriodId","data","StatementPeriodAdjustmentFileActionName","StatementPeriodAdjustmentFileErrorType"]}