@jumoo/usync-expansions 18.3.0 → 18.4.0

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.
Files changed (43) hide show
  1. package/dist/api/client.gen.js +1 -1
  2. package/dist/api/index.d.ts +1 -1
  3. package/dist/api/sdk.gen.d.ts +17 -15
  4. package/dist/api/sdk.gen.js +14 -0
  5. package/dist/api/types.gen.d.ts +72 -0
  6. package/dist/background/background-pipeline.repository.d.ts +3 -8
  7. package/dist/background/components/pending-list.element.js +10 -10
  8. package/dist/background/components/pipelines-table.element.js +16 -16
  9. package/dist/background/components/process-list.element.js +6 -6
  10. package/dist/background/components/queue-table.element.js +11 -11
  11. package/dist/background/workspace/background-workspace-element.js +19 -19
  12. package/dist/components/report-summary-view.js +90 -90
  13. package/dist/components/usync-property-layout.js +93 -93
  14. package/dist/items/sync-item.context.d.ts +1 -1
  15. package/dist/items/sync-item.repository.d.ts +3 -8
  16. package/dist/lang/en.d.ts +1 -0
  17. package/dist/lang/en.js +1 -0
  18. package/dist/licence/components/licence-notice.js +7 -7
  19. package/dist/licence/components/licence-status.view.js +13 -13
  20. package/dist/licence/components/styles.js +39 -39
  21. package/dist/licence/lang/en.d.ts +15 -0
  22. package/dist/licence/lang/en.js +16 -1
  23. package/dist/licence/licence.context.d.ts +6 -1
  24. package/dist/licence/licence.context.js +11 -0
  25. package/dist/licence/licence.element.d.ts +8 -1
  26. package/dist/licence/licence.element.js +269 -126
  27. package/dist/licence/licence.repository.d.ts +1 -0
  28. package/dist/licence/licence.repository.js +3 -0
  29. package/dist/licence/source/licence.source.d.ts +2 -1
  30. package/dist/licence/source/licence.source.js +3 -0
  31. package/dist/restore/components/restore-point-table.element.js +21 -21
  32. package/dist/restore/lang/en.js +11 -11
  33. package/dist/restore/restore.context.d.ts +1 -1
  34. package/dist/restore/restore.repository.d.ts +9 -4
  35. package/dist/restore/restore.repository.js +7 -0
  36. package/dist/restore/steps/restore-create-complete.js +9 -9
  37. package/dist/restore/steps/restore-create-element.js +31 -31
  38. package/dist/restore/steps/restore-report-config-element.js +44 -44
  39. package/dist/restore/steps/restore-report-element.d.ts +1 -0
  40. package/dist/restore/steps/restore-report-element.js +29 -1
  41. package/dist/restore/workspace/restore.workspace-view.element.js +42 -42
  42. package/dist/restore/workspace/restore.workspace.element.js +25 -25
  43. package/package.json +53 -52
@@ -15,16 +15,19 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
15
15
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
16
16
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
17
17
  };
18
- var _uSyncLicenceViewElement_instances, _uSyncLicenceViewElement_licenceContext, _uSyncLicenceViewElement_saveLicence, _uSyncLicenceViewElement_updateDomains, _uSyncLicenceViewElement_updateKey, _uSyncLicenceViewElement_clearLicence;
18
+ var _uSyncLicenceViewElement_instances, _uSyncLicenceViewElement_licenceContext, _uSyncLicenceViewElement_saveLicence, _uSyncLicenceViewElement_updateDomains, _uSyncLicenceViewElement_updateKey, _uSyncLicenceViewElement_clearLicence, _uSyncLicenceViewElement_onRequestTemporary;
19
19
  import { UmbElementMixin } from '@umbraco-cms/backoffice/element-api';
20
20
  import { LitElement, css, customElement, html, nothing, state, when, } from '@umbraco-cms/backoffice/external/lit';
21
21
  import { UmbTextStyles } from '@umbraco-cms/backoffice/style';
22
22
  import { UMB_CONFIRM_MODAL, UMB_MODAL_MANAGER_CONTEXT, } from '@umbraco-cms/backoffice/modal';
23
23
  import { USYNC_LICENCE_CONTEXT_TOKEN } from './licence.context';
