@lilaquadrat/studio 10.0.0-beta.4 → 10.0.0-beta.6

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.
@@ -1,41 +0,0 @@
1
- import { QueueClient, QueueServiceClient } from '@azure/storage-queue';
2
- import { ObjectId } from 'mongodb';
3
- import Immutable from '../Immutable.class.js';
4
- import { CertificateAction, Certificate, BasicData, CertificateActionResult, CreateResult, ListCustomQueries, Options, SkipLimitSort, UserApp, UserAppWithOptions } from '@lilaquadrat/interfaces';
5
- export declare class CertificatesActionsService extends Immutable<CertificateAction> {
6
- model: import("../classes/modelv2.class.js").default<CertificateAction, import("../models/certificate-action.model.js").CertificateActions>;
7
- service: QueueServiceClient;
8
- client: QueueClient;
9
- constructor(connectionString: string, storageAccount?: string);
10
- request(domains: CertificateAction['domains'], type: 'domain', contentType: CertificateAction['contentType'], renew: boolean, options: Required<UserApp> & Required<Options> & {
11
- timeout?: number;
12
- forceFile?: CertificateAction['forceFile'];
13
- saveInVault?: CertificateAction['saveInVault'];
14
- }): Promise<CreateResult<CertificateAction>>;
15
- request(domains: CertificateAction['domains'], type: 'wildcard', contentType: CertificateAction['contentType'], renew: boolean, options: Required<UserApp> & {
16
- timeout?: number;
17
- forceFile?: CertificateAction['forceFile'];
18
- saveInVault?: CertificateAction['saveInVault'];
19
- }): Promise<CreateResult<CertificateAction>>;
20
- planRenew(certificate: Certificate, validPercent: number, options: Required<UserApp> & Options & {
21
- timeout?: number;
22
- forceFile?: CertificateAction['forceFile'];
23
- saveInVault?: CertificateAction['saveInVault'];
24
- }): Promise<void> | Promise<CreateResult<BasicData<CertificateAction>>>;
25
- planRetry(certificateAction: BasicData<CertificateAction>, error: CertificateActionResult, retryTimeout: number | undefined, user: string, app: string): Promise<boolean>;
26
- addToQueue(actionInternalId: ObjectId, visibilityTimeout?: number): Promise<import("@azure/storage-queue").QueueSendMessageResponse>;
27
- single(actionInternalId: ObjectId): Promise<import("mongodb").WithId<CertificateAction> | null>;
28
- latest(domain: string, company: string, project: string): Promise<import("mongodb").WithId<CertificateAction>>;
29
- getPlanned(): Promise<import("mongodb").WithId<CertificateAction>[]>;
30
- handlePlanned(): Promise<Promise<import("@azure/storage-queue").QueueSendMessageResponse>[]>;
31
- setState(actionInternalId: ObjectId, state: CertificateAction['state'], user: string, app: string): Promise<import("mongodb").UpdateResult<BasicData<CertificateAction>>>;
32
- setResult(actionInternalId: ObjectId, result: CertificateActionResult, state: CertificateAction['state'], user: string, app: string): Promise<import("mongodb").UpdateResult<BasicData<CertificateAction>>>;
33
- getCustomQuery(filter: {
34
- domain?: string;
35
- state?: CertificateAction['state'];
36
- }, options: UserAppWithOptions & SkipLimitSort): ListCustomQueries<CertificateAction>;
37
- actionExistsForDomain(domain: string): Promise<boolean>;
38
- cancel(internalId: ObjectId, options: Required<UserApp>): Promise<import("mongodb").UpdateResult<BasicData<CertificateAction>>>;
39
- }
40
- declare const _default: CertificatesActionsService;
41
- export default _default;
@@ -1,188 +1,237 @@
1
- import { QueueServiceClient } from '@azure/storage-queue';
2
- import dayjs from 'dayjs';
3
- import logger from '../logger.js';
4
- import Immutable from '../Immutable.class.js';
5
- import CertificateActionModel from '../models/certificate-action.model.js';
6
- import hardCopy from '../helpers/hardCopy.js';
7
- import { DefaultAzureCredential } from '@azure/identity';
8
- export class CertificatesActionsService extends Immutable {
9
- constructor(connectionString, storageAccount) {
10
- super();
11
- this.model = CertificateActionModel;
12
- if (storageAccount) {
13
- logger.info('certificates-action.use.storage_account');
14
- const credentials = new DefaultAzureCredential();
15
- this.service = new QueueServiceClient(`https://${storageAccount}.queue.core.windows.net`, credentials);
16
- }
17
- else if (connectionString) {
18
- logger.info('certificates-action.use.connection_string');
19
- this.service = QueueServiceClient.fromConnectionString(connectionString);
20
- }
21
- if (this.service) {
22
- this.client = this.service.getQueueClient('certs');
23
- }
24
- }
25
- async request(domains, type, contentType, renew, options) {
26
- const actionObject = {
27
- domains,
28
- type,
29
- contentType,
30
- renew,
31
- state: 'new',
32
- maxRetries: 5,
33
- };
34
- if (options.company)
35
- actionObject.company = options.company;
36
- if (options.project)
37
- actionObject.project = options.project;
38
- if (options.forceFile)
39
- actionObject.forceFile = true;
40
- if (options.saveInVault)
41
- actionObject.saveInVault = true;
42
- const action = type === 'wildcard'
43
- ? 'create-wildcard'
44
- : 'create-domain';
45
- const newAction = await this.create(actionObject, options.user, options.app, undefined, undefined, action);
46
- await this.addToQueue(newAction._id, options.timeout);
47
- return newAction;
48
- }
49
- planRenew(certificate, validPercent, options) {
50
- const validDays = dayjs(certificate.valid.to).diff(certificate.valid.from, 'days');
51
- const renewInDays = Math.floor((validDays * (validPercent / 100)));
52
- if (renewInDays < 1) {
53
- logger.info('cant plan renew of certificate, renew in days is smaller than 1');
54
- return new Promise((resolve) => resolve());
55
- }
56
- const renewObject = {
57
- planned: dayjs(certificate.valid.from).add(renewInDays, 'days').toDate(),
58
- type: certificate.type,
59
- contentType: certificate.contentType,
60
- domains: certificate.domains,
61
- state: 'new',
62
- renew: true,
63
- maxRetries: 5,
64
- };
65
- if (certificate.company)
66
- renewObject.company = certificate.company;
67
- if (certificate.project)
68
- renewObject.project = certificate.project;
69
- if (options.forceFile)
70
- renewObject.forceFile = true;
71
- if (options.saveInVault)
72
- renewObject.saveInVault = true;
73
- const action = certificate.type === 'wildcard'
74
- ? 'create-wildcard'
75
- : 'create-domain';
76
- return this.create(renewObject, options.user, options.app, undefined, undefined, action);
77
- }
78
- async planRetry(certificateAction, error, retryTimeout = 86400, user, app) {
79
- const retry = certificateAction.retryCount !== certificateAction.maxRetries;
80
- const renewObject = {
81
- ...hardCopy(certificateAction),
82
- state: retry ? 'retry' : 'failed',
83
- renew: true,
84
- };
85
- if (!renewObject.results && error)
86
- renewObject.results = [];
87
- renewObject.results?.push(error);
88
- if (retry) {
89
- renewObject.retryCount = renewObject.retryCount
90
- ? renewObject.retryCount += 1
91
- : 1;
92
- }
93
- delete renewObject._id;
94
- delete renewObject.history;
95
- // hardCopy converts the Date Object to a string, validation expects a object
96
- if (renewObject.planned)
97
- renewObject.planned = new Date(renewObject.planned);
98
- await this.immutable(certificateAction._id, renewObject, user, 'change', app);
99
- if (retry)
100
- await this.addToQueue(certificateAction._id, retryTimeout);
101
- return true;
102
- }
103
- async addToQueue(actionInternalId, visibilityTimeout = 0) {
104
- await this.client.createIfNotExists();
105
- return this.client.sendMessage(Buffer.from(JSON.stringify({ _id: actionInternalId })).toString('base64'), { visibilityTimeout });
106
- }
107
- single(actionInternalId) {
108
- return this.model.db.findOne({ _id: actionInternalId });
109
- }
110
- async latest(domain, company, project) {
111
- const latest = await this.model.db.find({ domains: { $in: [domain] }, company, project }).sort({ _id: -1 }).limit(1).toArray();
112
- return latest[0];
113
- }
114
- getPlanned() {
115
- const select = {
116
- state: 'new',
117
- planned: { $lte: new Date(), $exists: true },
118
- };
119
- return CertificateActionModel.db.find(select, { sort: { planned: -1 } })
120
- .toArray();
121
- }
122
- async handlePlanned() {
123
- const planned = await this.getPlanned();
124
- const all = planned.map((single) => this.addToQueue(single._id));
125
- return all;
126
- }
127
- setState(actionInternalId, state, user, app) {
128
- return this.immutable(actionInternalId, { state }, user, 'change', app, undefined, undefined, 'stateChange');
129
- }
130
- async setResult(actionInternalId, result, state, user, app) {
131
- const baseAction = await this.model.db.findOne({ _id: actionInternalId }, { projection: { state: 1, results: 1 } });
132
- if (!baseAction)
133
- throw new Error('BASE_ACTION_MISSING');
134
- delete baseAction._id;
135
- baseAction.state = state;
136
- if (!baseAction.results && result)
137
- baseAction.results = [];
138
- baseAction.results?.push(result);
139
- return this.immutable(actionInternalId, baseAction, user, 'change', app, undefined, undefined, 'stateChangeResult');
140
- }
141
- getCustomQuery(filter, options) {
142
- const match = {};
143
- if (filter?.state) {
144
- match.state = filter.state;
145
- }
146
- // if (filter?.mode) {
147
- // match.mode = filter.mode;
148
- // }
149
- if (filter?.domain) {
150
- match.domains = { $in: [filter.domain] };
151
- }
152
- const aggregation = [
153
- {
154
- $match: match,
155
- },
156
- {
157
- $project: {
158
- type: 1,
159
- domains: 1,
160
- renew: 1,
161
- company: 1,
162
- project: 1,
163
- state: 1,
164
- planned: 1,
165
- history: 1,
166
- },
167
- },
168
- ];
169
- aggregation.push({
170
- $sort: options.sort || { _id: -1 },
171
- });
172
- if (options.skip) { }
173
- aggregation.push({
174
- $skip: options.skip,
175
- }, {
176
- $limit: options.limit,
177
- });
178
- return { aggregation, countQuery: match };
179
- }
180
- async actionExistsForDomain(domain) {
181
- return await this.model.db.countDocuments({ domains: { $in: [domain] }, state: { $in: ['new', 'planned', 'retry'] } }) > 0;
182
- }
183
- async cancel(internalId, options) {
184
- return this.immutable({ _id: internalId }, { state: 'canceled' }, options.user, 'change', options.app, undefined, undefined, 'stateChange');
185
- }
186
- }
187
- export default new CertificatesActionsService(process.env.PUBLISH_QUEUE_CONNECTION_STRING, process.env.STORAGE_ACCOUNT);
1
+ // import { QueueClient, QueueServiceClient } from '@azure/storage-queue';
2
+ // import { Filter, ObjectId } from 'mongodb';
3
+ // import dayjs from 'dayjs';
4
+ // import logger from '../logger.js';
5
+ // import Immutable from '../Immutable.class.js';
6
+ // import CertificateActionModel from '../models/certificate-action.model.js';
7
+ // import hardCopy from '../helpers/hardCopy.js';
8
+ // import { CertificateAction, Certificate, BasicData, CertificateActionResult, CreateResult, ListCustomQueries, Options, SkipLimitSort, UserApp, UserAppWithOptions } from '@lilaquadrat/interfaces';
9
+ // import { DefaultAzureCredential } from '@azure/identity';
10
+ // export class CertificatesActionsService extends Immutable<CertificateAction> {
11
+ // model = CertificateActionModel;
12
+ // service: QueueServiceClient;
13
+ // client: QueueClient;
14
+ // constructor(connectionString: string, storageAccount?: string) {
15
+ // super();
16
+ // if (storageAccount) {
17
+ // logger.info('certificates-action.use.storage_account');
18
+ // const credentials = new DefaultAzureCredential();
19
+ // this.service = new QueueServiceClient(`https://${storageAccount}.queue.core.windows.net`, credentials);
20
+ // } else if (connectionString) {
21
+ // logger.info('certificates-action.use.connection_string');
22
+ // this.service = QueueServiceClient.fromConnectionString(connectionString);
23
+ // }
24
+ // if (this.service) {
25
+ // this.client = this.service.getQueueClient('certs');
26
+ // }
27
+ // }
28
+ // async request(
29
+ // domains: CertificateAction['domains'],
30
+ // type: 'domain',
31
+ // contentType: CertificateAction['contentType'],
32
+ // renew: boolean,
33
+ // options: Required<UserApp> & Required<Options> & { timeout?: number, forceFile?: CertificateAction['forceFile'], saveInVault?: CertificateAction['saveInVault'] },
34
+ // ): Promise<CreateResult<CertificateAction>>;
35
+ // async request(
36
+ // domains: CertificateAction['domains'],
37
+ // type: 'wildcard',
38
+ // contentType: CertificateAction['contentType'],
39
+ // renew: boolean,
40
+ // options: Required<UserApp> & { timeout?: number, forceFile?: CertificateAction['forceFile'], saveInVault?: CertificateAction['saveInVault'] },
41
+ // ): Promise<CreateResult<CertificateAction>>;
42
+ // async request(
43
+ // domains: CertificateAction['domains'],
44
+ // type: CertificateAction['type'],
45
+ // contentType: CertificateAction['contentType'],
46
+ // renew: boolean,
47
+ // options: Required<UserApp> & Options & { timeout?: number, forceFile?: CertificateAction['forceFile'], saveInVault?: CertificateAction['saveInVault'] },
48
+ // ): Promise<CreateResult<CertificateAction>> {
49
+ // const actionObject: CertificateAction = {
50
+ // domains,
51
+ // type,
52
+ // contentType,
53
+ // renew,
54
+ // state: 'new',
55
+ // maxRetries: 5,
56
+ // };
57
+ // if (options.company) actionObject.company = options.company;
58
+ // if (options.project) actionObject.project = options.project;
59
+ // if (options.forceFile) actionObject.forceFile = true;
60
+ // if (options.saveInVault) actionObject.saveInVault = true;
61
+ // const action = type === 'wildcard'
62
+ // ? 'create-wildcard'
63
+ // : 'create-domain';
64
+ // const newAction = await this.create(actionObject, options.user, options.app, undefined, undefined, action);
65
+ // await this.addToQueue(newAction._id, options.timeout);
66
+ // return newAction;
67
+ // }
68
+ // planRenew(
69
+ // certificate: Certificate,
70
+ // validPercent: number,
71
+ // options: Required<UserApp> & Options & { timeout?: number, forceFile?: CertificateAction['forceFile'], saveInVault?: CertificateAction['saveInVault'] },
72
+ // ) {
73
+ // const validDays = dayjs(certificate.valid.to).diff(certificate.valid.from, 'days');
74
+ // const renewInDays = Math.floor((validDays * (validPercent / 100)));
75
+ // if (renewInDays < 1) {
76
+ // logger.info('cant plan renew of certificate, renew in days is smaller than 1');
77
+ // return new Promise<void>((resolve) => resolve());
78
+ // }
79
+ // const renewObject: CertificateAction = {
80
+ // planned: dayjs(certificate.valid.from).add(renewInDays, 'days').toDate(),
81
+ // type: certificate.type,
82
+ // contentType: certificate.contentType,
83
+ // domains: certificate.domains,
84
+ // state: 'new',
85
+ // renew: true,
86
+ // maxRetries: 5,
87
+ // };
88
+ // if (certificate.company) renewObject.company = certificate.company;
89
+ // if (certificate.project) renewObject.project = certificate.project;
90
+ // if (options.forceFile) renewObject.forceFile = true;
91
+ // if (options.saveInVault) renewObject.saveInVault = true;
92
+ // const action = certificate.type === 'wildcard'
93
+ // ? 'create-wildcard'
94
+ // : 'create-domain';
95
+ // return this.create(renewObject, options.user, options.app, undefined, undefined, action);
96
+ // }
97
+ // async planRetry(certificateAction: BasicData<CertificateAction>, error: CertificateActionResult, retryTimeout = 86400, user: string, app: string) {
98
+ // const retry = certificateAction.retryCount !== certificateAction.maxRetries;
99
+ // const renewObject: BasicData<CertificateAction> = {
100
+ // ...hardCopy(certificateAction),
101
+ // state: retry ? 'retry' : 'failed',
102
+ // renew: true,
103
+ // };
104
+ // if (!renewObject.results && error) renewObject.results = [];
105
+ // renewObject.results?.push(error);
106
+ // if (retry) {
107
+ // renewObject.retryCount = renewObject.retryCount
108
+ // ? renewObject.retryCount += 1
109
+ // : 1;
110
+ // }
111
+ // delete renewObject._id;
112
+ // delete renewObject.history;
113
+ // // hardCopy converts the Date Object to a string, validation expects a object
114
+ // if (renewObject.planned) renewObject.planned = new Date(renewObject.planned);
115
+ // await this.immutable(certificateAction._id, renewObject, user, 'change', app);
116
+ // if (retry) await this.addToQueue(certificateAction._id as ObjectId, retryTimeout);
117
+ // return true;
118
+ // }
119
+ // async addToQueue(actionInternalId: ObjectId, visibilityTimeout: number = 0) {
120
+ // await this.client.createIfNotExists();
121
+ // return this.client.sendMessage(Buffer.from(JSON.stringify({ _id: actionInternalId })).toString('base64'), { visibilityTimeout });
122
+ // }
123
+ // single(actionInternalId: ObjectId) {
124
+ // return this.model.db.findOne({ _id: actionInternalId });
125
+ // }
126
+ // async latest(domain: string, company: string, project: string) {
127
+ // const latest = await this.model.db.find({ domains: { $in: [domain] }, company, project }).sort({ _id: -1 }).limit(1).toArray();
128
+ // return latest[0];
129
+ // }
130
+ // getPlanned() {
131
+ // const select: any = {
132
+ // state: 'new',
133
+ // planned: { $lte: new Date(), $exists: true },
134
+ // };
135
+ // return CertificateActionModel.db.find(
136
+ // select,
137
+ // { sort: { planned: -1 } },
138
+ // )
139
+ // .toArray();
140
+ // }
141
+ // async handlePlanned() {
142
+ // const planned = await this.getPlanned();
143
+ // const all = planned.map((single) => this.addToQueue(single._id));
144
+ // return all;
145
+ // }
146
+ // setState(actionInternalId: ObjectId, state: CertificateAction['state'], user: string, app: string) {
147
+ // return this.immutable(
148
+ // actionInternalId,
149
+ // { state },
150
+ // user,
151
+ // 'change',
152
+ // app,
153
+ // undefined,
154
+ // undefined,
155
+ // 'stateChange',
156
+ // );
157
+ // }
158
+ // async setResult(
159
+ // actionInternalId: ObjectId,
160
+ // result: CertificateActionResult,
161
+ // state: CertificateAction['state'],
162
+ // user: string,
163
+ // app: string,
164
+ // ) {
165
+ // const baseAction: Partial<BasicData<CertificateAction>> | null = await this.model.db.findOne(
166
+ // { _id: actionInternalId }, { projection: { state: 1, results: 1 } },
167
+ // );
168
+ // if (!baseAction) throw new Error('BASE_ACTION_MISSING');
169
+ // delete baseAction._id;
170
+ // baseAction.state = state;
171
+ // if (!baseAction.results && result) baseAction.results = [];
172
+ // baseAction.results?.push(result);
173
+ // return this.immutable(
174
+ // actionInternalId,
175
+ // baseAction,
176
+ // user,
177
+ // 'change',
178
+ // app,
179
+ // undefined,
180
+ // undefined,
181
+ // 'stateChangeResult',
182
+ // );
183
+ // }
184
+ // getCustomQuery(filter: { domain?: string, state?: CertificateAction['state'] }, options: UserAppWithOptions & SkipLimitSort): ListCustomQueries<CertificateAction> {
185
+ // const match: Filter<CertificateAction> = {};
186
+ // if (filter?.state) {
187
+ // match.state = filter.state;
188
+ // }
189
+ // // if (filter?.mode) {
190
+ // // match.mode = filter.mode;
191
+ // // }
192
+ // if (filter?.domain) {
193
+ // match.domains = { $in: [filter.domain] };
194
+ // }
195
+ // const aggregation: Object[] = [
196
+ // {
197
+ // $match: match,
198
+ // },
199
+ // {
200
+ // $project: {
201
+ // type: 1,
202
+ // domains: 1,
203
+ // renew: 1,
204
+ // company: 1,
205
+ // project: 1,
206
+ // state: 1,
207
+ // planned: 1,
208
+ // history: 1,
209
+ // },
210
+ // },
211
+ // ];
212
+ // aggregation.push({
213
+ // $sort: options.sort || { _id: -1 },
214
+ // });
215
+ // if (options.skip) { }
216
+ // aggregation.push(
217
+ // {
218
+ // $skip: options.skip,
219
+ // },
220
+ // {
221
+ // $limit: options.limit,
222
+ // },
223
+ // );
224
+ // return { aggregation, countQuery: match };
225
+ // }
226
+ // async actionExistsForDomain(domain: string) {
227
+ // return await this.model.db.countDocuments({ domains: { $in: [domain] }, state: { $in: ['new', 'planned', 'retry'] } }) > 0;
228
+ // }
229
+ // async cancel(internalId: ObjectId, options: Required<UserApp>) {
230
+ // return this.immutable({ _id: internalId }, { state: 'canceled' }, options.user, 'change', options.app, undefined, undefined, 'stateChange');
231
+ // }
232
+ // }
233
+ // export default new CertificatesActionsService(
234
+ // process.env.PUBLISH_QUEUE_CONNECTION_STRING as string,
235
+ // process.env.STORAGE_ACCOUNT as string,
236
+ // );
188
237
  //# sourceMappingURL=certificatesAction.service.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"certificatesAction.service.js","sourceRoot":"","sources":["../../../src/services/certificatesAction.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,k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AAC,GAAG,CAAC,eAAyB,CACtC,CAAC"}
