async getDocuments()

in src/lib/salesforceAuthenticator.ts [98:113]


	async getDocuments(folderId: Folder) {
		const response = await this.get(
			`/services/data/v54.0/query?q=SELECT Id, Name FROM Document WHERE FolderId= '${folderId.folderId}'`,
		);
		if (response == null) {
			throw new Error(
				`Failed to parse salesforce attempt when listing folder ${folderId.name} (${folderId.folderId}) contents.`,
			);
		}
		const j = JSON.parse(response);
		console.log(j);
		if (j == null || j.records == null) {
			throw new Error('No records received from Salesforce');
		}
		return j.records; // Todo: make this return an [document]
	}