@punks/backend-entity-manager 0.0.321 → 0.0.323
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/cjs/index.js +92 -74
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/platforms/nest/__test__/server/database/core/entities.d.ts +2 -1
- package/dist/cjs/types/platforms/nest/__test__/server/database/core/index.d.ts +3 -100
- package/dist/cjs/types/platforms/nest/pipelines/template/utils.d.ts +3 -0
- package/dist/cjs/types/settings/index.d.ts +2 -1
- package/dist/cjs/types/types/pipelines.d.ts +8 -0
- package/dist/esm/index.js +92 -74
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/platforms/nest/__test__/server/database/core/entities.d.ts +2 -1
- package/dist/esm/types/platforms/nest/__test__/server/database/core/index.d.ts +3 -100
- package/dist/esm/types/platforms/nest/pipelines/template/utils.d.ts +3 -0
- package/dist/esm/types/settings/index.d.ts +2 -1
- package/dist/esm/types/types/pipelines.d.ts +8 -0
- package/dist/index.d.ts +14 -2
- package/package.json +3 -3
|
@@ -21,4 +21,5 @@ import { AppOrganizationalUnitTypeChildEntity } from "./entities/appOrganization
|
|
|
21
21
|
import { AppRoleOrganizationalUnitTypeEntity } from "./entities/appRoleOrganizationalUnitType.entity";
|
|
22
22
|
import { AppCacheEntry } from "./entities/appCacheEntry.entity";
|
|
23
23
|
import { AppApiKeyEntity } from "./entities/appApiKey.entity";
|
|
24
|
-
|
|
24
|
+
import { AppOperationLockItemEntry } from "./entities/appOperationLockItem.entity";
|
|
25
|
+
export declare const CoreDatabaseEntities: (typeof AppDivisionEntity | typeof AppCompanyEntity | typeof AppOrganizationEntity | typeof AppUserProfileEntity | typeof AppRoleEntity | typeof AppUserRoleEntity | typeof AppUserEntity | typeof AppUserGroupEntity | typeof AppUserGroupMemberEntity | typeof AppDirectoryEntity | typeof AppTenantEntity | typeof AppOrganizationalUnitTypeChildEntity | typeof AppOrganizationalUnitTypeEntity | typeof AppRoleOrganizationalUnitTypeEntity | typeof AppOrganizationalUnitEntity | typeof AppApiKeyEntity | typeof AppEmailLogEntity | typeof AppEntityVersionEntity | typeof AppFileReferenceEntity | typeof AppRolePermissionEntity | typeof AppPermissionEntity | typeof FooEntity | typeof AppOperationLockItemEntry | typeof AppCacheEntry)[];
|
|
@@ -1,106 +1,9 @@
|
|
|
1
1
|
import { DataSource } from "typeorm";
|
|
2
|
-
import { FooEntity } from "./entities/foo.entity";
|
|
3
|
-
import { AppCompanyEntity } from "./entities/appCompany.entity";
|
|
4
|
-
import { AppDivisionEntity } from "./entities/appDivision.entity";
|
|
5
|
-
import { AppOrganizationEntity } from "./entities/appOrganization.entity";
|
|
6
|
-
import { AppRoleEntity } from "./entities/appRole.entity";
|
|
7
|
-
import { AppTenantEntity } from "./entities/appTenant.entity";
|
|
8
|
-
import { AppUserEntity } from "./entities/appUser.entity";
|
|
9
|
-
import { AppUserGroupEntity } from "./entities/appUserGroup.entity";
|
|
10
|
-
import { AppUserGroupMemberEntity } from "./entities/appUserGroupMember.entity";
|
|
11
|
-
import { AppUserProfileEntity } from "./entities/appUserProfile.entity";
|
|
12
|
-
import { AppUserRoleEntity } from "./entities/appUserRole.entity";
|
|
13
2
|
import { DynamicModule } from "@nestjs/common";
|
|
14
|
-
|
|
15
|
-
import { AppDirectoryEntity } from "./entities/appDirectory.entity";
|
|
16
|
-
import { CrmContactEntity } from "./entities/crmContact.entity";
|
|
17
|
-
import { AppFileReferenceEntity } from "./entities/appFileReference.entity";
|
|
18
|
-
import { AppEmailLogEntity } from "./entities/appEmailLog.entity";
|
|
19
|
-
import { AppPermissionEntity } from "./entities/appPermission.entity";
|
|
20
|
-
import { AppRolePermissionEntity } from "./entities/appRolePermission.entity";
|
|
21
|
-
import { AppOrganizationalUnitEntity } from "./entities/appOrganizationalUnit.entity";
|
|
22
|
-
import { AppOrganizationalUnitTypeEntity } from "./entities/appOrganizationalUnitType.entity";
|
|
23
|
-
import { AppOrganizationalUnitTypeChildEntity } from "./entities/appOrganizationalUnitTypeChild.entity";
|
|
24
|
-
import { AppRoleOrganizationalUnitTypeEntity } from "./entities/appRoleOrganizationalUnitType.entity";
|
|
25
|
-
import { AppCacheEntry } from "./entities/appCacheEntry.entity";
|
|
26
|
-
import { AppApiKeyEntity } from "./entities/appApiKey.entity";
|
|
27
|
-
import { AppOperationLockItemEntry } from "./entities/appOperationLockItem.entity";
|
|
28
|
-
export declare const mockDatabaseProviders: (dataSource: DataSource) => ({
|
|
3
|
+
export declare const mockDatabaseProviders: (dataSource: DataSource) => {
|
|
29
4
|
provide: string | Function;
|
|
30
|
-
useValue: import("typeorm").Repository<
|
|
31
|
-
}
|
|
32
|
-
provide: string | Function;
|
|
33
|
-
useValue: import("typeorm").Repository<AppCacheEntry>;
|
|
34
|
-
} | {
|
|
35
|
-
provide: string | Function;
|
|
36
|
-
useValue: import("typeorm").Repository<AppCompanyEntity>;
|
|
37
|
-
} | {
|
|
38
|
-
provide: string | Function;
|
|
39
|
-
useValue: import("typeorm").Repository<AppDivisionEntity>;
|
|
40
|
-
} | {
|
|
41
|
-
provide: string | Function;
|
|
42
|
-
useValue: import("typeorm").Repository<AppDirectoryEntity>;
|
|
43
|
-
} | {
|
|
44
|
-
provide: string | Function;
|
|
45
|
-
useValue: import("typeorm").Repository<AppEmailLogEntity>;
|
|
46
|
-
} | {
|
|
47
|
-
provide: string | Function;
|
|
48
|
-
useValue: import("typeorm").Repository<AppEntityVersionEntity>;
|
|
49
|
-
} | {
|
|
50
|
-
provide: string | Function;
|
|
51
|
-
useValue: import("typeorm").Repository<AppFileReferenceEntity>;
|
|
52
|
-
} | {
|
|
53
|
-
provide: string | Function;
|
|
54
|
-
useValue: import("typeorm").Repository<AppOperationLockItemEntry>;
|
|
55
|
-
} | {
|
|
56
|
-
provide: string | Function;
|
|
57
|
-
useValue: import("typeorm").Repository<AppOrganizationEntity>;
|
|
58
|
-
} | {
|
|
59
|
-
provide: string | Function;
|
|
60
|
-
useValue: import("typeorm").Repository<AppOrganizationalUnitEntity>;
|
|
61
|
-
} | {
|
|
62
|
-
provide: string | Function;
|
|
63
|
-
useValue: import("typeorm").Repository<AppOrganizationalUnitTypeEntity>;
|
|
64
|
-
} | {
|
|
65
|
-
provide: string | Function;
|
|
66
|
-
useValue: import("typeorm").Repository<AppOrganizationalUnitTypeChildEntity>;
|
|
67
|
-
} | {
|
|
68
|
-
provide: string | Function;
|
|
69
|
-
useValue: import("typeorm").Repository<AppRoleOrganizationalUnitTypeEntity>;
|
|
70
|
-
} | {
|
|
71
|
-
provide: string | Function;
|
|
72
|
-
useValue: import("typeorm").Repository<AppRoleEntity>;
|
|
73
|
-
} | {
|
|
74
|
-
provide: string | Function;
|
|
75
|
-
useValue: import("typeorm").Repository<AppRolePermissionEntity>;
|
|
76
|
-
} | {
|
|
77
|
-
provide: string | Function;
|
|
78
|
-
useValue: import("typeorm").Repository<AppPermissionEntity>;
|
|
79
|
-
} | {
|
|
80
|
-
provide: string | Function;
|
|
81
|
-
useValue: import("typeorm").Repository<AppTenantEntity>;
|
|
82
|
-
} | {
|
|
83
|
-
provide: string | Function;
|
|
84
|
-
useValue: import("typeorm").Repository<AppUserEntity>;
|
|
85
|
-
} | {
|
|
86
|
-
provide: string | Function;
|
|
87
|
-
useValue: import("typeorm").Repository<AppUserGroupEntity>;
|
|
88
|
-
} | {
|
|
89
|
-
provide: string | Function;
|
|
90
|
-
useValue: import("typeorm").Repository<AppUserGroupMemberEntity>;
|
|
91
|
-
} | {
|
|
92
|
-
provide: string | Function;
|
|
93
|
-
useValue: import("typeorm").Repository<AppUserProfileEntity>;
|
|
94
|
-
} | {
|
|
95
|
-
provide: string | Function;
|
|
96
|
-
useValue: import("typeorm").Repository<AppUserRoleEntity>;
|
|
97
|
-
} | {
|
|
98
|
-
provide: string | Function;
|
|
99
|
-
useValue: import("typeorm").Repository<CrmContactEntity>;
|
|
100
|
-
} | {
|
|
101
|
-
provide: string | Function;
|
|
102
|
-
useValue: import("typeorm").Repository<FooEntity>;
|
|
103
|
-
})[];
|
|
5
|
+
useValue: import("typeorm").Repository<import("./entities/appDivision.entity").AppDivisionEntity>;
|
|
6
|
+
}[];
|
|
104
7
|
export declare class CoreDatabaseModule {
|
|
105
8
|
static forRoot(dataSource: any): DynamicModule;
|
|
106
9
|
}
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { PipelineCompletedStepState } from "../../../../types";
|
|
2
2
|
export declare class PipelineUtils<TPipelineInput, TPipelineOutput, TContext> {
|
|
3
|
+
getStepByKey: (step: PipelineCompletedStepState<TPipelineInput, TContext, unknown, unknown>, key: string) => PipelineCompletedStepState<TPipelineInput, TContext, unknown, unknown>;
|
|
4
|
+
getStepInputByKey: <TStepInput>(step: PipelineCompletedStepState<TPipelineInput, TContext, unknown, unknown>, key: string) => TStepInput;
|
|
5
|
+
getStepOutputByKey: <TStepOutput>(step: PipelineCompletedStepState<TPipelineInput, TContext, unknown, unknown>, key: string) => TStepOutput;
|
|
3
6
|
getStep: (step: PipelineCompletedStepState<TPipelineInput, TContext, unknown, unknown>, index: number) => PipelineCompletedStepState<TPipelineInput, TContext, unknown, unknown>;
|
|
4
7
|
getStepInput: <TStepInput>(step: PipelineCompletedStepState<TPipelineInput, TContext, unknown, unknown>, index: number) => TStepInput;
|
|
5
8
|
getStepOutput: <TStepOutput>(step: PipelineCompletedStepState<TPipelineInput, TContext, unknown, unknown>, index: number) => TStepOutput;
|
|
@@ -1,4 +1,10 @@
|
|
|
1
|
+
export type PipelineStepReference = {
|
|
2
|
+
index: number;
|
|
3
|
+
key?: string;
|
|
4
|
+
name: string;
|
|
5
|
+
};
|
|
1
6
|
export type PipelineStepState<TPipelineInput, TContext, TStepInput> = {
|
|
7
|
+
reference: PipelineStepReference;
|
|
2
8
|
context: TContext;
|
|
3
9
|
stepInput: TStepInput;
|
|
4
10
|
pipelineInput: TPipelineInput;
|
|
@@ -9,6 +15,7 @@ export type PipelineCompletedStepState<TPipelineInput, TContext, TStepInput, TSt
|
|
|
9
15
|
};
|
|
10
16
|
export type PipelineCurrentStepState<TPipelineInput, TContext, TStepInput> = PipelineStepState<TPipelineInput, TContext, TStepInput> & {};
|
|
11
17
|
export type OperationDefinition<TOperationInput, TOperationOutput, TCurrentStepInput, TPipelineInput, TContext> = {
|
|
18
|
+
key?: string;
|
|
12
19
|
name: string;
|
|
13
20
|
action: (input: TOperationInput, state: PipelineCurrentStepState<TPipelineInput, TContext, TCurrentStepInput>) => Promise<TOperationOutput> | TOperationOutput;
|
|
14
21
|
precondition?: (input: TOperationInput, state: PipelineCurrentStepState<TPipelineInput, TContext, TCurrentStepInput>) => Promise<boolean> | boolean;
|
|
@@ -19,6 +26,7 @@ export type RollbackOperationDefinition<TOperationInput, TOperationOutput, TCurr
|
|
|
19
26
|
action: (input: TOperationInput, output: TOperationOutput, state: PipelineCurrentStepState<TPipelineInput, TContext, TCurrentStepInput>) => Promise<void> | void;
|
|
20
27
|
};
|
|
21
28
|
export type PipelineStepOperation<TOperationInput, TOperationOutput, TCurrentStepInput, TPipelineInput, TContext> = {
|
|
29
|
+
key?: string;
|
|
22
30
|
name: string;
|
|
23
31
|
operation: OperationDefinition<TOperationInput, TOperationOutput, TCurrentStepInput, TPipelineInput, TContext>;
|
|
24
32
|
rollbackOperations?: RollbackOperationDefinition<TOperationInput, TOperationOutput, TCurrentStepInput, TPipelineInput, TContext>[];
|
package/dist/esm/index.js
CHANGED
|
@@ -2754,6 +2754,11 @@ class PipelineInstance {
|
|
|
2754
2754
|
}
|
|
2755
2755
|
buildInitialStepState() {
|
|
2756
2756
|
return {
|
|
2757
|
+
reference: {
|
|
2758
|
+
index: 0,
|
|
2759
|
+
key: this.definition.steps[0].operations[0].key,
|
|
2760
|
+
name: this.definition.steps[0].operations[0].name,
|
|
2761
|
+
},
|
|
2757
2762
|
stepInput: this.input,
|
|
2758
2763
|
context: this.context,
|
|
2759
2764
|
pipelineInput: this.input,
|
|
@@ -2761,10 +2766,22 @@ class PipelineInstance {
|
|
|
2761
2766
|
}
|
|
2762
2767
|
buildNextStepState(state, stepResult) {
|
|
2763
2768
|
return {
|
|
2769
|
+
reference: {
|
|
2770
|
+
index: state.reference.index + 1,
|
|
2771
|
+
name: this.definition.steps[state.reference.index + 1]?.operations[0]
|
|
2772
|
+
.name,
|
|
2773
|
+
key: this.definition.steps[state.reference.index + 1]?.operations[0]
|
|
2774
|
+
.key,
|
|
2775
|
+
},
|
|
2764
2776
|
stepInput: getStepOutput(stepResult),
|
|
2765
2777
|
context: this.context,
|
|
2766
2778
|
pipelineInput: this.input,
|
|
2767
2779
|
previousStep: {
|
|
2780
|
+
reference: {
|
|
2781
|
+
index: state.reference.index,
|
|
2782
|
+
key: state.reference.key,
|
|
2783
|
+
name: state.reference.name,
|
|
2784
|
+
},
|
|
2768
2785
|
stepInput: state.stepInput,
|
|
2769
2786
|
stepOutput: getStepOutput(stepResult),
|
|
2770
2787
|
context: this.context,
|
|
@@ -21712,24 +21729,17 @@ MediaLibraryService = __decorate([
|
|
|
21712
21729
|
__metadata("design:paramtypes", [EntityManagerRegistry])
|
|
21713
21730
|
], MediaLibraryService);
|
|
21714
21731
|
|
|
21715
|
-
function _typeof(obj) {
|
|
21716
|
-
"@babel/helpers - typeof";
|
|
21717
|
-
|
|
21718
|
-
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
|
|
21719
|
-
return typeof obj;
|
|
21720
|
-
} : function (obj) {
|
|
21721
|
-
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
21722
|
-
}, _typeof(obj);
|
|
21723
|
-
}
|
|
21724
|
-
|
|
21725
21732
|
function toInteger(dirtyNumber) {
|
|
21726
21733
|
if (dirtyNumber === null || dirtyNumber === true || dirtyNumber === false) {
|
|
21727
21734
|
return NaN;
|
|
21728
21735
|
}
|
|
21736
|
+
|
|
21729
21737
|
var number = Number(dirtyNumber);
|
|
21738
|
+
|
|
21730
21739
|
if (isNaN(number)) {
|
|
21731
21740
|
return number;
|
|
21732
21741
|
}
|
|
21742
|
+
|
|
21733
21743
|
return number < 0 ? Math.ceil(number) : Math.floor(number);
|
|
21734
21744
|
}
|
|
21735
21745
|
|
|
@@ -21769,12 +21779,12 @@ function requiredArgs(required, args) {
|
|
|
21769
21779
|
* const result = toDate(1392098430000)
|
|
21770
21780
|
* //=> Tue Feb 11 2014 11:30:30
|
|
21771
21781
|
*/
|
|
21782
|
+
|
|
21772
21783
|
function toDate(argument) {
|
|
21773
21784
|
requiredArgs(1, arguments);
|
|
21774
|
-
var argStr = Object.prototype.toString.call(argument);
|
|
21785
|
+
var argStr = Object.prototype.toString.call(argument); // Clone the date
|
|
21775
21786
|
|
|
21776
|
-
|
|
21777
|
-
if (argument instanceof Date || _typeof(argument) === 'object' && argStr === '[object Date]') {
|
|
21787
|
+
if (argument instanceof Date || typeof argument === 'object' && argStr === '[object Date]') {
|
|
21778
21788
|
// Prevent the date to lose the milliseconds when passed to new Date() in IE10
|
|
21779
21789
|
return new Date(argument.getTime());
|
|
21780
21790
|
} else if (typeof argument === 'number' || argStr === '[object Number]') {
|
|
@@ -21782,10 +21792,11 @@ function toDate(argument) {
|
|
|
21782
21792
|
} else {
|
|
21783
21793
|
if ((typeof argument === 'string' || argStr === '[object String]') && typeof console !== 'undefined') {
|
|
21784
21794
|
// eslint-disable-next-line no-console
|
|
21785
|
-
console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://
|
|
21786
|
-
|
|
21795
|
+
console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://git.io/fjule"); // eslint-disable-next-line no-console
|
|
21796
|
+
|
|
21787
21797
|
console.warn(new Error().stack);
|
|
21788
21798
|
}
|
|
21799
|
+
|
|
21789
21800
|
return new Date(NaN);
|
|
21790
21801
|
}
|
|
21791
21802
|
}
|
|
@@ -21798,50 +21809,39 @@ function toDate(argument) {
|
|
|
21798
21809
|
* @description
|
|
21799
21810
|
* Add the specified number of days to the given date.
|
|
21800
21811
|
*
|
|
21812
|
+
* ### v2.0.0 breaking changes:
|
|
21813
|
+
*
|
|
21814
|
+
* - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
|
|
21815
|
+
*
|
|
21801
21816
|
* @param {Date|Number} date - the date to be changed
|
|
21802
21817
|
* @param {Number} amount - the amount of days to be added. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.
|
|
21803
|
-
* @returns {Date}
|
|
21804
|
-
* @throws {TypeError}
|
|
21818
|
+
* @returns {Date} the new date with the days added
|
|
21819
|
+
* @throws {TypeError} 2 arguments required
|
|
21805
21820
|
*
|
|
21806
21821
|
* @example
|
|
21807
21822
|
* // Add 10 days to 1 September 2014:
|
|
21808
|
-
*
|
|
21823
|
+
* var result = addDays(new Date(2014, 8, 1), 10)
|
|
21809
21824
|
* //=> Thu Sep 11 2014 00:00:00
|
|
21810
21825
|
*/
|
|
21826
|
+
|
|
21811
21827
|
function addDays(dirtyDate, dirtyAmount) {
|
|
21812
21828
|
requiredArgs(2, arguments);
|
|
21813
21829
|
var date = toDate(dirtyDate);
|
|
21814
21830
|
var amount = toInteger(dirtyAmount);
|
|
21831
|
+
|
|
21815
21832
|
if (isNaN(amount)) {
|
|
21816
21833
|
return new Date(NaN);
|
|
21817
21834
|
}
|
|
21835
|
+
|
|
21818
21836
|
if (!amount) {
|
|
21819
21837
|
// If 0 days, no-op to avoid changing times in the hour before end of DST
|
|
21820
21838
|
return date;
|
|
21821
21839
|
}
|
|
21840
|
+
|
|
21822
21841
|
date.setDate(date.getDate() + amount);
|
|
21823
21842
|
return date;
|
|
21824
21843
|
}
|
|
21825
21844
|
|
|
21826
|
-
/**
|
|
21827
|
-
* Days in 1 week.
|
|
21828
|
-
*
|
|
21829
|
-
* @name daysInWeek
|
|
21830
|
-
* @constant
|
|
21831
|
-
* @type {number}
|
|
21832
|
-
* @default
|
|
21833
|
-
*/
|
|
21834
|
-
|
|
21835
|
-
/**
|
|
21836
|
-
* Milliseconds in 1 minute
|
|
21837
|
-
*
|
|
21838
|
-
* @name millisecondsInMinute
|
|
21839
|
-
* @constant
|
|
21840
|
-
* @type {number}
|
|
21841
|
-
* @default
|
|
21842
|
-
*/
|
|
21843
|
-
var millisecondsInMinute = 60000;
|
|
21844
|
-
|
|
21845
21845
|
/**
|
|
21846
21846
|
* @name differenceInMilliseconds
|
|
21847
21847
|
* @category Millisecond Helpers
|
|
@@ -21850,6 +21850,10 @@ var millisecondsInMinute = 60000;
|
|
|
21850
21850
|
* @description
|
|
21851
21851
|
* Get the number of milliseconds between the given dates.
|
|
21852
21852
|
*
|
|
21853
|
+
* ### v2.0.0 breaking changes:
|
|
21854
|
+
*
|
|
21855
|
+
* - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
|
|
21856
|
+
*
|
|
21853
21857
|
* @param {Date|Number} dateLeft - the later date
|
|
21854
21858
|
* @param {Date|Number} dateRight - the earlier date
|
|
21855
21859
|
* @returns {Number} the number of milliseconds
|
|
@@ -21858,31 +21862,21 @@ var millisecondsInMinute = 60000;
|
|
|
21858
21862
|
* @example
|
|
21859
21863
|
* // How many milliseconds are between
|
|
21860
21864
|
* // 2 July 2014 12:30:20.600 and 2 July 2014 12:30:21.700?
|
|
21861
|
-
*
|
|
21865
|
+
* var result = differenceInMilliseconds(
|
|
21862
21866
|
* new Date(2014, 6, 2, 12, 30, 21, 700),
|
|
21863
21867
|
* new Date(2014, 6, 2, 12, 30, 20, 600)
|
|
21864
21868
|
* )
|
|
21865
21869
|
* //=> 1100
|
|
21866
21870
|
*/
|
|
21867
|
-
function differenceInMilliseconds(dateLeft, dateRight) {
|
|
21868
|
-
requiredArgs(2, arguments);
|
|
21869
|
-
return toDate(dateLeft).getTime() - toDate(dateRight).getTime();
|
|
21870
|
-
}
|
|
21871
|
-
|
|
21872
|
-
var roundingMap = {
|
|
21873
|
-
ceil: Math.ceil,
|
|
21874
|
-
round: Math.round,
|
|
21875
|
-
floor: Math.floor,
|
|
21876
|
-
trunc: function trunc(value) {
|
|
21877
|
-
return value < 0 ? Math.ceil(value) : Math.floor(value);
|
|
21878
|
-
} // Math.trunc is not supported by IE
|
|
21879
|
-
};
|
|
21880
21871
|
|
|
21881
|
-
|
|
21882
|
-
|
|
21883
|
-
|
|
21872
|
+
function differenceInMilliseconds(dirtyDateLeft, dirtyDateRight) {
|
|
21873
|
+
requiredArgs(2, arguments);
|
|
21874
|
+
var dateLeft = toDate(dirtyDateLeft);
|
|
21875
|
+
var dateRight = toDate(dirtyDateRight);
|
|
21876
|
+
return dateLeft.getTime() - dateRight.getTime();
|
|
21884
21877
|
}
|
|
21885
21878
|
|
|
21879
|
+
var MILLISECONDS_IN_MINUTE = 60000;
|
|
21886
21880
|
/**
|
|
21887
21881
|
* @name differenceInMinutes
|
|
21888
21882
|
* @category Minute Helpers
|
|
@@ -21891,33 +21885,36 @@ function getRoundingMethod(method) {
|
|
|
21891
21885
|
* @description
|
|
21892
21886
|
* Get the signed number of full (rounded towards 0) minutes between the given dates.
|
|
21893
21887
|
*
|
|
21888
|
+
* ### v2.0.0 breaking changes:
|
|
21889
|
+
*
|
|
21890
|
+
* - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
|
|
21891
|
+
*
|
|
21894
21892
|
* @param {Date|Number} dateLeft - the later date
|
|
21895
21893
|
* @param {Date|Number} dateRight - the earlier date
|
|
21896
|
-
* @param {Object} [options] - an object with options.
|
|
21897
|
-
* @param {String} [options.roundingMethod='trunc'] - a rounding method (`ceil`, `floor`, `round` or `trunc`)
|
|
21898
21894
|
* @returns {Number} the number of minutes
|
|
21899
21895
|
* @throws {TypeError} 2 arguments required
|
|
21900
21896
|
*
|
|
21901
21897
|
* @example
|
|
21902
21898
|
* // How many minutes are between 2 July 2014 12:07:59 and 2 July 2014 12:20:00?
|
|
21903
|
-
*
|
|
21899
|
+
* var result = differenceInMinutes(
|
|
21904
21900
|
* new Date(2014, 6, 2, 12, 20, 0),
|
|
21905
21901
|
* new Date(2014, 6, 2, 12, 7, 59)
|
|
21906
21902
|
* )
|
|
21907
21903
|
* //=> 12
|
|
21908
21904
|
*
|
|
21909
21905
|
* @example
|
|
21910
|
-
* // How many minutes are
|
|
21911
|
-
*
|
|
21906
|
+
* // How many minutes are from 10:01:59 to 10:00:00
|
|
21907
|
+
* var result = differenceInMinutes(
|
|
21912
21908
|
* new Date(2000, 0, 1, 10, 0, 0),
|
|
21913
21909
|
* new Date(2000, 0, 1, 10, 1, 59)
|
|
21914
21910
|
* )
|
|
21915
21911
|
* //=> -1
|
|
21916
21912
|
*/
|
|
21917
|
-
|
|
21913
|
+
|
|
21914
|
+
function differenceInMinutes(dirtyDateLeft, dirtyDateRight) {
|
|
21918
21915
|
requiredArgs(2, arguments);
|
|
21919
|
-
var diff = differenceInMilliseconds(
|
|
21920
|
-
return
|
|
21916
|
+
var diff = differenceInMilliseconds(dirtyDateLeft, dirtyDateRight) / MILLISECONDS_IN_MINUTE;
|
|
21917
|
+
return diff > 0 ? Math.floor(diff) : Math.ceil(diff);
|
|
21921
21918
|
}
|
|
21922
21919
|
|
|
21923
21920
|
/**
|
|
@@ -21928,6 +21925,10 @@ function differenceInMinutes(dateLeft, dateRight, options) {
|
|
|
21928
21925
|
* @description
|
|
21929
21926
|
* Subtract the specified number of days from the given date.
|
|
21930
21927
|
*
|
|
21928
|
+
* ### v2.0.0 breaking changes:
|
|
21929
|
+
*
|
|
21930
|
+
* - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
|
|
21931
|
+
*
|
|
21931
21932
|
* @param {Date|Number} date - the date to be changed
|
|
21932
21933
|
* @param {Number} amount - the amount of days to be subtracted. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.
|
|
21933
21934
|
* @returns {Date} the new date with the days subtracted
|
|
@@ -21935,9 +21936,10 @@ function differenceInMinutes(dateLeft, dateRight, options) {
|
|
|
21935
21936
|
*
|
|
21936
21937
|
* @example
|
|
21937
21938
|
* // Subtract 10 days from 1 September 2014:
|
|
21938
|
-
*
|
|
21939
|
+
* var result = subDays(new Date(2014, 8, 1), 10)
|
|
21939
21940
|
* //=> Fri Aug 22 2014 00:00:00
|
|
21940
21941
|
*/
|
|
21942
|
+
|
|
21941
21943
|
function subDays(dirtyDate, dirtyAmount) {
|
|
21942
21944
|
requiredArgs(2, arguments);
|
|
21943
21945
|
var amount = toInteger(dirtyAmount);
|
|
@@ -22315,19 +22317,21 @@ AuthenticationServicesResolver = __decorate([
|
|
|
22315
22317
|
], AuthenticationServicesResolver);
|
|
22316
22318
|
|
|
22317
22319
|
class AppInMemorySettings {
|
|
22318
|
-
constructor() {
|
|
22320
|
+
constructor(name) {
|
|
22321
|
+
this.name = name;
|
|
22322
|
+
}
|
|
22319
22323
|
initialize(value) {
|
|
22320
22324
|
this._instance = value;
|
|
22321
22325
|
}
|
|
22322
22326
|
get value() {
|
|
22323
22327
|
if (!this._instance) {
|
|
22324
|
-
throw new Error(
|
|
22328
|
+
throw new Error(`AppSettings ${this.name} not initialized`);
|
|
22325
22329
|
}
|
|
22326
22330
|
return this._instance;
|
|
22327
22331
|
}
|
|
22328
22332
|
}
|
|
22329
22333
|
|
|
22330
|
-
const authSettings = new AppInMemorySettings();
|
|
22334
|
+
const authSettings = new AppInMemorySettings("authSettings");
|
|
22331
22335
|
|
|
22332
22336
|
let JwtProvider = class JwtProvider {
|
|
22333
22337
|
constructor(jwtService) {
|
|
@@ -33793,7 +33797,7 @@ JobsMonitorTask = JobsMonitorTask_1 = __decorate([
|
|
|
33793
33797
|
__metadata("design:paramtypes", [Object, Object, CommandBus])
|
|
33794
33798
|
], JobsMonitorTask);
|
|
33795
33799
|
|
|
33796
|
-
const jobsSettings = new AppInMemorySettings();
|
|
33800
|
+
const jobsSettings = new AppInMemorySettings("jobsSettings");
|
|
33797
33801
|
|
|
33798
33802
|
var JobsScheduler_1;
|
|
33799
33803
|
let JobsScheduler = JobsScheduler_1 = class JobsScheduler {
|
|
@@ -34302,6 +34306,20 @@ const buildCompletedStepsSequence = (step) => {
|
|
|
34302
34306
|
};
|
|
34303
34307
|
class PipelineUtils {
|
|
34304
34308
|
constructor() {
|
|
34309
|
+
this.getStepByKey = (step, key) => {
|
|
34310
|
+
const sequence = buildCompletedStepsSequence(step);
|
|
34311
|
+
const matchingStep = sequence.find((x) => x.reference.key === key);
|
|
34312
|
+
if (!matchingStep) {
|
|
34313
|
+
throw new Error(`Step key ${key} not found`);
|
|
34314
|
+
}
|
|
34315
|
+
return matchingStep;
|
|
34316
|
+
};
|
|
34317
|
+
this.getStepInputByKey = (step, key) => {
|
|
34318
|
+
return this.getStepByKey(step, key).stepInput;
|
|
34319
|
+
};
|
|
34320
|
+
this.getStepOutputByKey = (step, key) => {
|
|
34321
|
+
return this.getStepByKey(step, key).stepOutput;
|
|
34322
|
+
};
|
|
34305
34323
|
this.getStep = (step, index) => {
|
|
34306
34324
|
const sequence = buildCompletedStepsSequence(step);
|
|
34307
34325
|
if (index >= sequence.length) {
|
|
@@ -34408,7 +34426,7 @@ class AwsS3BucketError extends Error {
|
|
|
34408
34426
|
}
|
|
34409
34427
|
}
|
|
34410
34428
|
|
|
34411
|
-
const awsBucketSettings = new AppInMemorySettings();
|
|
34429
|
+
const awsBucketSettings = new AppInMemorySettings("awsBucketSettings");
|
|
34412
34430
|
|
|
34413
34431
|
const streamToBuffer = (stream) => new Promise((resolve, reject) => {
|
|
34414
34432
|
const chunks = [];
|
|
@@ -34760,7 +34778,7 @@ const WpAwsSesEmailTemplate = (templateId, sendgridTemplateData) => applyDecorat
|
|
|
34760
34778
|
templateId,
|
|
34761
34779
|
}), SetMetadata(AwsSesModuleSymbols.EmailTemplate, sendgridTemplateData));
|
|
34762
34780
|
|
|
34763
|
-
const awsSesSettings = new AppInMemorySettings();
|
|
34781
|
+
const awsSesSettings = new AppInMemorySettings("awsSesSettings");
|
|
34764
34782
|
|
|
34765
34783
|
const getLocalizedText = (item, languageId, defaultLanguageId) => {
|
|
34766
34784
|
return typeof item === "string"
|
|
@@ -39806,7 +39824,7 @@ const WpSendgridEmailTemplate = (templateId, sendgridTemplateData) => applyDecor
|
|
|
39806
39824
|
templateId,
|
|
39807
39825
|
}), SetMetadata(SendgridModuleSymbols.EmailTemplate, sendgridTemplateData));
|
|
39808
39826
|
|
|
39809
|
-
const sendgridSettings = new AppInMemorySettings();
|
|
39827
|
+
const sendgridSettings = new AppInMemorySettings("sendgridSettings");
|
|
39810
39828
|
|
|
39811
39829
|
const sanitizeValue = (value) => value?.trim() ? value?.trim() : undefined;
|
|
39812
39830
|
const sanitizeArray = (value) => (value?.length ?? 0) > 0 ? value : undefined;
|
|
@@ -39982,7 +40000,7 @@ InMemoryEmailProvider = __decorate([
|
|
|
39982
40000
|
WpEmailProvider("in-memory")
|
|
39983
40001
|
], InMemoryEmailProvider);
|
|
39984
40002
|
|
|
39985
|
-
const awsBatchSettings = new AppInMemorySettings();
|
|
40003
|
+
const awsBatchSettings = new AppInMemorySettings("awsBatchSettings");
|
|
39986
40004
|
|
|
39987
40005
|
const JobProvider = (provider) => SetMetadata(JOB_PROVIDER, provider);
|
|
39988
40006
|
|
|
@@ -40324,7 +40342,7 @@ class AwsS3MediaError extends Error {
|
|
|
40324
40342
|
}
|
|
40325
40343
|
}
|
|
40326
40344
|
|
|
40327
|
-
const awsMediaSettings = new AppInMemorySettings();
|
|
40345
|
+
const awsMediaSettings = new AppInMemorySettings("awsMediaSettings");
|
|
40328
40346
|
|
|
40329
40347
|
const createClient$1 = (settings) => new S3Client({
|
|
40330
40348
|
region: settings.region,
|
|
@@ -43293,7 +43311,7 @@ axios$2.exports.default = axios$1;
|
|
|
43293
43311
|
|
|
43294
43312
|
var axios = axios$2.exports;
|
|
43295
43313
|
|
|
43296
|
-
const sanityMediaSettings = new AppInMemorySettings();
|
|
43314
|
+
const sanityMediaSettings = new AppInMemorySettings("sanityMediaSettings");
|
|
43297
43315
|
|
|
43298
43316
|
const buildRef = ({ dataset, projectId, id, }) => {
|
|
43299
43317
|
return `sanity://${projectId}/${dataset}/${id}`;
|
|
@@ -43440,7 +43458,7 @@ InMemoryMediaProvider = __decorate([
|
|
|
43440
43458
|
WpMediaProvider("inMemory")
|
|
43441
43459
|
], InMemoryMediaProvider);
|
|
43442
43460
|
|
|
43443
|
-
const awsSecretsSettings = new AppInMemorySettings();
|
|
43461
|
+
const awsSecretsSettings = new AppInMemorySettings("awsSecretsSettings");
|
|
43444
43462
|
|
|
43445
43463
|
const WpSecretsProvider = (providerId) => applyDecorators(Injectable(), SetMetadata(EntityManagerSymbols.SecretsProvider, {
|
|
43446
43464
|
providerId,
|