@nascentdigital/funnel-cms 4.4.4
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/api/AssetClient.d.ts +53 -0
- package/dist/api/AssetClient.js +2 -0
- package/dist/api/AssetUploadClient.d.ts +17 -0
- package/dist/api/AssetUploadClient.js +26 -0
- package/dist/api/AuthClient.d.ts +29 -0
- package/dist/api/AuthClient.js +2 -0
- package/dist/api/ChangeSetClient.d.ts +84 -0
- package/dist/api/ChangeSetClient.js +31 -0
- package/dist/api/CollectionClient.d.ts +187 -0
- package/dist/api/CollectionClient.js +2 -0
- package/dist/api/ContentClient.d.ts +43 -0
- package/dist/api/ContentClient.js +34 -0
- package/dist/api/IAssetApiClient.d.ts +9 -0
- package/dist/api/IAssetApiClient.js +2 -0
- package/dist/api/PageClient.d.ts +264 -0
- package/dist/api/PageClient.js +2 -0
- package/dist/api/SiteClient.d.ts +23 -0
- package/dist/api/SiteClient.js +2 -0
- package/dist/api/SiteConfigClient.d.ts +26 -0
- package/dist/api/SiteConfigClient.js +2 -0
- package/dist/api/UpgradeClient.d.ts +16 -0
- package/dist/api/UpgradeClient.js +2 -0
- package/dist/api/UserClient.d.ts +46 -0
- package/dist/api/UserClient.js +2 -0
- package/dist/api/index.d.ts +11 -0
- package/dist/api/index.js +27 -0
- package/dist/errors/CMSError.d.ts +8 -0
- package/dist/errors/CMSError.js +17 -0
- package/dist/errors/CMSErrors.d.ts +5 -0
- package/dist/errors/CMSErrors.js +36 -0
- package/dist/errors/LinkedDependantsError.d.ts +21 -0
- package/dist/errors/LinkedDependantsError.js +31 -0
- package/dist/errors/LockdownError.d.ts +4 -0
- package/dist/errors/LockdownError.js +12 -0
- package/dist/errors/SlugValidationError.d.ts +21 -0
- package/dist/errors/SlugValidationError.js +23 -0
- package/dist/errors/TranslateReferencesError.d.ts +21 -0
- package/dist/errors/TranslateReferencesError.js +22 -0
- package/dist/errors/index.d.ts +4 -0
- package/dist/errors/index.js +25 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +19 -0
- package/dist/models/Entity.d.ts +14 -0
- package/dist/models/Entity.js +2 -0
- package/dist/models/Environment.d.ts +1 -0
- package/dist/models/Environment.js +2 -0
- package/dist/models/Pagination.d.ts +20 -0
- package/dist/models/Pagination.js +21 -0
- package/dist/models/Privilege.d.ts +57 -0
- package/dist/models/Privilege.js +163 -0
- package/dist/models/Role.d.ts +33 -0
- package/dist/models/Role.js +118 -0
- package/dist/models/SiteConfig.d.ts +14 -0
- package/dist/models/SiteConfig.js +2 -0
- package/dist/models/Upgrade.d.ts +40 -0
- package/dist/models/Upgrade.js +19 -0
- package/dist/models/User.d.ts +41 -0
- package/dist/models/User.js +71 -0
- package/dist/models/Versioned.d.ts +22 -0
- package/dist/models/Versioned.js +45 -0
- package/dist/models/index.d.ts +9 -0
- package/dist/models/index.js +25 -0
- package/dist/strapi/IStrapiContentClient.d.ts +39 -0
- package/dist/strapi/IStrapiContentClient.js +2 -0
- package/dist/strapi/Strapi.d.ts +37 -0
- package/dist/strapi/Strapi.js +156 -0
- package/dist/strapi/StrapiAssetClient.d.ts +11 -0
- package/dist/strapi/StrapiAssetClient.js +143 -0
- package/dist/strapi/StrapiAssetUploadClient.d.ts +6 -0
- package/dist/strapi/StrapiAssetUploadClient.js +109 -0
- package/dist/strapi/StrapiAuthClient.d.ts +9 -0
- package/dist/strapi/StrapiAuthClient.js +64 -0
- package/dist/strapi/StrapiChangeSetClient.d.ts +22 -0
- package/dist/strapi/StrapiChangeSetClient.js +218 -0
- package/dist/strapi/StrapiCollectionClient.d.ts +18 -0
- package/dist/strapi/StrapiCollectionClient.js +610 -0
- package/dist/strapi/StrapiContentClient.d.ts +38 -0
- package/dist/strapi/StrapiContentClient.js +105 -0
- package/dist/strapi/StrapiContentClientFactory.d.ts +13 -0
- package/dist/strapi/StrapiContentClientFactory.js +19 -0
- package/dist/strapi/StrapiPageClient.d.ts +23 -0
- package/dist/strapi/StrapiPageClient.js +882 -0
- package/dist/strapi/StrapiSiteConfigClient.d.ts +8 -0
- package/dist/strapi/StrapiSiteConfigClient.js +50 -0
- package/dist/strapi/StrapiUpgradeClient.d.ts +13 -0
- package/dist/strapi/StrapiUpgradeClient.js +118 -0
- package/dist/strapi/StrapiUserClient.d.ts +17 -0
- package/dist/strapi/StrapiUserClient.js +199 -0
- package/dist/strapi/client.d.ts +1 -0
- package/dist/strapi/client.js +17 -0
- package/dist/strapi/index.d.ts +3 -0
- package/dist/strapi/index.js +19 -0
- package/dist/strapi/models/StrapiAsset.d.ts +10 -0
- package/dist/strapi/models/StrapiAsset.js +16 -0
- package/dist/strapi/models/StrapiData.d.ts +13 -0
- package/dist/strapi/models/StrapiData.js +16 -0
- package/dist/strapi/models/StrapiFile.d.ts +18 -0
- package/dist/strapi/models/StrapiFile.js +2 -0
- package/dist/strapi/models/index.d.ts +3 -0
- package/dist/strapi/models/index.js +19 -0
- package/dist/strapi/serialization/ChangeSetData.d.ts +15 -0
- package/dist/strapi/serialization/ChangeSetData.js +76 -0
- package/dist/strapi/serialization/CollectionData.d.ts +57 -0
- package/dist/strapi/serialization/CollectionData.js +258 -0
- package/dist/strapi/serialization/CollectionSnapshotData.d.ts +16 -0
- package/dist/strapi/serialization/CollectionSnapshotData.js +66 -0
- package/dist/strapi/serialization/PageData.d.ts +126 -0
- package/dist/strapi/serialization/PageData.js +335 -0
- package/dist/strapi/serialization/PageSnapshotData.d.ts +20 -0
- package/dist/strapi/serialization/PageSnapshotData.js +69 -0
- package/dist/strapi/serialization/RoleData.d.ts +5 -0
- package/dist/strapi/serialization/RoleData.js +2 -0
- package/dist/strapi/serialization/SiteConfigData.d.ts +11 -0
- package/dist/strapi/serialization/SiteConfigData.js +23 -0
- package/dist/strapi/serialization/StrapiAssetData.d.ts +17 -0
- package/dist/strapi/serialization/StrapiAssetData.js +39 -0
- package/dist/strapi/serialization/UserData.d.ts +18 -0
- package/dist/strapi/serialization/UserData.js +42 -0
- package/dist/strapi/serialization/VersionData.d.ts +26 -0
- package/dist/strapi/serialization/VersionData.js +88 -0
- package/dist/strapi/serialization/index.d.ts +10 -0
- package/dist/strapi/serialization/index.js +26 -0
- package/dist/strapi/test.d.ts +563 -0
- package/dist/strapi/test.js +1131 -0
- package/package.json +42 -0
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
import { Language, RequiredBy, Schema } from '@nascentdigital/funnel-core';
|
|
2
|
+
import { Environment, Pagination } from '../models';
|
|
3
|
+
/**
|
|
4
|
+
* Provides access to (and management of) {@link Page} related models.
|
|
5
|
+
*/
|
|
6
|
+
export interface PageClient {
|
|
7
|
+
/**
|
|
8
|
+
* Provides a high-level overview of the available pages for a site.
|
|
9
|
+
*/
|
|
10
|
+
getOverview(args: PageClient.GetOverview.Args): Promise<PageClient.GetOverview.Result>;
|
|
11
|
+
/**
|
|
12
|
+
* Fetches a summary of all page content for a given brand.
|
|
13
|
+
*/
|
|
14
|
+
getSummaries(args: PageClient.GetSummaries.Args): Promise<PageClient.GetSummaries.Result>;
|
|
15
|
+
/**
|
|
16
|
+
* Fetches a summary of all page content for a given brand.
|
|
17
|
+
*/
|
|
18
|
+
getPreviews(args: PageClient.GetPreviews.Args): Promise<PageClient.GetPreviews.Result>;
|
|
19
|
+
/**
|
|
20
|
+
* Searches for pages, returning links to the pages.
|
|
21
|
+
*/
|
|
22
|
+
search(args: PageClient.Search.Args): Promise<PageClient.Search.Result>;
|
|
23
|
+
/**
|
|
24
|
+
* Query page previews with customizable sorting.
|
|
25
|
+
*/
|
|
26
|
+
query(args: PageClient.Query.Args): Promise<PageClient.Query.Result>;
|
|
27
|
+
/**
|
|
28
|
+
* Find pages based on query
|
|
29
|
+
*/
|
|
30
|
+
find(args: PageClient.Find.Args): Promise<PageClient.Find.Result>;
|
|
31
|
+
/**
|
|
32
|
+
* Fetches the details for a specific page, including a group of all related pages (if any) for the same
|
|
33
|
+
* target (brand, type, region, and optional slug), OR `undefined` if no pages exist for the target.
|
|
34
|
+
*/
|
|
35
|
+
getGroup(args: PageClient.GetGroup.Args): Promise<PageClient.GetGroup.Result>;
|
|
36
|
+
/**
|
|
37
|
+
* Fetches the details for a specific page for a given brand
|
|
38
|
+
*/
|
|
39
|
+
get(args: PageClient.Get.Args): Promise<PageClient.Get.Result>;
|
|
40
|
+
/**
|
|
41
|
+
* Create a new page.
|
|
42
|
+
*/
|
|
43
|
+
create(args: PageClient.Create.Args): Promise<PageClient.Create.Result>;
|
|
44
|
+
/**
|
|
45
|
+
* Duplicate page or page's language
|
|
46
|
+
*/
|
|
47
|
+
duplicate(args: PageClient.Duplicate.Args): Promise<PageClient.Duplicate.Result>;
|
|
48
|
+
/**
|
|
49
|
+
* Updates an existing page.
|
|
50
|
+
*/
|
|
51
|
+
update(args: PageClient.Update.Args): Promise<PageClient.Update.Result>;
|
|
52
|
+
/**
|
|
53
|
+
* Replaces an existing page with a new value - paves over the existing page.
|
|
54
|
+
*/
|
|
55
|
+
replace(args: PageClient.Replace.Args): Promise<PageClient.Replace.Result>;
|
|
56
|
+
/**
|
|
57
|
+
* Touches an existing page - used for migrations to simply load/save a page (also support direct updates to
|
|
58
|
+
* "published" content).
|
|
59
|
+
*/
|
|
60
|
+
touch(args: PageClient.Touch.Args): Promise<PageClient.Touch.Result>;
|
|
61
|
+
/**
|
|
62
|
+
* Unpublishes a page
|
|
63
|
+
*/
|
|
64
|
+
unpublish(args: PageClient.Unpublish.Args): Promise<PageClient.Unpublish.Result>;
|
|
65
|
+
/**
|
|
66
|
+
* Fetch items that depend on a page
|
|
67
|
+
*/
|
|
68
|
+
getDependants(args: PageClient.GetDependants.Args): Promise<PageClient.GetDependants.Result>;
|
|
69
|
+
/**
|
|
70
|
+
* Fetch items that a page has dependencies on
|
|
71
|
+
*/
|
|
72
|
+
getDependencies(args: PageClient.GetDependencies.Args): Promise<PageClient.GetDependencies.Result>;
|
|
73
|
+
/**
|
|
74
|
+
* Check slug format and availability
|
|
75
|
+
*/
|
|
76
|
+
validateSlug(args: PageClient.ValidateSlug.Args): Promise<PageClient.ValidateSlug.Result>;
|
|
77
|
+
}
|
|
78
|
+
export declare namespace PageClient {
|
|
79
|
+
namespace Query {
|
|
80
|
+
export type Paginated = Base & Criteria & WithPagination;
|
|
81
|
+
export type By<TCriteria extends Criteria.Key> = Base & RequiredBy<Criteria, TCriteria>;
|
|
82
|
+
export type PaginatedBy<TCriteria extends Criteria.Key> = By<TCriteria> & WithPagination;
|
|
83
|
+
export type ByDetails = Omit<By<'brand' | 'region' | 'language'>, 'type'> & {
|
|
84
|
+
type: Schema.Page.Type;
|
|
85
|
+
};
|
|
86
|
+
export type PaginatedByDetails = ByDetails & WithPagination;
|
|
87
|
+
export type ById = Base & {
|
|
88
|
+
id: Schema.Page.Id;
|
|
89
|
+
};
|
|
90
|
+
export type PaginatedById = ById & WithPagination;
|
|
91
|
+
export type ByGroupId = Base & {
|
|
92
|
+
groupId: Schema.Page.GroupId;
|
|
93
|
+
};
|
|
94
|
+
export type PaginatedByGroupId = ByGroupId & WithPagination;
|
|
95
|
+
export type ByBrand = Base & {
|
|
96
|
+
brand: string;
|
|
97
|
+
};
|
|
98
|
+
export type ByBrandAndRegion = ByBrand & {
|
|
99
|
+
region: string;
|
|
100
|
+
};
|
|
101
|
+
export type TagsMatch = 'any' | 'all';
|
|
102
|
+
type Base = {
|
|
103
|
+
version: Environment;
|
|
104
|
+
};
|
|
105
|
+
type WithPagination = {
|
|
106
|
+
pagination: Pagination;
|
|
107
|
+
};
|
|
108
|
+
export type Criteria = {
|
|
109
|
+
groupId?: Schema.Page.GroupId;
|
|
110
|
+
brand?: string;
|
|
111
|
+
type?: Schema.Page.Type | Schema.Page.Type[];
|
|
112
|
+
slug?: string;
|
|
113
|
+
name?: string;
|
|
114
|
+
language?: Language;
|
|
115
|
+
region?: string;
|
|
116
|
+
tags?: Schema.Tag.Data[];
|
|
117
|
+
tagsMatch?: TagsMatch;
|
|
118
|
+
};
|
|
119
|
+
export namespace Criteria {
|
|
120
|
+
type Key = keyof Criteria;
|
|
121
|
+
}
|
|
122
|
+
export {};
|
|
123
|
+
}
|
|
124
|
+
type Update = {
|
|
125
|
+
id: Schema.Page.Id;
|
|
126
|
+
slug?: string;
|
|
127
|
+
publication?: number | null;
|
|
128
|
+
errors: boolean;
|
|
129
|
+
updates: ReadonlyArray<Schema.Page.Update>;
|
|
130
|
+
};
|
|
131
|
+
namespace GetOverview {
|
|
132
|
+
type Args = Query.ByBrandAndRegion;
|
|
133
|
+
type Result = {
|
|
134
|
+
static: StaticPage[];
|
|
135
|
+
dynamic: DynamicPage[];
|
|
136
|
+
};
|
|
137
|
+
type StaticPage = {
|
|
138
|
+
type: Schema.Page.Type;
|
|
139
|
+
refs: Record<Language, Schema.Page.Data.AsLink>;
|
|
140
|
+
};
|
|
141
|
+
type DynamicPage = {
|
|
142
|
+
type: Schema.Page.Type;
|
|
143
|
+
count: number;
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
namespace GetSummaries {
|
|
147
|
+
type Args = Query.By<'brand'> & {
|
|
148
|
+
ids?: Schema.Page.Id[];
|
|
149
|
+
};
|
|
150
|
+
type Result = Schema.Page.Data.AsLink[];
|
|
151
|
+
}
|
|
152
|
+
namespace GetPreviews {
|
|
153
|
+
type Args = Query.PaginatedBy<'brand' | 'type'>;
|
|
154
|
+
type Result = Pagination.Paginated<Schema.Page.Data.AsPreview>;
|
|
155
|
+
}
|
|
156
|
+
namespace Search {
|
|
157
|
+
type Args = Query.Paginated;
|
|
158
|
+
type Result = Pagination.Paginated<Schema.Page.Data.AsLink>;
|
|
159
|
+
}
|
|
160
|
+
namespace Query {
|
|
161
|
+
type Args = Query.PaginatedBy<'brand' | 'region' | 'language'> & {
|
|
162
|
+
sort?: Schema.PageQuery.Sort;
|
|
163
|
+
excludeIds?: Schema.Page.Id[];
|
|
164
|
+
};
|
|
165
|
+
type Result = Pagination.Paginated<Schema.Page.Data.AsPreview>;
|
|
166
|
+
}
|
|
167
|
+
namespace Find {
|
|
168
|
+
type Args = Query.Paginated;
|
|
169
|
+
type Result = Pagination.Paginated<Schema.Page.Data>;
|
|
170
|
+
}
|
|
171
|
+
namespace GetGroup {
|
|
172
|
+
type Args = Query.ByDetails;
|
|
173
|
+
type Result = Schema.Page.Data.AsGroup;
|
|
174
|
+
}
|
|
175
|
+
namespace Get {
|
|
176
|
+
type Args = Query.ById | Query.ByDetails;
|
|
177
|
+
type Result = Schema.Page.Data | undefined;
|
|
178
|
+
}
|
|
179
|
+
namespace Create {
|
|
180
|
+
type Args = NewArgs | NewLanguageArgs;
|
|
181
|
+
type NewArgs = Schema.Page.Data.AsNew;
|
|
182
|
+
type NewLanguageArgs = Schema.Page.Data.AsNewLanguage;
|
|
183
|
+
type Result = Schema.Page.Data.AsGroup;
|
|
184
|
+
}
|
|
185
|
+
namespace Duplicate {
|
|
186
|
+
type CurrentArgs = {
|
|
187
|
+
source: Schema.Page.Id;
|
|
188
|
+
targetPage: 'current';
|
|
189
|
+
targetLanguage: Language;
|
|
190
|
+
targetSlug?: string;
|
|
191
|
+
};
|
|
192
|
+
type NewArgs = {
|
|
193
|
+
source: Schema.Page.Id;
|
|
194
|
+
targetPage: 'new';
|
|
195
|
+
targetLanguage: Language;
|
|
196
|
+
targetSlug: string;
|
|
197
|
+
};
|
|
198
|
+
type Args = CurrentArgs | NewArgs;
|
|
199
|
+
type Result = Schema.Page.Data.AsGroup;
|
|
200
|
+
}
|
|
201
|
+
namespace Touch {
|
|
202
|
+
type Args = {
|
|
203
|
+
id: Schema.Page.Id;
|
|
204
|
+
version: Environment;
|
|
205
|
+
};
|
|
206
|
+
type Result = Schema.Page.Data.AsLink;
|
|
207
|
+
}
|
|
208
|
+
namespace Update {
|
|
209
|
+
type Args = Update;
|
|
210
|
+
type Result = Schema.Page.Data;
|
|
211
|
+
}
|
|
212
|
+
namespace Replace {
|
|
213
|
+
type Args = {
|
|
214
|
+
page: Schema.Page.Data;
|
|
215
|
+
version: Environment;
|
|
216
|
+
skipSync?: boolean;
|
|
217
|
+
};
|
|
218
|
+
type Result = Schema.Page.Data;
|
|
219
|
+
}
|
|
220
|
+
namespace Unpublish {
|
|
221
|
+
type Args = Schema.Page.Id;
|
|
222
|
+
type Result = boolean;
|
|
223
|
+
}
|
|
224
|
+
namespace GetDependants {
|
|
225
|
+
type Args = {
|
|
226
|
+
id: Schema.Page.Id;
|
|
227
|
+
version: Environment;
|
|
228
|
+
};
|
|
229
|
+
type Result = {
|
|
230
|
+
pages: Schema.Page.Data.AsLink[];
|
|
231
|
+
};
|
|
232
|
+
}
|
|
233
|
+
namespace GetDependencies {
|
|
234
|
+
type Args = {
|
|
235
|
+
id: Schema.Page.Id;
|
|
236
|
+
version: Environment;
|
|
237
|
+
};
|
|
238
|
+
type Result = {
|
|
239
|
+
pages: Schema.Page.Data.AsLink[];
|
|
240
|
+
collections: Schema.Collection.Data.AsLink[];
|
|
241
|
+
};
|
|
242
|
+
}
|
|
243
|
+
namespace ValidateSlug {
|
|
244
|
+
type Args = {
|
|
245
|
+
brand: string;
|
|
246
|
+
type: Schema.Page.Type;
|
|
247
|
+
region: string;
|
|
248
|
+
slug: string;
|
|
249
|
+
groupId?: Schema.Page.GroupId;
|
|
250
|
+
};
|
|
251
|
+
type InvalidResult = {
|
|
252
|
+
status: 'invalid';
|
|
253
|
+
message: string;
|
|
254
|
+
};
|
|
255
|
+
type AvailableResult = {
|
|
256
|
+
status: 'available';
|
|
257
|
+
};
|
|
258
|
+
type UnavailableResult = {
|
|
259
|
+
status: 'unavailable';
|
|
260
|
+
takenBy: Schema.Page.Data.AsLink;
|
|
261
|
+
};
|
|
262
|
+
type Result = InvalidResult | AvailableResult | UnavailableResult;
|
|
263
|
+
}
|
|
264
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Provides access to (and management of) {@link Site} related models.
|
|
3
|
+
*/
|
|
4
|
+
export interface SiteClient {
|
|
5
|
+
/**
|
|
6
|
+
* Fetches the details for a specific Site for a given brand
|
|
7
|
+
*/
|
|
8
|
+
get(args: SiteClient.Get.Args): Promise<SiteClient.Get.Result>;
|
|
9
|
+
/**
|
|
10
|
+
* Updates an existing site.
|
|
11
|
+
*/
|
|
12
|
+
update(args: SiteClient.Update.Args): Promise<SiteClient.Update.Result>;
|
|
13
|
+
}
|
|
14
|
+
export declare namespace SiteClient {
|
|
15
|
+
namespace Get {
|
|
16
|
+
type Args = {};
|
|
17
|
+
type Result = {};
|
|
18
|
+
}
|
|
19
|
+
namespace Get {
|
|
20
|
+
type Args = {};
|
|
21
|
+
type Result = {};
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { SiteConfig } from '../models';
|
|
2
|
+
/**
|
|
3
|
+
* Provides access to (and management of) {@link SiteConfigClient} related models.
|
|
4
|
+
*/
|
|
5
|
+
export interface SiteConfigClient {
|
|
6
|
+
/**
|
|
7
|
+
* Fetches the details for a specific Site for a given brand
|
|
8
|
+
*/
|
|
9
|
+
get(args: SiteConfigClient.Get.Args): Promise<SiteConfigClient.Get.Result>;
|
|
10
|
+
/**
|
|
11
|
+
* Updates an existing site.
|
|
12
|
+
*/
|
|
13
|
+
update(args: SiteConfigClient.Update.Args): Promise<SiteConfigClient.Update.Result>;
|
|
14
|
+
}
|
|
15
|
+
export declare namespace SiteConfigClient {
|
|
16
|
+
namespace Get {
|
|
17
|
+
type Args = {
|
|
18
|
+
brand: string;
|
|
19
|
+
};
|
|
20
|
+
type Result = SiteConfig.Data;
|
|
21
|
+
}
|
|
22
|
+
namespace Update {
|
|
23
|
+
type Args = SiteConfig.Data.Update;
|
|
24
|
+
type Result = SiteConfig.Data | undefined;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Upgrade } from '../models';
|
|
2
|
+
/**
|
|
3
|
+
* Provides management of CMS versioning.
|
|
4
|
+
*/
|
|
5
|
+
export interface UpgradeClient {
|
|
6
|
+
status(): Promise<Upgrade.Status>;
|
|
7
|
+
upgrade(): Promise<Upgrade.Status>;
|
|
8
|
+
}
|
|
9
|
+
export declare namespace UpgradeClient {
|
|
10
|
+
namespace GetStatus {
|
|
11
|
+
type Result = Upgrade.Status;
|
|
12
|
+
}
|
|
13
|
+
namespace ExecuteUpgrade {
|
|
14
|
+
type Result = Upgrade.Status;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { User } from '../models';
|
|
2
|
+
/**
|
|
3
|
+
* Provides management of {@link User} models
|
|
4
|
+
*/
|
|
5
|
+
export interface UserClient {
|
|
6
|
+
me(): Promise<UserClient.Me.Result>;
|
|
7
|
+
getUsers(args?: UserClient.GetUsers.Args): Promise<UserClient.GetUsers.Result>;
|
|
8
|
+
getUser(args: UserClient.GetUser.Args): Promise<UserClient.GetUser.Result>;
|
|
9
|
+
createUser(args: UserClient.CreateUser.Args): Promise<UserClient.CreateUser.Result>;
|
|
10
|
+
updateUser(args: UserClient.UpdateUser.Args): Promise<UserClient.UpdateUser.Result>;
|
|
11
|
+
resetUser(args: UserClient.ResetUser.Args): Promise<UserClient.ResetUser.Result>;
|
|
12
|
+
deleteUser(args: UserClient.DeleteUser.Args): Promise<UserClient.DeleteUser.Result>;
|
|
13
|
+
}
|
|
14
|
+
export declare namespace UserClient {
|
|
15
|
+
namespace Me {
|
|
16
|
+
type Result = User.Data | undefined;
|
|
17
|
+
}
|
|
18
|
+
namespace GetUsers {
|
|
19
|
+
type Args = {
|
|
20
|
+
brand?: string;
|
|
21
|
+
};
|
|
22
|
+
type Result = User.Data[];
|
|
23
|
+
}
|
|
24
|
+
namespace GetUser {
|
|
25
|
+
type Args = User.Id;
|
|
26
|
+
type Result = User.Data | undefined;
|
|
27
|
+
}
|
|
28
|
+
namespace CreateUser {
|
|
29
|
+
type Args = User.Data.Create;
|
|
30
|
+
type Result = User.Data;
|
|
31
|
+
}
|
|
32
|
+
namespace UpdateUser {
|
|
33
|
+
type Args = User.Data.Update;
|
|
34
|
+
type Result = User.Data;
|
|
35
|
+
}
|
|
36
|
+
namespace ResetUser {
|
|
37
|
+
type Args = {
|
|
38
|
+
email: string;
|
|
39
|
+
};
|
|
40
|
+
type Result = void;
|
|
41
|
+
}
|
|
42
|
+
namespace DeleteUser {
|
|
43
|
+
type Args = User.Id;
|
|
44
|
+
type Result = boolean;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export * from './AssetClient';
|
|
2
|
+
export * from './AssetUploadClient';
|
|
3
|
+
export * from './AuthClient';
|
|
4
|
+
export * from './ChangeSetClient';
|
|
5
|
+
export * from './CollectionClient';
|
|
6
|
+
export * from './ContentClient';
|
|
7
|
+
export * from './IAssetApiClient';
|
|
8
|
+
export * from './PageClient';
|
|
9
|
+
export * from './SiteConfigClient';
|
|
10
|
+
export * from './UpgradeClient';
|
|
11
|
+
export * from './UserClient';
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./AssetClient"), exports);
|
|
18
|
+
__exportStar(require("./AssetUploadClient"), exports);
|
|
19
|
+
__exportStar(require("./AuthClient"), exports);
|
|
20
|
+
__exportStar(require("./ChangeSetClient"), exports);
|
|
21
|
+
__exportStar(require("./CollectionClient"), exports);
|
|
22
|
+
__exportStar(require("./ContentClient"), exports);
|
|
23
|
+
__exportStar(require("./IAssetApiClient"), exports);
|
|
24
|
+
__exportStar(require("./PageClient"), exports);
|
|
25
|
+
__exportStar(require("./SiteConfigClient"), exports);
|
|
26
|
+
__exportStar(require("./UpgradeClient"), exports);
|
|
27
|
+
__exportStar(require("./UserClient"), exports);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { IsometricError, IsometricErrorModule } from '@nascentdigital/funnel-core';
|
|
2
|
+
export declare class CMSError extends IsometricError {
|
|
3
|
+
constructor(args: CMSError.ConstructorArgs);
|
|
4
|
+
}
|
|
5
|
+
export declare namespace CMSError {
|
|
6
|
+
const moduleId: IsometricErrorModule.Id;
|
|
7
|
+
type ConstructorArgs = IsometricError.ConstructorArgs.WithoutModuleId;
|
|
8
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CMSError = void 0;
|
|
4
|
+
const funnel_core_1 = require("@nascentdigital/funnel-core");
|
|
5
|
+
// class
|
|
6
|
+
class CMSError extends funnel_core_1.IsometricError {
|
|
7
|
+
constructor(args) {
|
|
8
|
+
// construct base
|
|
9
|
+
super(Object.assign(Object.assign({}, args), { moduleId: CMSError.moduleId }));
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
exports.CMSError = CMSError;
|
|
13
|
+
// extension
|
|
14
|
+
(function (CMSError) {
|
|
15
|
+
// constants
|
|
16
|
+
CMSError.moduleId = 'cms';
|
|
17
|
+
})(CMSError || (exports.CMSError = CMSError = {}));
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { IsometricError, IsometricErrorModule, SerializedIsometricError } from '@nascentdigital/funnel-core';
|
|
2
|
+
export declare class CMSErrors implements IsometricErrorModule {
|
|
3
|
+
readonly id: IsometricErrorModule.Id;
|
|
4
|
+
deserialize(data: SerializedIsometricError): IsometricError | undefined;
|
|
5
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CMSErrors = void 0;
|
|
4
|
+
const CMSError_1 = require("./CMSError");
|
|
5
|
+
const LinkedDependantsError_1 = require("./LinkedDependantsError");
|
|
6
|
+
const LockdownError_1 = require("./LockdownError");
|
|
7
|
+
const SlugValidationError_1 = require("./SlugValidationError");
|
|
8
|
+
const TranslateReferencesError_1 = require("./TranslateReferencesError");
|
|
9
|
+
// module
|
|
10
|
+
class CMSErrors {
|
|
11
|
+
constructor() {
|
|
12
|
+
this.id = CMSError_1.CMSError.moduleId;
|
|
13
|
+
}
|
|
14
|
+
deserialize(data) {
|
|
15
|
+
// skip if module doesn't match
|
|
16
|
+
if (data.moduleId !== this.id) {
|
|
17
|
+
return undefined;
|
|
18
|
+
}
|
|
19
|
+
// convert
|
|
20
|
+
switch (data.name) {
|
|
21
|
+
// re-hydrate error
|
|
22
|
+
case LinkedDependantsError_1.LinkedDependantsError.name:
|
|
23
|
+
return new LinkedDependantsError_1.LinkedDependantsError(data);
|
|
24
|
+
case LockdownError_1.LockdownError.name:
|
|
25
|
+
return new LockdownError_1.LockdownError(data);
|
|
26
|
+
case TranslateReferencesError_1.TranslateReferencesError.name:
|
|
27
|
+
return new TranslateReferencesError_1.TranslateReferencesError(data);
|
|
28
|
+
case SlugValidationError_1.SlugValidationError.name:
|
|
29
|
+
return new SlugValidationError_1.SlugValidationError(data);
|
|
30
|
+
// or ignore if not matching
|
|
31
|
+
default:
|
|
32
|
+
return undefined;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
exports.CMSErrors = CMSErrors;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Schema, SerializedIsometricError } from '@nascentdigital/funnel-core';
|
|
2
|
+
import type { PageClient } from '../api';
|
|
3
|
+
import { CMSError } from './CMSError';
|
|
4
|
+
export declare class LinkedDependantsError extends CMSError {
|
|
5
|
+
readonly pages: ReadonlyArray<Schema.Page.Data.AsLink>;
|
|
6
|
+
readonly collections: ReadonlyArray<Schema.Collection.Data.AsLink>;
|
|
7
|
+
constructor({ message, pages, collections, ...args }: LinkedDependantsError.ConstructorArgs);
|
|
8
|
+
serialize(): LinkedDependantsError.Serialized;
|
|
9
|
+
}
|
|
10
|
+
export declare namespace LinkedDependantsError {
|
|
11
|
+
type Reason = PageClient.ValidateSlug.InvalidResult | PageClient.ValidateSlug.UnavailableResult;
|
|
12
|
+
type ConstructorArgs = Omit<CMSError.ConstructorArgs, 'message'> & {
|
|
13
|
+
message?: string;
|
|
14
|
+
pages?: ReadonlyArray<Schema.Page.Data.AsLink>;
|
|
15
|
+
collections?: ReadonlyArray<Schema.Collection.Data.AsLink>;
|
|
16
|
+
};
|
|
17
|
+
type Serialized = SerializedIsometricError & {
|
|
18
|
+
pages: Schema.Page.Data.AsLink[];
|
|
19
|
+
collections: Schema.Collection.Data.AsLink[];
|
|
20
|
+
};
|
|
21
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
exports.LinkedDependantsError = void 0;
|
|
15
|
+
const CMSError_1 = require("./CMSError");
|
|
16
|
+
// class
|
|
17
|
+
class LinkedDependantsError extends CMSError_1.CMSError {
|
|
18
|
+
constructor(_a) {
|
|
19
|
+
var { message = 'This operation cannot be completed because it would break dependencies.', pages = [], collections = [] } = _a, args = __rest(_a, ["message", "pages", "collections"]);
|
|
20
|
+
// construct base
|
|
21
|
+
super(Object.assign(Object.assign({}, args), { message }));
|
|
22
|
+
// initialize instance variables
|
|
23
|
+
this.pages = pages;
|
|
24
|
+
this.collections = collections;
|
|
25
|
+
}
|
|
26
|
+
serialize() {
|
|
27
|
+
const { pages, collections } = this;
|
|
28
|
+
return Object.assign(Object.assign({}, super.serialize()), { pages: JSON.parse(JSON.stringify(pages)), collections: JSON.parse(JSON.stringify(collections)) });
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
exports.LinkedDependantsError = LinkedDependantsError;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LockdownError = void 0;
|
|
4
|
+
const CMSError_1 = require("./CMSError");
|
|
5
|
+
// class
|
|
6
|
+
class LockdownError extends CMSError_1.CMSError {
|
|
7
|
+
constructor(args) {
|
|
8
|
+
// construct base
|
|
9
|
+
super(args);
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
exports.LockdownError = LockdownError;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { SerializedIsometricError } from '@nascentdigital/funnel-core';
|
|
2
|
+
import type { PageClient } from '../api';
|
|
3
|
+
import { CMSError } from './CMSError';
|
|
4
|
+
export declare class SlugValidationError extends CMSError {
|
|
5
|
+
readonly slug: string;
|
|
6
|
+
readonly reason: SlugValidationError.Reason;
|
|
7
|
+
constructor(args: SlugValidationError.ConstructorArgs);
|
|
8
|
+
serialize(): SlugValidationError.Serialized;
|
|
9
|
+
}
|
|
10
|
+
export declare namespace SlugValidationError {
|
|
11
|
+
type Reason = PageClient.ValidateSlug.InvalidResult | PageClient.ValidateSlug.UnavailableResult;
|
|
12
|
+
type ConstructorArgs = Omit<CMSError.ConstructorArgs, 'message'> & {
|
|
13
|
+
slug: string;
|
|
14
|
+
reason: Reason;
|
|
15
|
+
message?: string;
|
|
16
|
+
};
|
|
17
|
+
type Serialized = SerializedIsometricError & {
|
|
18
|
+
slug: string;
|
|
19
|
+
reason: Reason;
|
|
20
|
+
};
|
|
21
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SlugValidationError = void 0;
|
|
4
|
+
const CMSError_1 = require("./CMSError");
|
|
5
|
+
// class
|
|
6
|
+
class SlugValidationError extends CMSError_1.CMSError {
|
|
7
|
+
constructor(args) {
|
|
8
|
+
var _a;
|
|
9
|
+
// construct base
|
|
10
|
+
super(Object.assign(Object.assign({}, args), { message: (_a = args.message) !== null && _a !== void 0 ? _a : (args.reason.status === 'invalid'
|
|
11
|
+
? `invalid format for slug "${args.slug}"`
|
|
12
|
+
: `slug "${args.slug}" is not available`) }));
|
|
13
|
+
// initialize instance variables
|
|
14
|
+
this.slug = args.slug;
|
|
15
|
+
this.reason = args.reason;
|
|
16
|
+
}
|
|
17
|
+
serialize() {
|
|
18
|
+
const { slug, reason } = this;
|
|
19
|
+
return Object.assign(Object.assign({}, super.serialize()), { slug,
|
|
20
|
+
reason });
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
exports.SlugValidationError = SlugValidationError;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Language, Schema, SerializedIsometricError } from '@nascentdigital/funnel-core';
|
|
2
|
+
import { CMSError } from './CMSError';
|
|
3
|
+
export declare class TranslateReferencesError extends CMSError {
|
|
4
|
+
readonly targetLanguage: Language;
|
|
5
|
+
readonly untranslatedPages: Schema.Page.Data.AsLink[];
|
|
6
|
+
readonly untranslatedCollections: Schema.Collection.Data.AsRef[];
|
|
7
|
+
constructor(args: TranslateReferencesError.ConstructorArgs);
|
|
8
|
+
serialize(): TranslateReferencesError.Serialized;
|
|
9
|
+
}
|
|
10
|
+
export declare namespace TranslateReferencesError {
|
|
11
|
+
type ConstructorArgs = CMSError.ConstructorArgs & {
|
|
12
|
+
targetLanguage: Language;
|
|
13
|
+
untranslatedPages: Schema.Page.Data.AsLink[];
|
|
14
|
+
untranslatedCollections: Schema.Collection.Data.AsRef[];
|
|
15
|
+
};
|
|
16
|
+
type Serialized = SerializedIsometricError & {
|
|
17
|
+
targetLanguage: Language;
|
|
18
|
+
untranslatedPages: Schema.Page.Data.AsLink[];
|
|
19
|
+
untranslatedCollections: Schema.Collection.Data.AsRef[];
|
|
20
|
+
};
|
|
21
|
+
}
|