orgnote-api 0.11.3 → 0.12.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.
- package/encryption/note-encryption.ts +4 -2
- package/package.json +1 -1
- package/remote-api/api.ts +62 -0
|
@@ -88,13 +88,15 @@ export async function decryptNote<T extends AbstractEncryptedNote>(
|
|
|
88
88
|
note: T,
|
|
89
89
|
encryptionParams: OrgNoteEncryption
|
|
90
90
|
): Promise<T> {
|
|
91
|
+
const isContentEncrypted = isGpgEncrypted(note.content);
|
|
91
92
|
if (
|
|
92
93
|
note.meta.published ||
|
|
93
94
|
!note.encryptionType ||
|
|
94
95
|
!encryptionParams.type ||
|
|
95
|
-
encryptionParams.type === ModelsPublicNoteEncryptionTypeEnum.Disabled
|
|
96
|
+
encryptionParams.type === ModelsPublicNoteEncryptionTypeEnum.Disabled ||
|
|
97
|
+
!isContentEncrypted
|
|
96
98
|
) {
|
|
97
|
-
note.encrypted =
|
|
99
|
+
note.encrypted = isContentEncrypted;
|
|
98
100
|
return note;
|
|
99
101
|
}
|
|
100
102
|
note.encrypted = true;
|
package/package.json
CHANGED
package/remote-api/api.ts
CHANGED
|
@@ -1526,6 +1526,36 @@ export class FilesApi extends BaseAPI {
|
|
|
1526
1526
|
*/
|
|
1527
1527
|
export const NotesApiAxiosParamCreator = function (configuration?: Configuration) {
|
|
1528
1528
|
return {
|
|
1529
|
+
/**
|
|
1530
|
+
* Force delete all user notes. This operation is irreversible
|
|
1531
|
+
* @summary Drop all user notes
|
|
1532
|
+
* @param {*} [options] Override http request option.
|
|
1533
|
+
* @throws {RequiredError}
|
|
1534
|
+
*/
|
|
1535
|
+
allNotesDelete: async (options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
|
|
1536
|
+
const localVarPath = `/all-notes`;
|
|
1537
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
1538
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
1539
|
+
let baseOptions;
|
|
1540
|
+
if (configuration) {
|
|
1541
|
+
baseOptions = configuration.baseOptions;
|
|
1542
|
+
}
|
|
1543
|
+
|
|
1544
|
+
const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options};
|
|
1545
|
+
const localVarHeaderParameter = {} as any;
|
|
1546
|
+
const localVarQueryParameter = {} as any;
|
|
1547
|
+
|
|
1548
|
+
|
|
1549
|
+
|
|
1550
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
1551
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
1552
|
+
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
|
1553
|
+
|
|
1554
|
+
return {
|
|
1555
|
+
url: toPathString(localVarUrlObj),
|
|
1556
|
+
options: localVarRequestOptions,
|
|
1557
|
+
};
|
|
1558
|
+
},
|
|
1529
1559
|
/**
|
|
1530
1560
|
* Bulk update or insert notes
|
|
1531
1561
|
* @summary Upsert notes
|
|
@@ -1779,6 +1809,18 @@ export const NotesApiAxiosParamCreator = function (configuration?: Configuration
|
|
|
1779
1809
|
export const NotesApiFp = function(configuration?: Configuration) {
|
|
1780
1810
|
const localVarAxiosParamCreator = NotesApiAxiosParamCreator(configuration)
|
|
1781
1811
|
return {
|
|
1812
|
+
/**
|
|
1813
|
+
* Force delete all user notes. This operation is irreversible
|
|
1814
|
+
* @summary Drop all user notes
|
|
1815
|
+
* @param {*} [options] Override http request option.
|
|
1816
|
+
* @throws {RequiredError}
|
|
1817
|
+
*/
|
|
1818
|
+
async allNotesDelete(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
|
|
1819
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.allNotesDelete(options);
|
|
1820
|
+
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
1821
|
+
const localVarOperationServerBasePath = operationServerMap['NotesApi.allNotesDelete']?.[localVarOperationServerIndex]?.url;
|
|
1822
|
+
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
1823
|
+
},
|
|
1782
1824
|
/**
|
|
1783
1825
|
* Bulk update or insert notes
|
|
1784
1826
|
* @summary Upsert notes
|
|
@@ -1873,6 +1915,15 @@ export const NotesApiFp = function(configuration?: Configuration) {
|
|
|
1873
1915
|
export const NotesApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
|
|
1874
1916
|
const localVarFp = NotesApiFp(configuration)
|
|
1875
1917
|
return {
|
|
1918
|
+
/**
|
|
1919
|
+
* Force delete all user notes. This operation is irreversible
|
|
1920
|
+
* @summary Drop all user notes
|
|
1921
|
+
* @param {*} [options] Override http request option.
|
|
1922
|
+
* @throws {RequiredError}
|
|
1923
|
+
*/
|
|
1924
|
+
allNotesDelete(options?: any): AxiosPromise<void> {
|
|
1925
|
+
return localVarFp.allNotesDelete(options).then((request) => request(axios, basePath));
|
|
1926
|
+
},
|
|
1876
1927
|
/**
|
|
1877
1928
|
* Bulk update or insert notes
|
|
1878
1929
|
* @summary Upsert notes
|
|
@@ -1949,6 +2000,17 @@ export const NotesApiFactory = function (configuration?: Configuration, basePath
|
|
|
1949
2000
|
* @extends {BaseAPI}
|
|
1950
2001
|
*/
|
|
1951
2002
|
export class NotesApi extends BaseAPI {
|
|
2003
|
+
/**
|
|
2004
|
+
* Force delete all user notes. This operation is irreversible
|
|
2005
|
+
* @summary Drop all user notes
|
|
2006
|
+
* @param {*} [options] Override http request option.
|
|
2007
|
+
* @throws {RequiredError}
|
|
2008
|
+
* @memberof NotesApi
|
|
2009
|
+
*/
|
|
2010
|
+
public allNotesDelete(options?: RawAxiosRequestConfig) {
|
|
2011
|
+
return NotesApiFp(this.configuration).allNotesDelete(options).then((request) => request(this.axios, this.basePath));
|
|
2012
|
+
}
|
|
2013
|
+
|
|
1952
2014
|
/**
|
|
1953
2015
|
* Bulk update or insert notes
|
|
1954
2016
|
* @summary Upsert notes
|