@uwrl/qc-utils 0.0.23 → 0.1.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/README.md +242 -35
- package/dist/index.d.ts +0 -1
- package/dist/index.js +1749 -2132
- package/dist/index.umd.cjs +15 -15
- package/dist/types/index.d.ts +95 -15
- package/dist/utils/plotting/script.d.ts +8 -5
- package/package.json +1 -1
- package/dist/services/__tests__/createPatchObject.spec.d.ts +0 -1
- package/dist/services/__tests__/requestInterceptor.spec.d.ts +0 -1
- package/dist/services/__tests__/responseInterceptor.spec.d.ts +0 -1
- package/dist/services/api.d.ts +0 -147
- package/dist/services/apiMethods.d.ts +0 -8
- package/dist/services/createPatchObject.d.ts +0 -17
- package/dist/services/getCSRFToken.d.ts +0 -1
- package/dist/services/index.d.ts +0 -6
- package/dist/services/requestInterceptor.d.ts +0 -12
- package/dist/services/responseInterceptor.d.ts +0 -2
package/dist/services/api.d.ts
DELETED
|
@@ -1,147 +0,0 @@
|
|
|
1
|
-
import { Unit, Thing, Sensor, ResultQualifier, ProcessingLevel, ObservedProperty, Datastream, Tag, PostHydroShareArchive, HydroShareArchive, User, Workspace, ApiKey } from '@/types';
|
|
2
|
-
import { DataSource } from '@/models';
|
|
3
|
-
import { OrchestrationSystem } from '@/models/dataSource';
|
|
4
|
-
export declare const BASE_URL: string;
|
|
5
|
-
export declare const AUTH_BASE: string;
|
|
6
|
-
export declare const ACCOUNT_BASE: string;
|
|
7
|
-
export declare const SESSION_BASE: string;
|
|
8
|
-
export declare const PROVIDER_BASE: string;
|
|
9
|
-
export declare const THINGS_BASE: string;
|
|
10
|
-
export declare const TAG_BASE: string;
|
|
11
|
-
type DatastreamFilterKey = 'unit_id' | 'sensor_id' | 'observed_property_id' | 'processing_level_id' | 'result_qualifier_id';
|
|
12
|
-
export declare const getObservationsEndpoint: (id: string, pageSize: number, startTime: string, endTime?: string, page?: number) => string;
|
|
13
|
-
export declare const api: {
|
|
14
|
-
fetchSession: () => Promise<any>;
|
|
15
|
-
login: (email: string, password: string) => Promise<any>;
|
|
16
|
-
logout: () => Promise<any>;
|
|
17
|
-
fetchUser: () => Promise<any>;
|
|
18
|
-
signup: (user: User) => Promise<any>;
|
|
19
|
-
updateUser: (user: User, oldUser: User) => Promise<any>;
|
|
20
|
-
deleteUser: () => Promise<any>;
|
|
21
|
-
sendVerificationEmail: (email: string) => Promise<any>;
|
|
22
|
-
verifyEmailWithCode: (key: string) => Promise<any>;
|
|
23
|
-
requestPasswordReset: (email: string) => Promise<any>;
|
|
24
|
-
resetPassword: (key: string, password: string) => Promise<any>;
|
|
25
|
-
fetchWorkspaces: () => Promise<any>;
|
|
26
|
-
fetchAssociatedWorkspaces: () => Promise<any>;
|
|
27
|
-
fetchWorkspace: (id: string) => Promise<any>;
|
|
28
|
-
createWorkspace: (postWorkspace: Workspace) => Promise<any>;
|
|
29
|
-
updateWorkspace: (newWorkspace: Workspace, oldWorkspace?: Workspace | null) => Promise<any>;
|
|
30
|
-
deleteWorkspace: (id: string) => Promise<any>;
|
|
31
|
-
transferWorkspace: (id: string, newOwner: string) => Promise<any>;
|
|
32
|
-
acceptWorkspaceTransfer: (id: string) => Promise<any>;
|
|
33
|
-
rejectWorkspaceTransfer: (id: string) => Promise<any>;
|
|
34
|
-
getCollaboratorRoles: (id: string) => Promise<any>;
|
|
35
|
-
getAPIKeyRoles: (id: string) => Promise<any>;
|
|
36
|
-
getRole: (roleId: string) => Promise<any>;
|
|
37
|
-
getCollaborators: (id: string) => Promise<any>;
|
|
38
|
-
addCollaborator: (id: string, email: string, roleId: string) => Promise<any>;
|
|
39
|
-
updateCollaboratorRole: (id: string, email: string, roleId: string) => Promise<any>;
|
|
40
|
-
removeCollaborator: (id: string, email: string) => Promise<any>;
|
|
41
|
-
fetchApiKeys: (workspaceId: string) => Promise<any>;
|
|
42
|
-
fetchApiKey: (workspaceId: string, apiKeyId: string) => Promise<any>;
|
|
43
|
-
createApiKey: (apiKey: ApiKey) => Promise<any>;
|
|
44
|
-
updateApiKey: (newKey: ApiKey, oldKey?: ApiKey) => Promise<any>;
|
|
45
|
-
regenerateApiKey: (id: string, apiKeyId: string) => Promise<any>;
|
|
46
|
-
deleteApiKey: (id: string, apiKeyId: string) => Promise<any>;
|
|
47
|
-
fetchConnectedProviders: () => Promise<any>;
|
|
48
|
-
providerRedirect: (provider: string, callbackUrl: string, process: string) => void;
|
|
49
|
-
providerSignup: (user: User) => Promise<any>;
|
|
50
|
-
deleteProvider: (provider: string, account: string) => Promise<any>;
|
|
51
|
-
createUnit: (unit: Unit) => Promise<any>;
|
|
52
|
-
fetchUnits: () => Promise<any>;
|
|
53
|
-
fetchWorkspaceUnits: (id: string) => Promise<any>;
|
|
54
|
-
updateUnit: (newUnit: Unit, oldUnit?: Unit | null) => Promise<any>;
|
|
55
|
-
deleteUnit: (id: string) => Promise<any>;
|
|
56
|
-
getUnit: (id: string) => Promise<any>;
|
|
57
|
-
removeThingOwner: (id: string, email: string) => Promise<any>;
|
|
58
|
-
addSecondaryOwner: (id: string, email: string) => Promise<any>;
|
|
59
|
-
transferPrimaryOwnership: (id: string, email: string) => Promise<any>;
|
|
60
|
-
createThing: (thing: Thing) => Promise<any>;
|
|
61
|
-
fetchThings: () => Promise<any>;
|
|
62
|
-
fetchThingsForWorkspace: (id: string) => Promise<any>;
|
|
63
|
-
fetchOwnedThings: () => Promise<any>;
|
|
64
|
-
fetchThing: (id: string) => Promise<any>;
|
|
65
|
-
updateThing: (thing: Thing) => Promise<any>;
|
|
66
|
-
updateThingPrivacy: (id: string, isPrivate: boolean) => Promise<any>;
|
|
67
|
-
deleteThing: (id: string) => Promise<any>;
|
|
68
|
-
fetchMetadataForThingOwner: (thingId: string) => Promise<any>;
|
|
69
|
-
fetchMetadataForThing: (thingId: string) => Promise<any>;
|
|
70
|
-
uploadSitePhotos: (thingId: string, data: FormData) => Promise<any>;
|
|
71
|
-
fetchSitePhotos: (thingId: string) => Promise<any>;
|
|
72
|
-
deleteSitePhoto: (thingId: string, name: string) => Promise<any>;
|
|
73
|
-
createSiteTag: (thingId: string, tag: Tag) => Promise<any>;
|
|
74
|
-
editSiteTag: (thingId: string, tag: Tag) => Promise<any>;
|
|
75
|
-
fetchSiteTags: (thingId: string) => Promise<any>;
|
|
76
|
-
fetchUsersSiteTags: () => Promise<any>;
|
|
77
|
-
deleteSiteTag: (thingId: string, tag: Tag) => Promise<any>;
|
|
78
|
-
fetchWorkspaceTags: (workspaceId: string) => Promise<any>;
|
|
79
|
-
createHydroShareArchive: (archive: PostHydroShareArchive) => Promise<any>;
|
|
80
|
-
updateHydroShareArchive: (newArchive: HydroShareArchive, oldArchive?: HydroShareArchive) => Promise<any>;
|
|
81
|
-
fetchHydroShareArchive: (thingId: string) => Promise<any>;
|
|
82
|
-
deleteHydroShareArchive: (thingId: string) => Promise<any>;
|
|
83
|
-
archiveToHydroShare: (thingId: string) => Promise<any>;
|
|
84
|
-
createDatastream: (datastream: Datastream) => Promise<any>;
|
|
85
|
-
fetchDatastreams: (filters?: Partial<Record<DatastreamFilterKey, string>>) => Promise<any>;
|
|
86
|
-
fetchDatastreamsForThing: (thingId: string) => Promise<any>;
|
|
87
|
-
fetchExpandedDatastreamsForThing: (thingId: string) => Promise<any>;
|
|
88
|
-
fetchDatastreamsForDataSource: (id: string) => Promise<any>;
|
|
89
|
-
fetchDatastream: (id: string) => Promise<any>;
|
|
90
|
-
fetchDatastreamExpanded: (id: string) => Promise<any>;
|
|
91
|
-
fetchUsersDatastreams: () => Promise<any>;
|
|
92
|
-
updateDatastream: (newDS: Datastream, oldDS?: Datastream | null) => Promise<any>;
|
|
93
|
-
deleteDatastream: (id: string) => Promise<any>;
|
|
94
|
-
downloadDatastreamCSV: (id: string) => Promise<any>;
|
|
95
|
-
createObservedProperty: (op: ObservedProperty) => Promise<any>;
|
|
96
|
-
fetchObservedProperty: (id: string) => Promise<any>;
|
|
97
|
-
fetchObservedProperties: () => Promise<any>;
|
|
98
|
-
fetchWorkspaceObservedProperties: (id: string) => Promise<any>;
|
|
99
|
-
updateObservedProperty: (newOP: ObservedProperty, oldOP?: ObservedProperty | null) => Promise<any>;
|
|
100
|
-
deleteObservedProperty: (id: string) => Promise<any>;
|
|
101
|
-
createProcessingLevel: (pl: ProcessingLevel) => Promise<any>;
|
|
102
|
-
fetchProcessingLevels: () => Promise<any>;
|
|
103
|
-
fetchProcessingLevel: (id: string) => Promise<any>;
|
|
104
|
-
fetchWorkspaceProcessingLevels: (id: string) => Promise<any>;
|
|
105
|
-
updateProcessingLevel: (newPL: ProcessingLevel, oldPL?: ProcessingLevel | null) => Promise<any>;
|
|
106
|
-
deleteProcessingLevel: (id: string) => Promise<any>;
|
|
107
|
-
createSensor: (sensor: Sensor) => Promise<any>;
|
|
108
|
-
fetchSensors: () => Promise<any>;
|
|
109
|
-
fetchSensor: (id: string) => Promise<any>;
|
|
110
|
-
fetchWorkspaceSensors: (id: string) => Promise<any>;
|
|
111
|
-
updateSensor: (newSensor: Sensor, oldSensor?: Sensor | null) => Promise<any>;
|
|
112
|
-
deleteSensor: (id: string) => Promise<any>;
|
|
113
|
-
createResultQualifier: (resultQualifier: ResultQualifier) => Promise<any>;
|
|
114
|
-
fetchResultQualifiers: () => Promise<any>;
|
|
115
|
-
fetchWorkspaceResultQualifiers: (id: string) => Promise<any>;
|
|
116
|
-
updateResultQualifier: (newResultQualifier: ResultQualifier, oldResultQualifier?: ResultQualifier | null) => Promise<any>;
|
|
117
|
-
deleteResultQualifier: (id: string) => Promise<any>;
|
|
118
|
-
createOrchestrationSystem: (system: OrchestrationSystem) => Promise<any>;
|
|
119
|
-
fetchOrchestrationSystems: () => Promise<any>;
|
|
120
|
-
fetchWorkspaceOrchestrationSystems: (id: string) => Promise<any>;
|
|
121
|
-
fetchOrchestrationSystem: (id: string) => Promise<any>;
|
|
122
|
-
updateOrchestrationSystem: (id: string, system: OrchestrationSystem) => Promise<any>;
|
|
123
|
-
deleteOrchestrationSystem: (id: string) => Promise<any>;
|
|
124
|
-
createDataSource: (dataSource: DataSource) => Promise<any>;
|
|
125
|
-
fetchDataSources: () => Promise<any>;
|
|
126
|
-
fetchWorkspaceDataSources: (id: string) => Promise<any>;
|
|
127
|
-
fetchDataSource: (id: string) => Promise<any>;
|
|
128
|
-
updateDataSource: (newS: DataSource) => Promise<any>;
|
|
129
|
-
updateDataSourcePartial: (newS: DataSource) => Promise<any>;
|
|
130
|
-
deleteDataSource: (id: string) => Promise<any>;
|
|
131
|
-
linkDatastreamToDataSource: (dataSourceId: string, datastreamId: string) => Promise<any>;
|
|
132
|
-
unlinkDatastreamFromDataSource: (dataSourceId: string, datastreamId: string) => Promise<any>;
|
|
133
|
-
fetchObservations: (endpoint: string) => Promise<any>;
|
|
134
|
-
deleteObservationsForDatastream: (datastreamId: string) => Promise<any>;
|
|
135
|
-
fetchUserTypes: () => Promise<any>;
|
|
136
|
-
fetchOrganizationTypes: () => Promise<any>;
|
|
137
|
-
fetchSiteTypes: () => Promise<any>;
|
|
138
|
-
fetchSamplingFeatureTypes: () => Promise<any>;
|
|
139
|
-
fetchSensorEncodingTypes: () => Promise<any>;
|
|
140
|
-
fetchMethodTypes: () => Promise<any>;
|
|
141
|
-
fetchVariableTypes: () => Promise<any>;
|
|
142
|
-
fetchUnitTypes: () => Promise<any>;
|
|
143
|
-
fetchDatastreamStatuses: () => Promise<any>;
|
|
144
|
-
fetchDatastreamAggregations: () => Promise<any>;
|
|
145
|
-
fetchSampledMediums: () => Promise<any>;
|
|
146
|
-
};
|
|
147
|
-
export {};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export declare const apiMethods: {
|
|
2
|
-
fetch(endpoint: string, options?: any): Promise<any>;
|
|
3
|
-
patch(endpoint: string, body: any, originalBody?: any, options?: any): Promise<any>;
|
|
4
|
-
post(endpoint: string, body?: any, options?: any): Promise<any>;
|
|
5
|
-
put(endpoint: string, body?: any, options?: any): Promise<any>;
|
|
6
|
-
delete(endpoint: string, body?: any, options?: any): Promise<any>;
|
|
7
|
-
paginatedFetch<T>(base: string, pageSize?: number): Promise<any>;
|
|
8
|
-
};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Creates an object that represents the differences (patches) between the
|
|
3
|
-
* original and the updated objects.
|
|
4
|
-
*
|
|
5
|
-
* This function iterates through the properties of the updated object and compares each property
|
|
6
|
-
* with the corresponding property in the original object. If a difference is found:
|
|
7
|
-
* 1. For properties that are objects, it recursively computes the nested differences.
|
|
8
|
-
* 2. For other properties, it directly assigns the updated value.
|
|
9
|
-
*
|
|
10
|
-
* Note: The function only checks properties that exist in the updated object.
|
|
11
|
-
*
|
|
12
|
-
* @param {any} original - The original object to compare from.
|
|
13
|
-
* @param {any} updated - The updated object to compare against.
|
|
14
|
-
* @returns {any} An object representing the differences between the two input objects.
|
|
15
|
-
* If two properties are identical, they won't appear in the result.
|
|
16
|
-
*/
|
|
17
|
-
export declare function createPatchObject(original: any, updated: any): any;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function getCSRFToken(): string | null;
|
package/dist/services/index.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Intercepts and enhances a request options object.
|
|
3
|
-
*
|
|
4
|
-
* - Adds Django AllAuth 'sessionid' to all requests
|
|
5
|
-
* - Adds CSRF Token to non-GET requests
|
|
6
|
-
* - If a body is present and it's an object, the body is stringified.
|
|
7
|
-
*
|
|
8
|
-
* @param {any} options - The original request options object.
|
|
9
|
-
*
|
|
10
|
-
* @returns {any} The enhanced request options with possible modified headers and body.
|
|
11
|
-
*/
|
|
12
|
-
export declare function requestInterceptor(options: any): any;
|