@jumoo/usync-expansions 0.0.0-stage → 17.6.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 (140) hide show
  1. package/dist/api/client/client.gen.d.ts +2 -0
  2. package/dist/api/client/client.gen.js +235 -0
  3. package/dist/api/client/index.d.ts +8 -0
  4. package/dist/api/client/index.js +6 -0
  5. package/dist/api/client/types.gen.d.ts +117 -0
  6. package/dist/api/client/types.gen.js +2 -0
  7. package/dist/api/client/utils.gen.d.ts +33 -0
  8. package/dist/api/client/utils.gen.js +230 -0
  9. package/dist/api/client.gen.d.ts +12 -0
  10. package/dist/api/client.gen.js +4 -0
  11. package/dist/api/core/auth.gen.d.ts +18 -0
  12. package/dist/api/core/auth.gen.js +14 -0
  13. package/dist/api/core/bodySerializer.gen.d.ts +25 -0
  14. package/dist/api/core/bodySerializer.gen.js +57 -0
  15. package/dist/api/core/params.gen.d.ts +43 -0
  16. package/dist/api/core/params.gen.js +100 -0
  17. package/dist/api/core/pathSerializer.gen.d.ts +33 -0
  18. package/dist/api/core/pathSerializer.gen.js +106 -0
  19. package/dist/api/core/queryKeySerializer.gen.d.ts +18 -0
  20. package/dist/api/core/queryKeySerializer.gen.js +92 -0
  21. package/dist/api/core/serverSentEvents.gen.d.ts +71 -0
  22. package/dist/api/core/serverSentEvents.gen.js +133 -0
  23. package/dist/api/core/types.gen.d.ts +78 -0
  24. package/dist/api/core/types.gen.js +2 -0
  25. package/dist/api/core/utils.gen.d.ts +19 -0
  26. package/dist/api/core/utils.gen.js +87 -0
  27. package/dist/api/index.d.ts +3 -0
  28. package/dist/api/index.js +4 -0
  29. package/dist/api/sdk.gen.d.ts +37 -0
  30. package/dist/api/sdk.gen.js +112 -0
  31. package/dist/api/types.gen.d.ts +1251 -0
  32. package/dist/api/types.gen.js +255 -0
  33. package/dist/background/background-cancel.controller.d.ts +16 -0
  34. package/dist/background/background-cancel.controller.js +83 -0
  35. package/dist/background/background-pipeline.repository.d.ts +18 -0
  36. package/dist/background/background-pipeline.repository.js +33 -0
  37. package/dist/background/components/constants.d.ts +5 -0
  38. package/dist/background/components/constants.js +5 -0
  39. package/dist/background/components/index.d.ts +5 -0
  40. package/dist/background/components/index.js +5 -0
  41. package/dist/background/components/pending-list.element.d.ts +18 -0
  42. package/dist/background/components/pending-list.element.js +69 -0
  43. package/dist/background/components/pipelines-table.element.d.ts +15 -0
  44. package/dist/background/components/pipelines-table.element.js +60 -0
  45. package/dist/background/components/process-list.element.d.ts +10 -0
  46. package/dist/background/components/process-list.element.js +69 -0
  47. package/dist/background/components/queue-table.element.d.ts +15 -0
  48. package/dist/background/components/queue-table.element.js +50 -0
  49. package/dist/background/index.d.ts +1 -0
  50. package/dist/background/index.js +1 -0
  51. package/dist/background/manifest.d.ts +1 -0
  52. package/dist/background/manifest.js +24 -0
  53. package/dist/background/workspace/background-workspace-element.d.ts +10 -0
  54. package/dist/background/workspace/background-workspace-element.js +71 -0
  55. package/dist/components/index.d.ts +2 -0
  56. package/dist/components/index.js +2 -0
  57. package/dist/components/report-summary-view.d.ts +23 -0
  58. package/dist/components/report-summary-view.js +199 -0
  59. package/dist/components/usync-property-layout.d.ts +17 -0
  60. package/dist/components/usync-property-layout.js +159 -0
  61. package/dist/exports.d.ts +6 -0
  62. package/dist/exports.js +6 -0
  63. package/dist/hey-api.d.ts +11 -0
  64. package/dist/hey-api.js +14 -0
  65. package/dist/index.d.ts +5 -0
  66. package/dist/index.js +19 -0
  67. package/dist/items/index.d.ts +2 -0
  68. package/dist/items/index.js +2 -0
  69. package/dist/items/manifests.d.ts +1 -0
  70. package/dist/items/manifests.js +7 -0
  71. package/dist/items/sync-item.context.d.ts +10 -0
  72. package/dist/items/sync-item.context.js +29 -0
  73. package/dist/items/sync-item.repository.d.ts +17 -0
  74. package/dist/items/sync-item.repository.js +37 -0
  75. package/dist/lang/en.d.ts +30 -0
  76. package/dist/lang/en.js +29 -0
  77. package/dist/lang/manifest.d.ts +1 -0
  78. package/dist/lang/manifest.js +11 -0
  79. package/dist/licence/components/index.d.ts +2 -0
  80. package/dist/licence/components/index.js +2 -0
  81. package/dist/licence/components/licence-notice.d.ts +10 -0
  82. package/dist/licence/components/licence-notice.js +55 -0
  83. package/dist/licence/components/licence-status.view.d.ts +14 -0
  84. package/dist/licence/components/licence-status.view.js +50 -0
  85. package/dist/licence/components/styles.d.ts +1 -0
  86. package/dist/licence/components/styles.js +41 -0
  87. package/dist/licence/index.d.ts +5 -0
  88. package/dist/licence/index.js +5 -0
  89. package/dist/licence/lang/en.d.ts +17 -0
  90. package/dist/licence/lang/en.js +17 -0
  91. package/dist/licence/lang/manifests.d.ts +1 -0
  92. package/dist/licence/lang/manifests.js +13 -0
  93. package/dist/licence/licence.context.d.ts +17 -0
  94. package/dist/licence/licence.context.js +66 -0
  95. package/dist/licence/licence.element.d.ts +19 -0
  96. package/dist/licence/licence.element.js +270 -0
  97. package/dist/licence/licence.repository.d.ts +15 -0
  98. package/dist/licence/licence.repository.js +42 -0
  99. package/dist/licence/manifest.d.ts +2 -0
  100. package/dist/licence/manifest.js +31 -0
  101. package/dist/licence/source/licence.source.d.ts +15 -0
  102. package/dist/licence/source/licence.source.js +39 -0
  103. package/dist/menu/manifest.d.ts +1 -0
  104. package/dist/menu/manifest.js +12 -0
  105. package/dist/restore/components/index.d.ts +1 -0
  106. package/dist/restore/components/index.js +1 -0
  107. package/dist/restore/components/restore-point-table.element.d.ts +21 -0
  108. package/dist/restore/components/restore-point-table.element.js +126 -0
  109. package/dist/restore/constants.d.ts +23 -0
  110. package/dist/restore/constants.js +30 -0
  111. package/dist/restore/index.d.ts +7 -0
  112. package/dist/restore/index.js +7 -0
  113. package/dist/restore/lang/en.d.ts +23 -0
  114. package/dist/restore/lang/en.js +33 -0
  115. package/dist/restore/lang/manifest.d.ts +1 -0
  116. package/dist/restore/lang/manifest.js +11 -0
  117. package/dist/restore/manifest.d.ts +1 -0
  118. package/dist/restore/manifest.js +63 -0
  119. package/dist/restore/restore.context.d.ts +10 -0
  120. package/dist/restore/restore.context.js +29 -0
  121. package/dist/restore/restore.repository.d.ts +15 -0
  122. package/dist/restore/restore.repository.js +43 -0
  123. package/dist/restore/steps/manifest.d.ts +1 -0
  124. package/dist/restore/steps/manifest.js +36 -0
  125. package/dist/restore/steps/restore-create-complete.d.ts +6 -0
  126. package/dist/restore/steps/restore-create-complete.js +33 -0
  127. package/dist/restore/steps/restore-create-element.d.ts +9 -0
  128. package/dist/restore/steps/restore-create-element.js +97 -0
  129. package/dist/restore/steps/restore-report-config-element.d.ts +14 -0
  130. package/dist/restore/steps/restore-report-config-element.js +105 -0
  131. package/dist/restore/steps/restore-report-element.d.ts +6 -0
  132. package/dist/restore/steps/restore-report-element.js +39 -0
  133. package/dist/restore/workspace/restore.workspace-view.element.d.ts +24 -0
  134. package/dist/restore/workspace/restore.workspace-view.element.js +195 -0
  135. package/dist/restore/workspace/restore.workspace.context.d.ts +17 -0
  136. package/dist/restore/workspace/restore.workspace.context.js +52 -0
  137. package/dist/restore/workspace/restore.workspace.element.d.ts +12 -0
  138. package/dist/restore/workspace/restore.workspace.element.js +91 -0
  139. package/package.json +54 -6
  140. package/README.md +0 -3
