@anzusystems/common-admin 0.0.6 → 0.0.7
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/dist/common-admin.es.js +2157 -1906
- package/dist/common-admin.es.js.map +1 -1
- package/dist/common-admin.umd.js +6 -6
- package/dist/common-admin.umd.js.map +1 -1
- package/dist/components/job/JobStatusChip.vue.d.ts +17 -0
- package/dist/lib.d.ts +14 -1
- package/dist/model/valueObject/JobResource.d.ts +11 -0
- package/dist/model/valueObject/JobStatus.d.ts +18 -0
- package/dist/services/api/job/jobApi.d.ts +11 -0
- package/dist/types/Job.d.ts +16 -0
- package/dist/utils/string.d.ts +3 -0
- package/package.json +1 -1
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { JobStatus } from '../../model/valueObject/JobStatus';
|
|
2
|
+
declare const _sfc_main: import("vue").DefineComponent<{
|
|
3
|
+
value: {
|
|
4
|
+
type: null;
|
|
5
|
+
required: true;
|
|
6
|
+
};
|
|
7
|
+
}, {
|
|
8
|
+
props: any;
|
|
9
|
+
getJobStatusOption: (value: JobStatus) => import("../../lib").ValueObjectOption<JobStatus>;
|
|
10
|
+
option: import("vue").ComputedRef<import("../../lib").ValueObjectOption<JobStatus>>;
|
|
11
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
12
|
+
value: {
|
|
13
|
+
type: null;
|
|
14
|
+
required: true;
|
|
15
|
+
};
|
|
16
|
+
}>>, {}>;
|
|
17
|
+
export default _sfc_main;
|
package/dist/lib.d.ts
CHANGED
|
@@ -18,10 +18,11 @@ import AValueObjectOptionsSelect from './components/form/AValueObjectOptionsSele
|
|
|
18
18
|
import AFilterValueObjectOptionsSelect from './components/filter/AFilterValueObjectOptionsSelect.vue';
|
|
19
19
|
import AFilterRemoteAutocomplete from './components/filter/AFilterRemoteAutocomplete.vue';
|
|
20
20
|
import AFilterBooleanGroup from './components/filter/AFilterBooleanGroup.vue';
|
|
21
|
+
import JobStatusChip from './components/job/JobStatusChip.vue';
|
|
21
22
|
import { commonMessages } from './locales';
|
|
22
23
|
import { deepFreeze, deletePropertyByPath, getValueByPath, setValueByPath, simpleCloneObject } from './utils/object';
|
|
23
24
|
import { isArray, isBoolean, isDocId, isEmpty, isEmptyArray, isEmptyObject, isInt, isNotUndefined, isNull, isNumber, isObject, isString, isUndefined } from './utils/common';
|
|
24
|
-
import { normalizeForSlotName, slugify, splitOnFirstOccurrence, toFloat, toInt, trimLength } from './utils/string';
|
|
25
|
+
import { normalizeForSlotName, slugify, splitOnFirstOccurrence, toFloat, toInt, toKebabCase, trimLength } from './utils/string';
|
|
25
26
|
import { currentTimestamp, DATETIME_MAX, DATETIME_MIN, dateTimeEndOfDay, dateTimeNow, dateTimeStartOfDay, dateToUtc, friendlyDateTime, modifyMinutesOfDate, newDateNow, prettyDateTime, yearNow } from './utils/datetime';
|
|
26
27
|
import { Grant, useGrant } from './model/valueObject/Grant';
|
|
27
28
|
import { GrantOrigin, useGrantOrigin } from './model/valueObject/GrantOrigin';
|
|
@@ -61,6 +62,10 @@ import { useAlerts } from './composables/system/alerts';
|
|
|
61
62
|
import { useErrorHandler } from './composables/system/error';
|
|
62
63
|
import { useTableColumns } from './composables/system/tableColumns';
|
|
63
64
|
import { createCommonAdmin } from './create';
|
|
65
|
+
import { JobStatus, useJobStatus } from './model/valueObject/JobStatus';
|
|
66
|
+
import type { Job } from './types/Job';
|
|
67
|
+
import { useJobApi } from './services/api/job/jobApi';
|
|
68
|
+
import { type JobResource, useJobResource } from './model/valueObject/JobResource';
|
|
64
69
|
export { // | | | | |
|
|
65
70
|
ACard, // | | | | |
|
|
66
71
|
ARow, // | | | | |
|
|
@@ -82,6 +87,7 @@ AFilterBooleanGroup, // | | | | |
|
|
|
82
87
|
ADatetime, // | | | | |
|
|
83
88
|
ADatatable, // | | | | |
|
|
84
89
|
ADatatablePagination, // | | | | |
|
|
90
|
+
JobStatusChip, // | | | | |
|
|
85
91
|
usePagination, usePaginationAutoHide, // | | | | |
|
|
86
92
|
makeFilterHelper, useFilterHelpers, // | | | | |
|
|
87
93
|
useAlerts, // | | | | |
|
|
@@ -112,6 +118,9 @@ PermissionGroup, // | | | | |
|
|
|
112
118
|
PermissionGroupMinimal, // | | | | |
|
|
113
119
|
VuetifyIconValue, // | | | | |
|
|
114
120
|
MakeFilterOptions, // | | | | |
|
|
121
|
+
Job, // | | | | |
|
|
122
|
+
JobStatus, // | | | | |
|
|
123
|
+
JobResource, // | | | | |
|
|
115
124
|
useAnzuUserFactory, // | | | | |
|
|
116
125
|
usePermissionConfigFactory, // | | | | |
|
|
117
126
|
usePermissionGroupFactory, // | | | | |
|
|
@@ -139,6 +148,7 @@ toFloat, // | | | | |
|
|
|
139
148
|
splitOnFirstOccurrence, // | | | | |
|
|
140
149
|
trimLength, // | | | | |
|
|
141
150
|
normalizeForSlotName, // | | | | |
|
|
151
|
+
toKebabCase, // | | | | |
|
|
142
152
|
currentTimestamp, // | | | | |
|
|
143
153
|
DATETIME_MAX, // | | | | |
|
|
144
154
|
DATETIME_MIN, // | | | | |
|
|
@@ -161,6 +171,9 @@ apiFetchList, // | | | | |
|
|
|
161
171
|
apiFetchOne, // | | | | |
|
|
162
172
|
apiUpdateOne, // | | | | |
|
|
163
173
|
useQueryBuilder, // | | | | |
|
|
174
|
+
useJobApi, // | | | | |
|
|
175
|
+
useJobResource, // | | | | |
|
|
176
|
+
useJobStatus, // | | | | |
|
|
164
177
|
commonMessages, // | | | | |
|
|
165
178
|
SystemScopeSymbol, SubjectScopeSymbol, // | | | | |
|
|
166
179
|
HTTP_STATUS_OK, // | | | | |
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ValueObjectOption } from '../../types/ValueObject';
|
|
2
|
+
export type JobResource = 'jobUserDataDelete' | `job${string}`;
|
|
3
|
+
export declare function useJobResource<T extends JobResource = JobResource>(customJobs?: ValueObjectOption<T>[]): {
|
|
4
|
+
jobResourceOptions: import("vue").Ref<{
|
|
5
|
+
value: import("vue").UnwrapRef<T>;
|
|
6
|
+
title: string;
|
|
7
|
+
color?: string | undefined;
|
|
8
|
+
active?: false | undefined;
|
|
9
|
+
}[]>;
|
|
10
|
+
getJobResourceOption: (value: T) => ValueObjectOption<T>;
|
|
11
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { ValueObjectOption } from '../../types/ValueObject';
|
|
2
|
+
export declare enum JobStatus {
|
|
3
|
+
Waiting = "waiting",
|
|
4
|
+
Processing = "processing",
|
|
5
|
+
AwaitingBatchProcess = "awaiting_batch_process",
|
|
6
|
+
Done = "done",
|
|
7
|
+
Error = "error",
|
|
8
|
+
Default = "waiting"
|
|
9
|
+
}
|
|
10
|
+
export declare function useJobStatus(): {
|
|
11
|
+
jobStatusOptions: import("vue").Ref<{
|
|
12
|
+
value: JobStatus;
|
|
13
|
+
title: string;
|
|
14
|
+
color?: string | undefined;
|
|
15
|
+
active?: false | undefined;
|
|
16
|
+
}[]>;
|
|
17
|
+
getJobStatusOption: (value: JobStatus) => ValueObjectOption<JobStatus>;
|
|
18
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { AxiosInstance } from 'axios';
|
|
2
|
+
import { Pagination } from '../../../types/Pagination';
|
|
3
|
+
import { FilterBag } from '../../../types/Filter';
|
|
4
|
+
import { Job } from '../../../types/Job';
|
|
5
|
+
export declare const ENTITY = "job";
|
|
6
|
+
export declare function useJobApi<JobType extends Job = Job>(client: () => AxiosInstance, system: string): {
|
|
7
|
+
fetchJobList: (pagination: Pagination, filterBag: FilterBag) => Promise<JobType[]>;
|
|
8
|
+
fetchJob: (id: number) => Promise<JobType>;
|
|
9
|
+
createJob: (data: JobType) => Promise<JobType>;
|
|
10
|
+
deleteJob: (id: number) => Promise<JobType>;
|
|
11
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { DatetimeUTCNullable, IntegerId, IntegerIdNullable } from '../types/common';
|
|
2
|
+
import { AnzuUserAndTimeTrackingAware } from '../types/AnzuUserAndTimeTrackingAware';
|
|
3
|
+
import type { JobResource } from '../model/valueObject/JobResource';
|
|
4
|
+
export interface Job<T extends JobResource = JobResource> extends AnzuUserAndTimeTrackingAware {
|
|
5
|
+
readonly id: IntegerId;
|
|
6
|
+
readonly status: string;
|
|
7
|
+
readonly startedAt: DatetimeUTCNullable;
|
|
8
|
+
readonly finishedAt: DatetimeUTCNullable;
|
|
9
|
+
readonly lastBatchProcessedRecord: string;
|
|
10
|
+
readonly batchProcessedIterationCount: number;
|
|
11
|
+
targetUserId: IntegerIdNullable;
|
|
12
|
+
anonymizeUser: boolean;
|
|
13
|
+
readonly result: string;
|
|
14
|
+
_resourceName: T;
|
|
15
|
+
readonly _system: string;
|
|
16
|
+
}
|
package/dist/utils/string.d.ts
CHANGED
|
@@ -6,6 +6,8 @@ export declare const splitOnFirstOccurrence: (value: string, delimiter?: string)
|
|
|
6
6
|
end: string;
|
|
7
7
|
};
|
|
8
8
|
export declare const slugify: (value: string) => string;
|
|
9
|
+
type Kebab<T extends string, A extends string = ''> = T extends `${infer F}${infer R}` ? Kebab<R, `${A}${F extends Lowercase<F> ? '' : '-'}${Lowercase<F>}`> : A;
|
|
10
|
+
export declare const toKebabCase: <T extends string>(value: T) => Kebab<T, "">;
|
|
9
11
|
export declare const trimLength: (value: string, maxLength?: number) => string;
|
|
10
12
|
/**
|
|
11
13
|
* Converts colon parameters to real values.
|
|
@@ -18,3 +20,4 @@ export declare const urlTemplateReplace: (template: string, params: UrlParams) =
|
|
|
18
20
|
* Slot names with dots are not valid, Vue takes dots as modifiers, so we must replace dots with dash.
|
|
19
21
|
*/
|
|
20
22
|
export declare const normalizeForSlotName: (name: string) => string;
|
|
23
|
+
export {};
|