24
+ import { UMB_NOTIFICATION_CONTEXT } from '@umbraco-cms/backoffice/notification';
25
+ const USYNC_UPGRADE_URL = 'https://checkout.jumoo.co.uk/?p=usync-upgrade';
24
26
  let uSyncLicenceViewElement = class uSyncLicenceViewElement extends UmbElementMixin(LitElement) {
25
27
  constructor() {
26
28
  super();
27
29
  _uSyncLicenceViewElement_instances.add(this);
30
+ this._requestingTemporary = false;
28
31
  _uSyncLicenceViewElement_licenceContext.set(this, void 0);
29
32
  this.licence = {
30
33
  key: 'key',
@@ -53,69 +56,133 @@ let uSyncLicenceViewElement = class uSyncLicenceViewElement extends UmbElementMi
53
56
  super.connectedCallback();
54
57
  }
55
58
  render() {
56
- return html `
57
- <umb-body-layout>
58
- <div class="layout">
59
- ${this.renderStatus()} ${this.renderDetails()} ${this.renderSubscription()}
60
- ${this.renderExpiration()}
61
- </div></umb-body-layout
62
- >
59
+ return html `
60
+ <umb-body-layout>
61
+ <div class="layout">
62
+ ${this.renderStatus()} ${this.renderDetails()} ${this.renderTemporary()}
63
+ ${this.renderSubscription()} ${this.renderExpiration()}
64
+ </div></umb-body-layout
65
+ >
63
66
  `;
64
67
  }
65
68
  renderStatus() {
66
- return html `
67
- <usync-licence-status .licenceStatus=${this.licenceStatus}></usync-licence-status>
69
+ return html `
70
+ <usync-licence-status .licenceStatus=${this.licenceStatus}></usync-licence-status>
68
71
  `;
69
72
  }
73
+ renderTemporary() {
74
+ const result = this._temporaryResult;
75
+ if (result?.licenceInConfig)
76
+ return this.renderTemporaryInConfig(result);
77
+ if (result?.saved)
78
+ return this.renderTemporarySaved(result);
79
+ if (!this.licenceStatus?.canRequestTemporaryLicence)
80
+ return nothing;
81
+ return html `<uui-box class="alert alert-warning">
82
+ <div class="temporary-content">
83
+ <uui-icon name="icon-alert"></uui-icon>
84
+ <div class="temporary-text">
85
+ <strong>${this.localize.term('usynccomplete_temporaryHeadline')}</strong>
86
+ <div>${this.localize.term('usynccomplete_temporaryDescription')}</div>
87
+ </div>
88
+ <uui-button
89
+ look="primary"
90
+ color="positive"
91
+ label=${this.localize.term('usynccomplete_temporaryButton')}
92
+ .state=${this._requestingTemporary ? 'waiting' : undefined}
93
+ ?disabled=${this._requestingTemporary}
94
+ @click=${__classPrivateFieldGet(this, _uSyncLicenceViewElement_instances, "m", _uSyncLicenceViewElement_onRequestTemporary)}></uui-button>
95
+ </div>
96
+ </uui-box>`;
97
+ }
98
+ renderTemporarySaved(result) {
99
+ return html `<uui-box class="alert alert-positive">
100
+ <div class="temporary-content">
101
+ <uui-icon name="icon-check"></uui-icon>
102
+ <div class="temporary-text">
103
+ ${result.expires
104
+ ? this.localize.term('usynccomplete_temporarySavedExpires', new Date(result.expires).toDateString())
105
+ : this.localize.term('usynccomplete_temporarySaved')}
106
+ </div>
107
+ ${this.renderUpgradeButton()}
108
+ </div>
109
+ </uui-box>`;
110
+ }
111
+ renderTemporaryInConfig(result) {
112
+ return html `<uui-box
113
+ headline=${this.localize.term('usynccomplete_temporaryInConfigHeadline')}>
114
+ <p><umb-localize key="usynccomplete_temporaryInConfig"></umb-localize></p>
115
+ ${this.renderCopyValue('usynccomplete_temporaryDomains', result.domains)}
116
+ ${this.renderCopyValue('usynccomplete_temporaryKey', result.key)}
117
+ ${this.renderUpgradeButton()}
118
+ </uui-box>`;
119
+ }
120
+ renderCopyValue(labelKey, value) {
121
+ const label = this.localize.term(labelKey);
122
+ return html `<umb-property-layout label=${label}>
123
+ <div slot="editor" class="copy-value">
124
+ <uui-input readonly label=${label} .value=${value}></uui-input>
125
+ <uui-button-copy-text .text=${value} label=${label}></uui-button-copy-text>
126
+ </div>
127
+ </umb-property-layout>`;
128
+ }
129
+ renderUpgradeButton() {
130
+ return html `<uui-button
131
+ look="secondary"
132
+ color="positive"
133
+ label=${this.localize.term('usynccomplete_temporaryUpgrade')}
134
+ href=${USYNC_UPGRADE_URL}
135
+ target="_blank"
136
+ rel="noopener noreferrer"></uui-button>`;
137
+ }
70
138
  renderDetails() {
71
139
  return this.licenceStatus
72
- ? html `
73
- <uui-box headline="uSync.Complete.Licence">
74
- <div slot="header-actions">
75
- <uui-button
76
- type="button"
77
- look="outline"
78
- color="danger"
79
- label="Clear"
80
- @click=${__classPrivateFieldGet(this, _uSyncLicenceViewElement_instances, "m", _uSyncLicenceViewElement_clearLicence)}></uui-button>
81
- </div>
82
- <div class="details">
83
- <umb-property-layout
84
- label="Domains"
85
- alias="domains"
86
- description="Domains licence applys to">
87
- <div slot="editor">
88
- <uui-input
89
- label="domains"
90
- @input=${__classPrivateFieldGet(this, _uSyncLicenceViewElement_instances, "m", _uSyncLicenceViewElement_updateDomains)}
91
- .value=${this.licence.domains}
92
- .readonly=${this.licenceStatus?.licenceType ===
93
- 'Subscription'}></uui-input>
94
- </div>
95
- </umb-property-layout>
96
-
97
- <umb-property-layout
98
- label="Licence Key"
99
- alias="key"
100
- description="Key for licence">
101
- <div slot="editor">
102
- <uui-input
103
- label="key"
104
- @input=${__classPrivateFieldGet(this, _uSyncLicenceViewElement_instances, "m", _uSyncLicenceViewElement_updateKey)}
105
- .value=${this.licence.key}></uui-input>
106
- </div>
107
- </umb-property-layout>
108
-
109
- <div class="actions">
110
- <uui-button
111
- look="primary"
112
- color="positive"
113
- label="Save"
114
- .state=${this.saveState}
115
- @click=${__classPrivateFieldGet(this, _uSyncLicenceViewElement_instances, "m", _uSyncLicenceViewElement_saveLicence)}></uui-button>
116
- </div>
117
- </div>
118
- </uui-box>
140
+ ? html `
141
+ <uui-box headline="uSync.Complete.Licence">
142
+ <div slot="header-actions">
143
+ <uui-button
144
+ type="button"
145
+ look="outline"
146
+ color="danger"
147
+ label="Clear"
148
+ @click=${__classPrivateFieldGet(this, _uSyncLicenceViewElement_instances, "m", _uSyncLicenceViewElement_clearLicence)}></uui-button>
149
+ </div>
150
+ <div class="details">
151
+ <umb-property-layout
152
+ label="Domains"
153
+ alias="domains"
154
+ description="Domains licence applys to">
155
+ <div slot="editor">
156
+ <uui-input
157
+ label="domains"
158
+ @input=${__classPrivateFieldGet(this, _uSyncLicenceViewElement_instances, "m", _uSyncLicenceViewElement_updateDomains)}
159
+ .value=${this.licence.domains}
160
+ .readonly=${this.licenceStatus?.licenceType === 'Subscription'}></uui-input>
161
+ </div>
162
+ </umb-property-layout>
163
+
164
+ <umb-property-layout
165
+ label="Licence Key"
166
+ alias="key"
167
+ description="Key for licence">
168
+ <div slot="editor">
169
+ <uui-input
170
+ label="key"
171
+ @input=${__classPrivateFieldGet(this, _uSyncLicenceViewElement_instances, "m", _uSyncLicenceViewElement_updateKey)}
172
+ .value=${this.licence.key}></uui-input>
173
+ </div>
174
+ </umb-property-layout>
175
+
176
+ <div class="actions">
177
+ <uui-button
178
+ look="primary"
179
+ color="positive"
180
+ label="Save"
181
+ .state=${this.saveState}
182
+ @click=${__classPrivateFieldGet(this, _uSyncLicenceViewElement_instances, "m", _uSyncLicenceViewElement_saveLicence)}></uui-button>
183
+ </div>
184
+ </div>
185
+ </uui-box>
119
186
  `
120
187
  : nothing;
121
188
  }
@@ -127,16 +194,16 @@ let uSyncLicenceViewElement = class uSyncLicenceViewElement extends UmbElementMi
127
194
  const expiresDate = new Date(this.licenceStatus.expires);
128
195
  if (expiresDate >= new Date('9999-12-30'))
129
196
  return nothing;
130
- return html `<uui-box headline="uSync.Complete.Subscription">
131
- <umb-localize key="usynccomplete_licenceSubscriptionInfo"></umb-localize>
132
- <uui-button
133
- look="secondary"
134
- color="positive"
135
- href="https://jumoo.co.uk/resend?sub=${this.licence.key}"
136
- target="_blank"
137
- rel="noopener noreferrer"
138
- >Request subscription details</uui-button
139
- >
197
+ return html `<uui-box headline="uSync.Complete.Subscription">
198
+ <umb-localize key="usynccomplete_licenceSubscriptionInfo"></umb-localize>
199
+ <uui-button
200
+ look="secondary"
201
+ color="positive"
202
+ href="https://jumoo.co.uk/resend?sub=${this.licence.key}"
203
+ target="_blank"
204
+ rel="noopener noreferrer"
205
+ >Request subscription details</uui-button
206
+ >
140
207
  </uui-box>`;
141
208
  }
142
209
  renderExpiration() {
@@ -148,28 +215,28 @@ let uSyncLicenceViewElement = class uSyncLicenceViewElement extends UmbElementMi
148
215
  const today = new Date();
149
216
  const remainingDays = Math.ceil((expiresDate.getTime() - today.getTime()) / (1000 * 60 * 60 * 24));
150
217
  if (expiresDate < today) {
151
- return html `<uui-box class="alert alert-danger">
152
- <umb-localize key="usynccomplete_licenceExpired"></umb-localize>
218
+ return html `<uui-box class="alert alert-danger">
219
+ <umb-localize key="usynccomplete_licenceExpired"></umb-localize>
153
220
  </uui-box>`;
154
221
  }
155
- return html `<uui-box
156
- class="alert ${remainingDays <= 60 && !this.licenceStatus.autoRenews ? 'alert-warning' : 'alert-default'}"
157
- ">
158
- <div class="alert-content">
159
- <div>
160
- <umb-localize
161
- key="usynccomplete_licenceExpires"
162
- .args=${[expiresDate.toDateString()]}></umb-localize>
163
- <umb-localize
164
- key="usynccomplete_licenceDaysLeft"
165
- .args=${[remainingDays]}></umb-localize>
166
- </div>
167
-
168
- <div>
169
- ${when(this.licenceStatus.autoRenews, () => html `<umb-icon name="icon-check"></umb-icon
170
- ><umb-localize key="usynccomplete_licenceAutoRenews"></umb-localize>`, () => html `<umb-icon name="icon-alarm-clock"></umb-icon
171
- ><umb-localize key="usynccomplete_licenceNotAutoRenews"></umb-localize>`)}</div>
172
- </div>
222
+ return html `<uui-box
223
+ class="alert ${remainingDays <= 60 && !this.licenceStatus.autoRenews ? 'alert-warning' : 'alert-default'}"
224
+ ">
225
+ <div class="alert-content">
226
+ <div>
227
+ <umb-localize
228
+ key="usynccomplete_licenceExpires"
229
+ .args=${[expiresDate.toDateString()]}></umb-localize>
230
+ <umb-localize
231
+ key="usynccomplete_licenceDaysLeft"
232
+ .args=${[remainingDays]}></umb-localize>
233
+ </div>
234
+
235
+ <div>
236
+ ${when(this.licenceStatus.autoRenews, () => html `<umb-icon name="icon-check"></umb-icon
237
+ ><umb-localize key="usynccomplete_licenceAutoRenews"></umb-localize>`, () => html `<umb-icon name="icon-alarm-clock"></umb-icon
238
+ ><umb-localize key="usynccomplete_licenceNotAutoRenews"></umb-localize>`)}</div>
239
+ </div>
173
240
  </uui-box>`;
174
241
  }
175
242
  };
@@ -211,52 +278,128 @@ _uSyncLicenceViewElement_clearLicence = async function _uSyncLicenceViewElement_
211
278
  // console.log('cancel');
212
279
  });