@@ -0,0 +1,270 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
8
+ if (kind === "m") throw new TypeError("Private method is not writable");
9
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
10
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
11
+ return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
12
+ };
13
+ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
14
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
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
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
17
+ };
18
+ var _uSyncLicenceViewElement_instances, _uSyncLicenceViewElement_licenceContext, _uSyncLicenceViewElement_saveLicence, _uSyncLicenceViewElement_updateDomains, _uSyncLicenceViewElement_updateKey, _uSyncLicenceViewElement_clearLicence;
19
+ import { UmbElementMixin } from '@umbraco-cms/backoffice/element-api';
20
+ import { LitElement, css, customElement, html, nothing, state, when, } from '@umbraco-cms/backoffice/external/lit';
21
+ import { USYNC_LICENCE_CONTEXT_TOKEN, } from '@jumoo/usync-expansions';
22
+ import { UmbTextStyles } from '@umbraco-cms/backoffice/style';
23
+ import { UMB_CONFIRM_MODAL, UMB_MODAL_MANAGER_CONTEXT, } from '@umbraco-cms/backoffice/modal';
24
+ let uSyncLicenceViewElement = class uSyncLicenceViewElement extends UmbElementMixin(LitElement) {
25
+ constructor() {
26
+ super();
27
+ _uSyncLicenceViewElement_instances.add(this);
28
+ _uSyncLicenceViewElement_licenceContext.set(this, void 0);
29
+ this.licence = {
30
+ key: 'key',
31
+ domains: 'domains',
32
+ };
33
+ this.licenceStatus = undefined;
34
+ this.consumeContext(USYNC_LICENCE_CONTEXT_TOKEN, (_context) => {
35
+ if (!_context)
36
+ return;
37
+ __classPrivateFieldSet(this, _uSyncLicenceViewElement_licenceContext, _context, "f");
38
+ _context.refresh();
39
+ this.observe(_context.licence, (_licence) => {
40
+ this.licence = {
41
+ key: _licence?.key ?? '',
42
+ domains: _licence?.domains ?? '',
43
+ };
44
+ this.requestUpdate('licence');
45
+ });
46
+ this.observe(_context.licenceStatus, (_status) => {
47
+ this.licenceStatus = _status;
48
+ this.requestUpdate('licenceStatus');
49
+ });
50
+ });
51
+ }
52
+ connectedCallback() {
53
+ super.connectedCallback();
54
+ }
55
+ 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
+ >
63
+ `;
64
+ }
65
+ renderStatus() {
66
+ return html `
67
+ <usync-licence-status .licenceStatus=${this.licenceStatus}></usync-licence-status>
68
+ `;
69
+ }
70
+ renderDetails() {
71
+ 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>
119
+ `
120
+ : nothing;
121
+ }
122
+ renderSubscription() {
123
+ if (this.licenceStatus?.licenceType !== 'Subscription')
124
+ return nothing;
125
+ if (!this.licenceStatus?.expires)
126
+ return nothing;
127
+ const expiresDate = new Date(this.licenceStatus.expires);
128
+ if (expiresDate >= new Date('9999-12-30'))
129
+ 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
+ >
140
+ </uui-box>`;
141
+ }
142
+ renderExpiration() {
143
+ if (!this.licenceStatus?.expires)
144
+ return nothing;
145
+ const expiresDate = new Date(this.licenceStatus.expires);
146
+ if (expiresDate >= new Date('9999-12-30'))
147
+ return nothing;
148
+ const today = new Date();
149
+ const remainingDays = Math.ceil((expiresDate.getTime() - today.getTime()) / (1000 * 60 * 60 * 24));
150
+ if (expiresDate < today) {
151
+ return html `<uui-box class="alert alert-danger">
152
+ <umb-localize key="usynccomplete_licenceExpired"></umb-localize>
153
+ </uui-box>`;
154
+ }
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>
173
+ </uui-box>`;
174
+ }
175
+ };
176
+ _uSyncLicenceViewElement_licenceContext = new WeakMap();
177
+ _uSyncLicenceViewElement_instances = new WeakSet();
178
+ _uSyncLicenceViewElement_saveLicence = async function _uSyncLicenceViewElement_saveLicence() {
179
+ this.saveState = 'waiting';
180
+ await __classPrivateFieldGet(this, _uSyncLicenceViewElement_licenceContext, "f")?.saveLicence(this.licence);
181
+ this.saveState = 'success';
182
+ };
183
+ _uSyncLicenceViewElement_updateDomains = function _uSyncLicenceViewElement_updateDomains(e) {
184
+ const value = e.target.value;
185
+ this.licence.domains = value;
186
+ this.requestUpdate('licence');
187
+ };
188
+ _uSyncLicenceViewElement_updateKey = function _uSyncLicenceViewElement_updateKey(e) {
189
+ const value = e.target.value;
190
+ this.licence.key = value;
191
+ };
192
+ _uSyncLicenceViewElement_clearLicence = async function _uSyncLicenceViewElement_clearLicence() {
193
+ const modalManager = await this.getContext(UMB_MODAL_MANAGER_CONTEXT);
194
+ if (!modalManager)
195
+ return;
196
+ const confirmModal = modalManager.open(this, UMB_CONFIRM_MODAL, {
197
+ data: {
198
+ headline: this.localize.term('usynccomplete_licenceClearHeading'),
199
+ content: this.localize.term('usynccomplete_licenceClearContent'),
200
+ confirmLabel: this.localize.term('general_clear'),
201
+ color: 'danger',
202
+ },
203
+ });
204
+ confirmModal
205
+ .onSubmit()
206
+ .then(async () => {
207
+ await __classPrivateFieldGet(this, _uSyncLicenceViewElement_licenceContext, "f")?.saveLicence({ key: '', domains: '' });
208
+ this.requestUpdate('licence');
209
+ })
210
+ .catch(() => {
211
+ // console.log('cancel');
212
+ });
213
+ };
214
+ uSyncLicenceViewElement.styles = [
215
+ 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
+ }
255
+ `,
256
+ ];
257
+ __decorate([
258
+ state()
259
+ ], uSyncLicenceViewElement.prototype, "saveState", void 0);
260
+ __decorate([
261
+ state()
262
+ ], uSyncLicenceViewElement.prototype, "licence", void 0);
263
+ __decorate([
264
+ state()
265
+ ], uSyncLicenceViewElement.prototype, "licenceStatus", void 0);
266
+ uSyncLicenceViewElement = __decorate([
267
+ customElement('usync-licence-view')
268
+ ], uSyncLicenceViewElement);
269
+ export { uSyncLicenceViewElement };
270
+ export default uSyncLicenceViewElement;
@@ -0,0 +1,15 @@
1
+ import { UmbControllerBase } from '@umbraco-cms/backoffice/class-api';
2
+ import { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api';
3
+ import { LicenceInfo } from '@jumoo/usync-expansions';
4
+ export declare class uSyncLicenceRepository extends UmbControllerBase {
5
+ #private;
6
+ product: string;
7
+ version: string;
8
+ constructor(host: UmbControllerHost);
9
+ checkLegacy(): Promise<import("@umbraco-cms/backoffice/repository").UmbDataSourceResponse<string>>;
10
+ getLicence(): Promise<import("@umbraco-cms/backoffice/repository").UmbDataSourceResponse<import("@jumoo/usync-expansions").Licence>>;
11
+ getLicenceInfo(): Promise<import("@umbraco-cms/backoffice/repository").UmbDataSourceResponse<LicenceInfo>>;
12
+ getLicenceStatus(): Promise<import("@umbraco-cms/backoffice/repository").UmbDataSourceResponse<import("@jumoo/usync-expansions").LicenceStatusView>>;
13
+ isLicenced(): Promise<import("@umbraco-cms/backoffice/repository").UmbDataSourceResponse<boolean>>;
14
+ saveLicence(licence: LicenceInfo): Promise<import("@umbraco-cms/backoffice/repository").UmbDataSourceResponse<boolean>>;
15
+ }
@@ -0,0 +1,42 @@
1
+ var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
2
+ if (kind === "m") throw new TypeError("Private method is not writable");
3
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
4
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
5
+ return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
6
+ };
7
+ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
8
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
9
+ 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");
10
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
11
+ };
12
+ var _uSyncLicenceRepository_licenceDataSource;
13
+ import { UmbControllerBase } from '@umbraco-cms/backoffice/class-api';
14
+ import { uSyncLicenceSource } from '@jumoo/usync-expansions';
15
+ export class uSyncLicenceRepository extends UmbControllerBase {
16
+ constructor(host) {
17
+ super(host);
18
+ _uSyncLicenceRepository_licenceDataSource.set(this, void 0);
19
+ this.product = 'uSync.Complete';
20
+ this.version = '15.0.0';
21
+ __classPrivateFieldSet(this, _uSyncLicenceRepository_licenceDataSource, new uSyncLicenceSource(this), "f");
22
+ }
23
+ async checkLegacy() {
24
+ return __classPrivateFieldGet(this, _uSyncLicenceRepository_licenceDataSource, "f").checkLegacy(this.product, this.version);
25
+ }
26
+ async getLicence() {
27
+ return __classPrivateFieldGet(this, _uSyncLicenceRepository_licenceDataSource, "f").getLicence(this.product, this.version);
28
+ }
29
+ async getLicenceInfo() {
30
+ return __classPrivateFieldGet(this, _uSyncLicenceRepository_licenceDataSource, "f").getLicenceInfo(this.product, this.version);
31
+ }
32
+ async getLicenceStatus() {
33
+ return __classPrivateFieldGet(this, _uSyncLicenceRepository_licenceDataSource, "f").getLicenceStatus(this.product, this.version);
34
+ }
35
+ async isLicenced() {
36
+ return __classPrivateFieldGet(this, _uSyncLicenceRepository_licenceDataSource, "f").isLicenced(this.product, this.version);
37
+ }
38
+ async saveLicence(licence) {
39
+ return __classPrivateFieldGet(this, _uSyncLicenceRepository_licenceDataSource, "f").saveLicence(licence);
40
+ }
41
+ }
42
+ _uSyncLicenceRepository_licenceDataSource = new WeakMap();
@@ -0,0 +1,2 @@
1
+ import './components/index.js';
2
+ export declare const manifests: import("@umbraco-cms/backoffice/extension-api").ManifestBase[];
@@ -0,0 +1,31 @@
1
+ import { manifests as localizations } from './lang/manifests.js';
2
+ import './components/index.js';
3
+ import { UMB_CURRENT_USER_IS_ADMIN_CONDITION_ALIAS } from '@umbraco-cms/backoffice/current-user';
4
+ const licenceContext = {
5
+ type: 'globalContext',
6
+ alias: 'usync.licence.context',
7
+ name: 'uSync licence context',
8
+ js: () => import('./licence.context.js'),
9
+ };
10
+ const licenceView = {
11
+ type: 'workspaceView',
12
+ alias: 'usync-extensions-licence-view',
13
+ name: 'uSync Licence view',
14
+ js: () => import('./licence.element.js'),
15
+ weight: 100,
16
+ meta: {
17
+ label: 'Licence',
18
+ pathname: 'licence',
19
+ icon: 'icon-certificate',
20
+ },
21
+ conditions: [
22
+ {
23
+ alias: 'Umb.Condition.WorkspaceAlias',
24
+ match: 'usync.workspace',
25
+ },
26
+ {
27
+ alias: UMB_CURRENT_USER_IS_ADMIN_CONDITION_ALIAS,
28
+ },
29
+ ],
30
+ };
31
+ export const manifests = [licenceContext, licenceView, ...localizations];
@@ -0,0 +1,15 @@
1
+ import { UmbDataSourceResponse } from '@umbraco-cms/backoffice/repository';
2
+ import { Licence, LicenceInfo, LicenceStatusView } from '@jumoo/usync-expansions';
3
+ import { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api';
4
+ export interface uSyncLicenceSource {
5
+ }
6
+ export declare class uSyncLicenceSource implements uSyncLicenceSource {
7
+ #private;
8
+ constructor(host: UmbControllerHost);
9
+ checkLegacy(product: string, version: string): Promise<UmbDataSourceResponse<string>>;
10
+ getLicence(product: string, version: string): Promise<UmbDataSourceResponse<Licence>>;
11
+ getLicenceInfo(product: string, version: string): Promise<UmbDataSourceResponse<LicenceInfo>>;
12
+ getLicenceStatus(product: string, version: string): Promise<UmbDataSourceResponse<LicenceStatusView>>;
13
+ isLicenced(product: string, version: string): Promise<UmbDataSourceResponse<boolean>>;
14
+ saveLicence(licence: LicenceInfo): Promise<UmbDataSourceResponse<boolean>>;
15
+ }
@@ -0,0 +1,39 @@
1
+ var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
2
+ if (kind === "m") throw new TypeError("Private method is not writable");
3
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
4
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
5
+ return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
6
+ };
7
+ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
8
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
9
+ 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");
10
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
11
+ };
12
+ var _uSyncLicenceSource_host;
13
+ import { LicenceService, } from '@jumoo/usync-expansions';
14
+ import { tryExecute } from '@umbraco-cms/backoffice/resources';
15
+ export class uSyncLicenceSource {
16
+ constructor(host) {
17
+ _uSyncLicenceSource_host.set(this, void 0);
18
+ __classPrivateFieldSet(this, _uSyncLicenceSource_host, host, "f");
19
+ }
20
+ async checkLegacy(product, version) {
21
+ return await tryExecute(__classPrivateFieldGet(this, _uSyncLicenceSource_host, "f"), LicenceService.checkLegacy({ query: { product: product, version: version } }));
22
+ }
23
+ async getLicence(product, version) {
24
+ return await tryExecute(__classPrivateFieldGet(this, _uSyncLicenceSource_host, "f"), LicenceService.getLicence({ query: { product: product, version: version } }));
25
+ }
26
+ async getLicenceInfo(product, version) {
27
+ return await tryExecute(__classPrivateFieldGet(this, _uSyncLicenceSource_host, "f"), LicenceService.getLicence({ query: { product: product, version: version } }));
28
+ }
29
+ async getLicenceStatus(product, version) {
30
+ return await tryExecute(__classPrivateFieldGet(this, _uSyncLicenceSource_host, "f"), LicenceService.getLicenceStatus({ query: { product: product, version: version } }));
31
+ }
32
+ async isLicenced(product, version) {
33
+ return await tryExecute(__classPrivateFieldGet(this, _uSyncLicenceSource_host, "f"), LicenceService.isLicenced({ query: { product: product, version: version } }));
34
+ }
35
+ async saveLicence(licence) {
36
+ return await tryExecute(__classPrivateFieldGet(this, _uSyncLicenceSource_host, "f"), LicenceService.saveLicence({ body: licence }));
37
+ }
38
+ }
39
+ _uSyncLicenceSource_host = new WeakMap();
@@ -0,0 +1 @@
1
+ export declare const manifests: import("@jumoo/usync").ManifestuSyncMenuItem[];
@@ -0,0 +1,12 @@
1
+ const menuItem = {
2
+ type: 'usync-menuItem',
3
+ alias: 'usync.menu.extensions',
4
+ name: 'extensions',
5
+ meta: {
6
+ label: 'Extensions',
7
+ icon: 'icon-brick',
8
+ entityType: 'usync-menu-entry',
9
+ menus: ['usync.menu'],
10
+ },
11
+ };
12
+ export const manifests = [menuItem];
@@ -0,0 +1 @@
1
+ export * from './restore-point-table.element';
@@ -0,0 +1 @@
1
+ export * from './restore-point-table.element';
@@ -0,0 +1,21 @@
1
+ import { nothing } from '@umbraco-cms/backoffice/external/lit';
2
+ import { UmbLitElement } from '@umbraco-cms/backoffice/lit-element';
3
+ import { RestorePoint } from '@jumoo/usync-expansions';
4
+ import { UmbTableColumn, UmbTableConfig } from '@umbraco-cms/backoffice/components';
5
+ /**
6
+ * @element usync-restore-point-table
7
+ * @property {Array<RestorePoint>} restorePoints - The restore points to display
8
+ * @fires delete-restore-point - When the delete options is selected
9
+ * @fires restore-restore-point - When the restore options is selected
10
+ */
11
+ export declare class uSyncRestorePointTableElement extends UmbLitElement {
12
+ #private;
13
+ restorePoints?: RestorePoint[];
14
+ _tableConfig: UmbTableConfig;
15
+ _tableColumns: UmbTableColumn[];
16
+ filter: any;
17
+ render(): typeof nothing | import("lit-html").TemplateResult<1>;
18
+ renderStatus(restorePoint: RestorePoint): import("lit-html").TemplateResult<1>;
19
+ renderActions(restorePoint: RestorePoint): import("lit-html").TemplateResult<1>;
20
+ }
21
+ export default uSyncRestorePointTableElement;
@@ -0,0 +1,126 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
8
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
9
+ 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");
10
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
11
+ };
12
+ var _uSyncRestorePointTableElement_instances, _uSyncRestorePointTableElement_onDelete, _uSyncRestorePointTableElement_onRestore;
13
+ import { customElement, html, nothing, property, state, } from '@umbraco-cms/backoffice/external/lit';
14
+ import { UmbLitElement } from '@umbraco-cms/backoffice/lit-element';
15
+ import { RestorePointStatus } from '@jumoo/usync-expansions';
16
+ import { TimeOptions } from '@jumoo/usync-expansions';
17
+ /**
18
+ * @element usync-restore-point-table
19
+ * @property {Array<RestorePoint>} restorePoints - The restore points to display
20
+ * @fires delete-restore-point - When the delete options is selected
21
+ * @fires restore-restore-point - When the restore options is selected
22
+ */
23
+ let uSyncRestorePointTableElement = class uSyncRestorePointTableElement extends UmbLitElement {
24
+ constructor() {
25
+ super(...arguments);
26
+ _uSyncRestorePointTableElement_instances.add(this);
27
+ this._tableConfig = {
28
+ allowSelection: false,
29
+ hideIcon: false,
30
+ };
31
+ this._tableColumns = [
32
+ { name: 'Created', alias: 'created' },
33
+ { name: 'Name', alias: 'name' },
34
+ { name: 'Source', alias: 'action' },
35
+ { name: 'User', alias: 'user' },
36
+ { name: 'Status', alias: 'status' },
37
+ { name: '', alias: 'actions' },
38
+ ];
39
+ }
40
+ render() {
41
+ if (!this.restorePoints || this.restorePoints.length === 0)
42
+ return nothing;
43
+ const items = this.restorePoints
44
+ .map((restorePoint) => {
45
+ if (!restorePoint)
46
+ return undefined;
47
+ return {
48
+ id: restorePoint.key,
49
+ icon: 'icon-pushpin',
50
+ data: [
51
+ {
52
+ columnAlias: 'created',
53
+ value: this.localize.date(restorePoint.created, TimeOptions),
54
+ },
55
+ { columnAlias: 'name', value: restorePoint.name },
56
+ { columnAlias: 'action', value: restorePoint.action },
57
+ { columnAlias: 'user', value: restorePoint.user },
58
+ { columnAlias: 'status', value: html `${this.renderStatus(restorePoint)}` },
59
+ { columnAlias: 'actions', value: html `${this.renderActions(restorePoint)}` },
60
+ ],
61
+ };
62
+ })
63
+ .filter((item) => item !== undefined);
64
+ return html `<umb-table
65
+ .config=${this._tableConfig}
66
+ .columns=${this._tableColumns}
67
+ .items=${items}
68
+ .filter=${this.filter}></umb-table>`;
69
+ }
70
+ renderStatus(restorePoint) {
71
+ switch (restorePoint.status) {
72
+ case RestorePointStatus.PENDING:
73
+ return html `<uui-tag color="warning" look="secondary">Compressing</uui-tag>`;
74
+ case RestorePointStatus.FAILED:
75
+ return html `<uui-tag color="danger" look="secondary">Failed</uui-tag>`;
76
+ case RestorePointStatus.COMPLETE:
77
+ default:
78
+ return html `<uui-tag color="positive" look="secondary">Complete</uui-tag>`;
79
+ }
80
+ }
81
+ renderActions(restorePoint) {
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>
100
+ </uui-button>`;
101
+ }
102
+ };
103
+ _uSyncRestorePointTableElement_instances = new WeakSet();
104
+ _uSyncRestorePointTableElement_onDelete = function _uSyncRestorePointTableElement_onDelete(restorePoint) {
105
+ this.dispatchEvent(new CustomEvent('delete-restore-point', { detail: restorePoint }));
106
+ };
107
+ _uSyncRestorePointTableElement_onRestore = function _uSyncRestorePointTableElement_onRestore(restorePoint) {
108
+ this.dispatchEvent(new CustomEvent('restore-restore-point', { detail: restorePoint }));
109
+ };
110
+ __decorate([
111
+ property({ type: Array })
112
+ ], uSyncRestorePointTableElement.prototype, "restorePoints", void 0);
113
+ __decorate([
114
+ state()
115
+ ], uSyncRestorePointTableElement.prototype, "_tableConfig", void 0);
116
+ __decorate([
117
+ state()
118
+ ], uSyncRestorePointTableElement.prototype, "_tableColumns", void 0);
119
+ __decorate([
120
+ state()
121
+ ], uSyncRestorePointTableElement.prototype, "filter", void 0);
122
+ uSyncRestorePointTableElement = __decorate([
123
+ customElement('usync-restore-point-table')
124
+ ], uSyncRestorePointTableElement);
125
+ export { uSyncRestorePointTableElement };
126
+ export default uSyncRestorePointTableElement;
@@ -0,0 +1,23 @@
1
+ export declare const uSyncRestore: {
2
+ workspace: string;
3
+ context: string;
4
+ entity: string;
5
+ element: string;
6
+ icon: string;
7
+ processing: {
8
+ pipeline: string;
9
+ strategies: {
10
+ create: string;
11
+ restore: string;
12
+ report: string;
13
+ createAndRestore: string;
14
+ };
15
+ };
16
+ steps: {
17
+ restoreCreateStep: string;
18
+ restoreCreateComplete: string;
19
+ restoreReportConfigStep: string;
20
+ restoreReportStep: string;
21
+ };
22
+ };
23
+ export declare const TimeOptions: Intl.DateTimeFormatOptions;
@@ -0,0 +1,30 @@
1
+ export const uSyncRestore = {
2
+ workspace: 'usync.restore.workspace',
3
+ context: 'usync.restore.workspace.context',
4
+ entity: 'usync-restore-entry',
5
+ element: 'usync-restore-workspace-element',
6
+ icon: 'icon-paper-plane',
7
+ processing: {
8
+ pipeline: 'restorePointsPipeline',
9
+ strategies: {
10
+ create: 'restorePointCreate',
11
+ restore: 'restorePointRestore',
12
+ report: 'restorePointReport',
13
+ createAndRestore: 'restorePointCreateAndRestore',
14
+ },
15
+ },
16
+ steps: {
17
+ restoreCreateStep: 'usync-restore-create-config',
18
+ restoreCreateComplete: 'usync-restore-create-complete',
19
+ restoreReportConfigStep: 'usync-restore-report-config',
20
+ restoreReportStep: 'usync-restore-report',
21
+ },
22
+ };
23
+ export const TimeOptions = {
24
+ year: 'numeric',
25
+ month: 'long',
26
+ day: 'numeric',
27
+ hour: 'numeric',
28
+ minute: 'numeric',
29
+ second: 'numeric',
30
+ };
@@ -0,0 +1,7 @@
1
+ import './components';
2
+ export * from './constants.js';
3
+ export * from './restore.context.js';
4
+ export * from './restore.repository.js';
5
+ export * from './workspace/restore.workspace.context.js';
6
+ export * from './workspace/restore.workspace.element.js';
7
+ export * from './workspace/restore.workspace-view.element.js';