1
+ {"version":3,"file":"certificatesAction.service.js","sourceRoot":"","sources":["../../../src/services/certificatesAction.service.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,8CAA8C;AAC9C,6BAA6B;AAC7B,qCAAqC;AACrC,iDAAiD;AACjD,8EAA8E;AAC9E,iDAAiD;AACjD,sMAAsM;AACtM,4DAA4D;AAE5D,iFAAiF;AAEjF,oCAAoC;AAEpC,iCAAiC;AAEjC,yBAAyB;AAEzB,qEAAqE;AAErE,eAAe;AAEf,4BAA4B;AAE5B,gEAAgE;AAEhE,0DAA0D;AAC1D,gHAAgH;AAEhH,qCAAqC;AAErC,kEAAkE;AAElE,kFAAkF;AAElF,QAAQ;AAER,0BAA0B;AAE1B,4DAA4D;AAE5D,QAAQ;AAER,MAAM;AAEN,mBAAmB;AACnB,6CAA6C;AAC7C,sBAAsB;AACtB,qDAAqD;AACrD,sBAAsB;AACtB,yKAAyK;AACzK,iDAAiD;AACjD,mBAAmB;AACnB,6CAA6C;AAC7C,wBAAwB;AACxB,qDAAqD;AACrD,sBAAsB;AACtB,qJAAqJ;AACrJ,iDAAiD;AACjD,mBAAmB;AACnB,6CAA6C;AAC7C,uCAAuC;AACvC,qDAAqD;AACrD,sBAAsB;AACtB,+JAA+J;AAC/J,kDAAkD;AAElD,gDAAgD;AAChD,iBAAiB;AACjB,cAAc;AACd,qBAAqB;AACrB,eAAe;AACf,sBAAsB;AACtB,uBAAuB;AACvB,SAAS;AAET,mEAAmE;AACnE,mEAAmE;AACnE,4DAA4D;AAC5D,gEAAgE;AAEhE,yCAAyC;AACzC,4BAA4B;AAC5B,2BAA2B;AAE3B,kHAAkH;AAElH,6DAA6D;AAC7D,wBAAwB;AAExB,MAAM;AAEN,eAAe;AACf,gCAAgC;AAChC,4BAA4B;AAC5B,+JAA+J;AAC/J,QAAQ;AAER,0FAA0F;AAE1F,0EAA0E;AAE1E,6BAA6B;AAE7B,wFAAwF;AACxF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BAAmB;AACnB,QAAQ;AAER,oGAAoG;AACpG,6EAA6E;AAC7E,SAAS;AAET,+DAA+D;AAE/D,6BAA6B;AAC7B,gCAAgC;AAEhC,kEAAkE;AAClE,wCAAwC;AAExC,6BAA6B;AAC7B,0BAA0B;AAC1B,oBAAoB;AACpB,cAAc;AACd,kBAAkB;AAClB,aAAa;AACb,mBAAmB;AACnB,mBAAmB;AACnB,6BAA6B;AAC7B,SAAS;AAET,MAAM;AAEN,yKAAyK;AAEzK,mDAAmD;AAEnD,2BAA2B;AAE3B,oCAAoC;AAEpC,QAAQ;AAER,6BAA6B;AAC7B,qCAAqC;AACrC,WAAW;AAEX,4BAA4B;AAE5B,kDAAkD;AAElD,QAAQ;AAER,sCAAsC;AACtC,UAAU;AACV,yBAAyB;AACzB,WAAW;AACX,UAAU;AACV,sBAAsB;AACtB,qBAAqB;AACrB,wBAAwB;AACxB,sBAAsB;AACtB,wBAAwB;AACxB,wBAAwB;AACxB,sBAAsB;AACtB,wBAAwB;AACxB,wBAAwB;AACxB,aAAa;AACb,WAAW;AACX,SAAS;AAET,yBAAyB;AACzB,4CAA4C;AAC5C,UAAU;AAEV,4BAA4B;AAE5B,wBAAwB;AACxB,UAAU;AACV,+BAA+B;AAC/B,WAAW;AACX,UAAU;AACV,iCAAiC;AACjC,WAAW;AACX,SAAS;AAET,iDAAiD;AAEjD,MAAM;AAEN,kDAAkD;AAElD,kIAAkI;AAElI,MAAM;AAEN,qEAAqE;AAErE,mJAAmJ;AAEnJ,MAAM;AAEN,IAAI;AAEJ,iDAAiD;AACjD,2DAA2D;AAC3D,2CAA2C;AAC3C,KAAK"}
@@ -33,7 +33,7 @@ declare class DomainsService extends Immutable<Domain> {
33
33
  /**
34
34
  * start a new certification action based upon the last failed for this domain
35
35
  */
36
- retrySSL(data: ProjectDomain, user: string, app: string): Promise<import("@lilaquadrat/interfaces").CreateResult<import("@lilaquadrat/interfaces").CertificateAction> | null>;
36
+ retrySSL(data: ProjectDomain, user: string, app: string): Promise<null>;
37
37
  remove(_id: ObjectId, user: string, app: string): Promise<import("mongodb").DeleteResult>;
38
38
  linkCertificate(certificateInternalId: ObjectId, domain: string, company: string | undefined, project: string | undefined, user: string, app: string): Promise<import("mongodb").UpdateResult<BasicData<Domain>>>;
39
39
  linkMultipleDomains(certificateInternalId: ObjectId, domains: string[], company: string, project: string, user: string, app: string): Promise<import("mongodb").UpdateResult<BasicData<Domain>>[]>;
@@ -102,14 +102,7 @@ declare class DomainsService extends Immutable<Domain> {
102
102
  defaultDomain?: DomainConf;
103
103
  redirectDomains?: DomainConf[];
104
104
  } | null;
105
- getOrRequestForProject(company: string, project: string, options: Required<UserApp>): Promise<Promise<{
106
- type: 'certificate';
107
- data: BasicData<Certificate>;
108
- } | {
109
- type: 'request';
110
- data: ObjectId | undefined;
111
- }>[]>;
112
- requestCertificateForDomain(internalId: ObjectId, options: Required<UserApp>): Promise<import("@lilaquadrat/interfaces").CreateResult<import("@lilaquadrat/interfaces").CertificateAction> | null>;
105
+ requestCertificateForDomain(internalId: ObjectId, options: Required<UserApp>): Promise<null>;
113
106
  }
114
107
  declare const _default: DomainsService;
115
108
  export default _default;