213
280
  };
281
+ _uSyncLicenceViewElement_onRequestTemporary = async function _uSyncLicenceViewElement_onRequestTemporary() {
282
+ if (!__classPrivateFieldGet(this, _uSyncLicenceViewElement_licenceContext, "f"))
283
+ return;
284
+ const modalManager = await this.getContext(UMB_MODAL_MANAGER_CONTEXT);
285
+ if (!modalManager)
286
+ return;
287
+ const confirmed = await modalManager
288
+ .open(this, UMB_CONFIRM_MODAL, {
289
+ data: {
290
+ headline: this.localize.term('usynccomplete_temporaryConfirmHeadline'),
291
+ content: html `<p>
292
+ ${this.localize.term('usynccomplete_temporaryConfirmContent')}
293
+ </p>
294
+ <p>${this.localize.term('usynccomplete_temporaryConfirmBuy')}</p>`,
295
+ confirmLabel: this.localize.term('usynccomplete_temporaryConfirmLabel'),
296
+ color: 'positive',
297
+ },
298
+ })
299
+ .onSubmit()
300
+ .then(() => true)
301
+ .catch(() => false);
302
+ if (!confirmed)
303
+ return;
304
+ this._requestingTemporary = true;
305
+ try {
306
+ const result = await __classPrivateFieldGet(this, _uSyncLicenceViewElement_licenceContext, "f").requestTemporaryLicence();
307
+ if (!result)
308
+ return;
309
+ if (!result.success) {
310
+ const notifications = await this.getContext(UMB_NOTIFICATION_CONTEXT);
311
+ notifications?.peek('danger', {
312
+ data: {
313
+ headline: this.localize.term('usynccomplete_temporaryFailed'),
314
+ message: result.message,
315
+ },
316
+ });
317
+ return;
318
+ }
319
+ this._temporaryResult = result;
320
+ }
321
+ finally {
322
+ this._requestingTemporary = false;
323
+ }
324
+ };
214
325
  uSyncLicenceViewElement.styles = [
215
326
  UmbTextStyles,
216
- css `
217
- .layout {
218
- display: flex;
219
- flex-direction: column;
220
- gap: var(--uui-size-space-4);
221
- }
222
-
223
- uui-input {
224
- width: 100%;
225
- }
226
-
227
- .actions {
228
- padding-left: calc(200px + var(--uui-size-layout-2));
229
- }
230
-
231
- .alert-content {
232
- display: flex;
233
- justify-content: space-between;
234
- }
235
-
236
- .alert-content > div {
237
- display: flex;
238
- gap: 10px;
239
- }
240
-
241
- .alert-danger {
242
- background-color: var(--uui-color-danger);
243
- color: var(--uui-color-danger-contrast);
244
- }
245
-
246
- .alert-default {
247
- background-color: var(--uui-color-default);
248
- color: var(--uui-color-default-contrast);
249
- }
250
-
251
- .alert-warning {
252
- background-color: var(--uui-color-warning);
253
- color: var(--uui-color-warning-contrast);
254
- }
327
+ css `
328
+ .layout {
329
+ display: flex;
330
+ flex-direction: column;
331
+ gap: var(--uui-size-space-4);
332
+ }
333
+
334
+ uui-input {
335
+ width: 100%;
336
+ }
337
+
338
+ .actions {
339
+ padding-left: calc(200px + var(--uui-size-layout-2));
340
+ }
341
+
342
+ .temporary-content {
343
+ display: flex;
344
+ align-items: center;
345
+ justify-content: space-between;
346
+ gap: var(--uui-size-space-5);
347
+ }
348
+
349
+ .temporary-content > uui-icon {
350
+ font-size: 26pt;
351
+ flex-shrink: 0;
352
+ }
353
+
354
+ .temporary-text {
355
+ flex-grow: 1;
356
+ }
357
+
358
+ .alert-positive {
359
+ background-color: var(--uui-color-positive);
360
+ color: var(--uui-color-positive-contrast);
361
+ }
362
+
363
+ .copy-value {
364
+ display: flex;
365
+ gap: var(--uui-size-space-2);
366
+ }
367
+
368
+ .alert-content {
369
+ display: flex;
370
+ justify-content: space-between;
371
+ }
372
+
373
+ .alert-content > div {
374
+ display: flex;
375
+ gap: 10px;
376
+ }
377
+
378
+ .alert-danger {
379
+ background-color: var(--uui-color-danger);
380
+ color: var(--uui-color-danger-contrast);
381
+ }
382
+
383
+ .alert-default {
384
+ background-color: var(--uui-color-default);
385
+ color: var(--uui-color-default-contrast);
386
+ }
387
+
388
+ .alert-warning {
389
+ background-color: var(--uui-color-warning);
390
+ color: var(--uui-color-warning-contrast);
391
+ }
255
392
  `,
256
393
  ];
257
394
  __decorate([
258
395
  state()
259
396
  ], uSyncLicenceViewElement.prototype, "saveState", void 0);
397
+ __decorate([
398
+ state()
399
+ ], uSyncLicenceViewElement.prototype, "_temporaryResult", void 0);
400
+ __decorate([
401
+ state()
402
+ ], uSyncLicenceViewElement.prototype, "_requestingTemporary", void 0);
260
403
  __decorate([
261
404
  state()
262
405
  ], uSyncLicenceViewElement.prototype, "licence", void 0);
@@ -12,4 +12,5 @@ export declare class uSyncLicenceRepository extends UmbControllerBase {
12
12
  getLicenceStatus(): Promise<import("@umbraco-cms/backoffice/repository").UmbDataSourceResponse<import("..").LicenceStatusView>>;
13
13
  isLicenced(): Promise<import("@umbraco-cms/backoffice/repository").UmbDataSourceResponse<boolean>>;
14
14
  saveLicence(licence: LicenceInfo): Promise<import("@umbraco-cms/backoffice/repository").UmbDataSourceResponse<boolean>>;
15
+ requestTemporaryLicence(): Promise<import("@umbraco-cms/backoffice/repository").UmbDataSourceResponse<import("..").TemporaryLicenceResult>>;
15
16
  }
@@ -38,5 +38,8 @@ export class uSyncLicenceRepository extends UmbControllerBase {
38
38
  async saveLicence(licence) {
39
39
  return __classPrivateFieldGet(this, _uSyncLicenceRepository_licenceDataSource, "f").saveLicence(licence);
40
40
  }
41
+ async requestTemporaryLicence() {
42
+ return __classPrivateFieldGet(this, _uSyncLicenceRepository_licenceDataSource, "f").requestTemporaryLicence();
43
+ }
41
44
  }
42
45
  _uSyncLicenceRepository_licenceDataSource = new WeakMap();
@@ -1,5 +1,5 @@
1
1
  import { UmbDataSourceResponse } from '@umbraco-cms/backoffice/repository';
2
- import { Licence, LicenceInfo, LicenceStatusView } from '@jumoo/usync-expansions';
2
+ import { Licence, LicenceInfo, LicenceStatusView, TemporaryLicenceResult } from '@jumoo/usync-expansions';
3
3
  import { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api';
4
4
  export interface uSyncLicenceSource {
5
5
  }
@@ -12,4 +12,5 @@ export declare class uSyncLicenceSource implements uSyncLicenceSource {
12
12
  getLicenceStatus(product: string, version: string): Promise<UmbDataSourceResponse<LicenceStatusView>>;
13
13
  isLicenced(product: string, version: string): Promise<UmbDataSourceResponse<boolean>>;
14
14
  saveLicence(licence: LicenceInfo): Promise<UmbDataSourceResponse<boolean>>;
15
+ requestTemporaryLicence(): Promise<UmbDataSourceResponse<TemporaryLicenceResult>>;
15
16
  }
@@ -35,5 +35,8 @@ export class uSyncLicenceSource {
35
35
  async saveLicence(licence) {
36
36
  return await tryExecute(__classPrivateFieldGet(this, _uSyncLicenceSource_host, "f"), LicenceService.saveLicence({ body: licence }));
37
37
  }
38
+ async requestTemporaryLicence() {
39
+ return await tryExecute(__classPrivateFieldGet(this, _uSyncLicenceSource_host, "f"), LicenceService.requestTemporaryLicence());
40
+ }
38
41
  }
39
42
  _uSyncLicenceSource_host = new WeakMap();
@@ -61,10 +61,10 @@ let uSyncRestorePointTableElement = class uSyncRestorePointTableElement extends
61
61
  };
62
62
  })
63
63
  .filter((item) => item !== undefined);
64
- return html `<umb-table
65
- .config=${this._tableConfig}
66
- .columns=${this._tableColumns}
67
- .items=${items}
64
+ return html `<umb-table
65
+ .config=${this._tableConfig}
66
+ .columns=${this._tableColumns}
67
+ .items=${items}
68
68
  .filter=${this.filter}></umb-table>`;
69
69
  }
70
70
  renderStatus(restorePoint) {
@@ -80,23 +80,23 @@ let uSyncRestorePointTableElement = class uSyncRestorePointTableElement extends
80
80
  }
81
81
  renderActions(restorePoint) {
82
82
  const isComplete = restorePoint.status === RestorePointStatus.COMPLETE || restorePoint.status === undefined;
83
- return html ` <uui-button
84
- compact
85
- label="restore"
86
- color="positive"
87
- look="default"
88
- ?disabled=${!isComplete}
89
- @click=${() => __classPrivateFieldGet(this, _uSyncRestorePointTableElement_instances, "m", _uSyncRestorePointTableElement_onRestore).call(this, restorePoint)}>
90
- <uui-icon name="icon-paper-plane"></uui-icon>
91
- </uui-button>
92
-
93
- <uui-button
94
- compact
95
- label="delete"
96
- color="danger"
97
- look="default"
98
- @click=${() => __classPrivateFieldGet(this, _uSyncRestorePointTableElement_instances, "m", _uSyncRestorePointTableElement_onDelete).call(this, restorePoint)}>
99
- <uui-icon name="icon-trash"></uui-icon>
83
+ return html ` <uui-button
84
+ compact
85
+ label="restore"
86
+ color="positive"
87
+ look="default"
88
+ ?disabled=${!isComplete}
89
+ @click=${() => __classPrivateFieldGet(this, _uSyncRestorePointTableElement_instances, "m", _uSyncRestorePointTableElement_onRestore).call(this, restorePoint)}>
90
+ <uui-icon name="icon-paper-plane"></uui-icon>
91
+ </uui-button>
92
+
93
+ <uui-button
94
+ compact
95
+ label="delete"
96
+ color="danger"
97
+ look="default"
98
+ @click=${() => __classPrivateFieldGet(this, _uSyncRestorePointTableElement_instances, "m", _uSyncRestorePointTableElement_onDelete).call(this, restorePoint)}>
99
+ <uui-icon name="icon-trash"></uui-icon>
100
100
  </uui-button>`;
101
101
  }
102
102
  };
@@ -7,13 +7,13 @@ export default {
7
7
  },
8
8
  uSyncRestore: {
9
9
  title: 'Restore points',
10
- intro: `<p>
11
- Restore points can be created manually, or as part of a process such as a push or pull from
12
- another site
13
- </p>
14
- <p>
15
- By default only the last 10 restore points are kept, you can restore from any restore point, but you migth
16
- well loose your current content, setting or files as part of the process.
10
+ intro: `<p>
11
+ Restore points can be created manually, or as part of a process such as a push or pull from
12
+ another site
13
+ </p>
14
+ <p>
15
+ By default only the last 10 restore points are kept, you can restore from any restore point, but you migth
16
+ well loose your current content, setting or files as part of the process.
17
17
  </p>`,
18
18
  scan: 'Scan restore folder',
19
19
  restoreLatest: 'Restore from latest',
@@ -22,10 +22,10 @@ export default {
22
22
  createSummary: 'Your restore point has been created.',
23
23
  restorePoints: 'Restore points',
24
24
  restoreTitle: 'Restore Umbraco settings and content',
25
- restoreIntro: `
26
- <p>A restore can help fix problems the might be causing your site to not work show the right content</p>
27
- <p>A restore will reset all the settings, content and (if included media), back to the way it was at the specified point in time.</p>
28
- <p style="color: var(--uui-color-danger)">You will loose any changes that you have made this this restore point, so you should be sure you want to restore.</p>
25
+ restoreIntro: `
26
+ <p>A restore can help fix problems that might be stopping your site from working or showing the right content.</p>
27
+ <p>A restore will reset all the settings, content and (if included media), back to the way it was at the specified point in time.</p>
28
+ <p style="color: var(--uui-color-danger)">You will lose any changes that you have made since this restore point, so you should be sure you want to restore.</p>
29
29
  `,
30
30
  restoreCheck: 'Check restore',
31
31
  restoreInfo: 'Restore to this point?',
@@ -4,7 +4,7 @@ import { UmbContextToken } from '@umbraco-cms/backoffice/context-api';
4
4
  export declare class SyncRestoreContext extends UmbControllerBase {
5
5
  #private;
6
6
  constructor(host: UmbControllerHost);
7
- getRestorePoint(key: string): Promise<import("..").RestorePoint | undefined>;
7
+ getRestorePoint(key: string): Promise<import("..").RestorePoint>;
8
8
  }
9
9
  export default SyncRestoreContext;
10
10
  export declare const USYNC_RESTORE_CONTEXT: UmbContextToken<SyncRestoreContext, SyncRestoreContext>;
@@ -5,11 +5,16 @@ export declare class SyncRestoreRepository extends UmbControllerBase {
5
5
  constructor(host: UmbControllerHost);
6
6
  clean(): Promise<unknown>;
7
7
  remove(id: string): Promise<unknown>;
8
- getAll(): Promise<import("..").RestorePoint[] | undefined>;
9
- get(key: string): Promise<import("..").RestorePoint | undefined>;
10
- getReport(id: string): Promise<import("..").USyncAction[] | undefined>;
8
+ getAll(): Promise<import("..").RestorePoint[]>;
9
+ get(key: string): Promise<import("..").RestorePoint>;
10
+ getReport(id: string): Promise<import("..").USyncAction[]>;
11
+ /**
12
+ * what restoring an item from the restore point in a report would do to it.
13
+ * handlers that don't support previews return a 404, so there's no notification.
14
+ */
15
+ getPreview(id: string, handler: string, key: string): Promise<import("..").SyncItemPreviewResponse>;
11
16
  scan(): Promise<{
12
17
  [key: string]: string | number;
13
- } | undefined>;
18
+ }>;
14
19
  }
15
20
  export default SyncRestoreRepository;
@@ -35,6 +35,13 @@ export class SyncRestoreRepository extends UmbControllerBase {
35
35
  return (await tryExecute(__classPrivateFieldGet(this, _SyncRestoreRepository_host, "f"), RestoreService.getReport({ query: { id } })))
36
36
  .data;
37
37
  }
38
+ /**
39
+ * what restoring an item from the restore point in a report would do to it.
40
+ * handlers that don't support previews return a 404, so there's no notification.
41
+ */
42
+ async getPreview(id, handler, key) {
43
+ return (await tryExecute(__classPrivateFieldGet(this, _SyncRestoreRepository_host, "f"), RestoreService.getPreview({ query: { id, handler, key } }), { disableNotifications: true })).data;
44
+ }
38
45
  async scan() {
39
46
  return (await tryExecute(__classPrivateFieldGet(this, _SyncRestoreRepository_host, "f"), RestoreService.scan())).data;
40
47
  }
@@ -14,15 +14,15 @@ let uSyncRestoreCreateCompleteElement = class uSyncRestoreCreateCompleteElement
14
14
  render() {
15
15
  const results = this.results;
16
16
  const options = this.options;
17
- return html `<uui-box>
18
- <p>
19
- Restore point created:
20
- <strong>${options.title}</strong>
21
- </p>
22
-
23
- <umb-localize key="uSyncRestore_createComplete"></umb-localize>
24
-
25
- <p>Contains ${results.results['changes'] ?? 'unknown'} items</p>
17
+ return html `<uui-box>
18
+ <p>
19
+ Restore point created:
20
+ <strong>${options.title}</strong>
21
+ </p>
22
+
23
+ <umb-localize key="uSyncRestore_createComplete"></umb-localize>
24
+
25
+ <p>Contains ${results.results['changes'] ?? 'unknown'} items</p>
26
26
  </uui-box>`;
27
27
  }
28
28
  };