ultracart_rest_api_v2_typescript 4.1.154 → 4.1.156

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.
@@ -1015,12 +1015,18 @@ src/models/SfvbFilesResponse.ts
1015
1015
  src/models/SfvbLibraryEntry.ts
1016
1016
  src/models/SfvbLibraryFacet.ts
1017
1017
  src/models/SfvbLibraryResponse.ts
1018
+ src/models/SfvbMenu.ts
1019
+ src/models/SfvbMenuItem.ts
1020
+ src/models/SfvbMenuWriteRequest.ts
1021
+ src/models/SfvbMenusResponse.ts
1018
1022
  src/models/SfvbPageAttribute.ts
1019
1023
  src/models/SfvbPageAttributeUpdate.ts
1020
1024
  src/models/SfvbPageAttributeUpdateRequest.ts
1021
1025
  src/models/SfvbPageMultimedia.ts
1022
1026
  src/models/SfvbPageMultimediaRequest.ts
1023
1027
  src/models/SfvbPageResponse.ts
1028
+ src/models/SfvbPreviewAccessRequest.ts
1029
+ src/models/SfvbPreviewAccessResponse.ts
1024
1030
  src/models/SfvbPreviewSessionRequest.ts
1025
1031
  src/models/SfvbPreviewSessionResponse.ts
1026
1032
  src/models/SfvbPreviewUrlResponse.ts
package/README.md CHANGED
@@ -1,12 +1,12 @@
1
1
  # UltraCart Typescript SDK
2
- ## ultracart_rest_api_v2_typescript@4.1.154
2
+ ## ultracart_rest_api_v2_typescript@4.1.156
3
3
 
4
4
  Every API method call has a sample for every language SDK. See https://github.com/UltraCart/sdk_samples
5
5
 
6
6
  Installation
7
7
 
8
8
  ```
9
- npm install ultracart_rest_api_v2_typescript@4.1.154 --save
9
+ npm install ultracart_rest_api_v2_typescript@4.1.156 --save
10
10
  ```
11
11
 
12
12
  ```typescript
@@ -85,6 +85,8 @@ Not every change is committed to every SDK.
85
85
 
86
86
  | Version | Date | Comments |
87
87
  | --: | :-: | --- |
88
+ | 4.1.156 | 09/16/2026 | sfvb internal testing |
89
+ | 4.1.155 | 09/15/2026 | sfvb internal testing |
88
90
  | 4.1.154 | 09/14/2026 | sfvb internal testing |
89
91
  | 4.1.153 | 09/14/2026 | sfvb internal testing |
90
92
  | 4.1.152 | 09/09/2026 | sfvb - internal testing |
@@ -10,10 +10,14 @@
10
10
  * Do not edit the class manually.
11
11
  */
12
12
  import * as runtime from '../runtime';
13
- import { SfvbCompileRequest, SfvbCompileResponse, SfvbContainerResponse, SfvbContainerRevertRequest, SfvbContainerVersion, SfvbContainerVersionsResponse, SfvbContainerWriteRequest, SfvbElementSchemaResponse, SfvbElementsResponse, SfvbFileContentResponse, SfvbFileRevertRequest, SfvbFileSearchRequest, SfvbFileSearchResponse, SfvbFileUploadRequest, SfvbFileUploadUrlResponse, SfvbFileVersionsResponse, SfvbFileWriteRequest, SfvbFileWriteResponse, SfvbFilesResponse, SfvbLibraryEntry, SfvbLibraryResponse, SfvbPageAttributeUpdateRequest, SfvbPageMultimediaRequest, SfvbPageResponse, SfvbPreviewSessionRequest, SfvbPreviewSessionResponse, SfvbPreviewUrlResponse, SfvbRenderRequest, SfvbRenderResponse, SfvbStorefrontsResponse, SfvbTheme, SfvbThemeAttributeUpdateRequest, SfvbThemeAttributesResponse, SfvbThemeDuplicateRequest, SfvbThemeJobResponse, SfvbThemesResponse, SfvbUpsellOffersResponse, SfvbValidateRequest, SfvbValidationResponse, SfvbVelocityValidateRequest, SfvbVersionResponse, SfvbWhoamiResponse, SfvbWidgetIdsResponse } from '../models';
13
+ import { SfvbCompileRequest, SfvbCompileResponse, SfvbContainerResponse, SfvbContainerRevertRequest, SfvbContainerVersion, SfvbContainerVersionsResponse, SfvbContainerWriteRequest, SfvbElementSchemaResponse, SfvbElementsResponse, SfvbFileContentResponse, SfvbFileRevertRequest, SfvbFileSearchRequest, SfvbFileSearchResponse, SfvbFileUploadRequest, SfvbFileUploadUrlResponse, SfvbFileVersionsResponse, SfvbFileWriteRequest, SfvbFileWriteResponse, SfvbFilesResponse, SfvbLibraryEntry, SfvbLibraryResponse, SfvbMenu, SfvbMenuWriteRequest, SfvbMenusResponse, SfvbPageAttributeUpdateRequest, SfvbPageMultimediaRequest, SfvbPageResponse, SfvbPreviewAccessRequest, SfvbPreviewAccessResponse, SfvbPreviewSessionRequest, SfvbPreviewSessionResponse, SfvbPreviewUrlResponse, SfvbRenderRequest, SfvbRenderResponse, SfvbStorefrontsResponse, SfvbTheme, SfvbThemeAttributeUpdateRequest, SfvbThemeAttributesResponse, SfvbThemeDuplicateRequest, SfvbThemeJobResponse, SfvbThemesResponse, SfvbUpsellOffersResponse, SfvbValidateRequest, SfvbValidationResponse, SfvbVelocityValidateRequest, SfvbVersionResponse, SfvbWhoamiResponse, SfvbWidgetIdsResponse } from '../models';
14
14
  export interface CompileSfvbCjsonRequest {
15
15
  compileRequest: SfvbCompileRequest;
16
16
  }
17
+ export interface CreateSfvbPreviewAccessRequest {
18
+ storefrontOid: number;
19
+ previewAccess?: SfvbPreviewAccessRequest;
20
+ }
17
21
  export interface CreateSfvbPreviewSessionRequest {
18
22
  storefrontOid: number;
19
23
  }
@@ -73,6 +77,13 @@ export interface GetSfvbLibraryEntryRequest {
73
77
  storefrontOid: number;
74
78
  libraryOid: number;
75
79
  }
80
+ export interface GetSfvbMenuRequest {
81
+ storefrontOid: number;
82
+ code: string;
83
+ }
84
+ export interface GetSfvbMenusRequest {
85
+ storefrontOid: number;
86
+ }
76
87
  export interface GetSfvbPageRequest {
77
88
  storefrontOid: number;
78
89
  path: string;
@@ -135,6 +146,12 @@ export interface PutSfvbFileContentRequest {
135
146
  fileWriteRequest: SfvbFileWriteRequest;
136
147
  path?: string;
137
148
  }
149
+ export interface PutSfvbMenuRequest {
150
+ storefrontOid: number;
151
+ code: string;
152
+ menuWriteRequest: SfvbMenuWriteRequest;
153
+ ifMatch?: string;
154
+ }
138
155
  export interface PutSfvbPageAttributesRequest {
139
156
  storefrontOid: number;
140
157
  path: string;
@@ -223,6 +240,21 @@ export interface SfvbApiInterface {
223
240
  * Compile CJSON to Velocity
224
241
  */
225
242
  compileSfvbCjson(requestParameters: CompileSfvbCjsonRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<SfvbCompileResponse>;
243
+ /**
244
+ * The preview URL only works in a browser already signed in to UltraCart on the storefront\'s own host, and an agent\'s built in browser never is. This returns a single use access_url on the storefront host instead. Opening it gets past the storefront lock, shows the requested theme and applies the requested preview session for the rest of that browser session, then redirects to path. It expires two minutes after issue or on first use. Pages opened afterwards carry an X-UltraCart-Preview header of applied or not-applied. Requires a token that resolves to a user, so use the device authorization flow.
245
+ * @summary One time link that opens a preview in a browser with no UltraCart login
246
+ * @param {number} storefrontOid
247
+ * @param {SfvbPreviewAccessRequest} [previewAccess] What the browser should see
248
+ * @param {*} [options] Override http request option.
249
+ * @throws {RequiredError}
250
+ * @memberof SfvbApiInterface
251
+ */
252
+ createSfvbPreviewAccessRaw(requestParameters: CreateSfvbPreviewAccessRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<SfvbPreviewAccessResponse>>;
253
+ /**
254
+ * The preview URL only works in a browser already signed in to UltraCart on the storefront\'s own host, and an agent\'s built in browser never is. This returns a single use access_url on the storefront host instead. Opening it gets past the storefront lock, shows the requested theme and applies the requested preview session for the rest of that browser session, then redirects to path. It expires two minutes after issue or on first use. Pages opened afterwards carry an X-UltraCart-Preview header of applied or not-applied. Requires a token that resolves to a user, so use the device authorization flow.
255
+ * One time link that opens a preview in a browser with no UltraCart login
256
+ */
257
+ createSfvbPreviewAccess(requestParameters: CreateSfvbPreviewAccessRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<SfvbPreviewAccessResponse>;
226
258
  /**
227
259
  * Returns a server generated session id to push containers into, and opens the session so that id exists rather than merely being random. The id is not caller supplied, because concurrent agents choosing their own would be free to collide, and the browser editor\'s habit of minting one with Math.random is not a property worth carrying into an API. Expires after eight hours and can be deleted sooner. Requires a token that resolves to a user, so use the device authorization flow.
228
260
  * @summary Create a preview session
@@ -424,6 +456,35 @@ export interface SfvbApiInterface {
424
456
  * Read one library entry including its CJSON
425
457
  */
426
458
  getSfvbLibraryEntry(requestParameters: GetSfvbLibraryEntryRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<SfvbLibraryEntry>;
459
+ /**
460
+ * The whole tree, in render order. Page entries carry the page_path they resolve to and item entries the merchant_item_id, rather than the oids the storage keeps. Menu item oids are not returned at all because a write regenerates every one of them. Keep hash_sha256 - it is the If-Match a write needs.
461
+ * @summary Read one store menu and its entries
462
+ * @param {number} storefrontOid
463
+ * @param {string} code Menu code, matched without regard to case
464
+ * @param {*} [options] Override http request option.
465
+ * @throws {RequiredError}
466
+ * @memberof SfvbApiInterface
467
+ */
468
+ getSfvbMenuRaw(requestParameters: GetSfvbMenuRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<SfvbMenu>>;
469
+ /**
470
+ * The whole tree, in render order. Page entries carry the page_path they resolve to and item entries the merchant_item_id, rather than the oids the storage keeps. Menu item oids are not returned at all because a write regenerates every one of them. Keep hash_sha256 - it is the If-Match a write needs.
471
+ * Read one store menu and its entries
472
+ */
473
+ getSfvbMenu(requestParameters: GetSfvbMenuRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<SfvbMenu>;
474
+ /**
475
+ * The menus a menu element\'s menuName can name, sorted by code and without their entries. A code the active theme\'s templates ask for but nothing has created is included with unconfigured true - that code renders an empty list today, and writing it creates it. A menu no template names is marked undeclared, which usually means a menuName is misspelled.
476
+ * @summary List a storefront\'s store menus
477
+ * @param {number} storefrontOid
478
+ * @param {*} [options] Override http request option.
479
+ * @throws {RequiredError}
480
+ * @memberof SfvbApiInterface
481
+ */
482
+ getSfvbMenusRaw(requestParameters: GetSfvbMenusRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<SfvbMenusResponse>>;
483
+ /**
484
+ * The menus a menu element\'s menuName can name, sorted by code and without their entries. A code the active theme\'s templates ask for but nothing has created is included with unconfigured true - that code renders an empty list today, and writing it creates it. A menu no template names is marked undeclared, which usually means a menuName is misspelled.
485
+ * List a storefront\'s store menus
486
+ */
487
+ getSfvbMenus(requestParameters: GetSfvbMenusRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<SfvbMenusResponse>;
427
488
  /**
428
489
  * What the pageattribute and pageimage elements render for this page. These are not in any file, which is why a page folder can be empty and its elements still render something. Attributes and image codes a template declares but nothing has set are included, so the response describes what the page can show rather than only what has been saved.
429
490
  * @summary Read a page\'s attributes and images
@@ -678,6 +739,23 @@ export interface SfvbApiInterface {
678
739
  * Write a storefront file
679
740
  */
680
741
  putSfvbFileContent(requestParameters: PutSfvbFileContentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<SfvbFileWriteResponse>;
742
+ /**
743
+ * A whole menu replace, not a merge - what you send is what the menu holds afterwards, so read it, change the tree and send it back. Omitting items changes only the title; sending an empty array empties the menu. Writing a code that does not exist creates it. Every entry is checked before any of it is written, including that a merchant_item_id and a page_path actually resolve, so a tree with one bad entry changes nothing. Always needs sfvb_publish, because a menu is shared by every theme and there is no dormant copy to change instead.
744
+ * @summary Replace a store menu\'s entries
745
+ * @param {number} storefrontOid
746
+ * @param {string} code Menu code, matched without regard to case
747
+ * @param {SfvbMenuWriteRequest} menuWriteRequest The menu\&#39;s replacement contents
748
+ * @param {string} [ifMatch] Content hash from the last read. Required when the menu already exists; 428 when absent, 412 when stale.
749
+ * @param {*} [options] Override http request option.
750
+ * @throws {RequiredError}
751
+ * @memberof SfvbApiInterface
752
+ */
753
+ putSfvbMenuRaw(requestParameters: PutSfvbMenuRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<SfvbMenu>>;
754
+ /**
755
+ * A whole menu replace, not a merge - what you send is what the menu holds afterwards, so read it, change the tree and send it back. Omitting items changes only the title; sending an empty array empties the menu. Writing a code that does not exist creates it. Every entry is checked before any of it is written, including that a merchant_item_id and a page_path actually resolve, so a tree with one bad entry changes nothing. Always needs sfvb_publish, because a menu is shared by every theme and there is no dormant copy to change instead.
756
+ * Replace a store menu\'s entries
757
+ */
758
+ putSfvbMenu(requestParameters: PutSfvbMenuRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<SfvbMenu>;
681
759
  /**
682
760
  * A partial update. Only the attributes you name are changed. Every entry is checked before any is written. List, slider, item set, page collection and video list attributes are refused - edit those in the page editor. Always needs sfvb_publish, because a page\'s attributes are shared by every theme and there is no dormant copy to change instead.
683
761
  * @summary Change a page\'s attributes
@@ -903,6 +981,16 @@ export declare class SfvbApi extends runtime.BaseAPI implements SfvbApiInterface
903
981
  * Compile CJSON to Velocity
904
982
  */
905
983
  compileSfvbCjson(requestParameters: CompileSfvbCjsonRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<SfvbCompileResponse>;
984
+ /**
985
+ * The preview URL only works in a browser already signed in to UltraCart on the storefront\'s own host, and an agent\'s built in browser never is. This returns a single use access_url on the storefront host instead. Opening it gets past the storefront lock, shows the requested theme and applies the requested preview session for the rest of that browser session, then redirects to path. It expires two minutes after issue or on first use. Pages opened afterwards carry an X-UltraCart-Preview header of applied or not-applied. Requires a token that resolves to a user, so use the device authorization flow.
986
+ * One time link that opens a preview in a browser with no UltraCart login
987
+ */
988
+ createSfvbPreviewAccessRaw(requestParameters: CreateSfvbPreviewAccessRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<SfvbPreviewAccessResponse>>;
989
+ /**
990
+ * The preview URL only works in a browser already signed in to UltraCart on the storefront\'s own host, and an agent\'s built in browser never is. This returns a single use access_url on the storefront host instead. Opening it gets past the storefront lock, shows the requested theme and applies the requested preview session for the rest of that browser session, then redirects to path. It expires two minutes after issue or on first use. Pages opened afterwards carry an X-UltraCart-Preview header of applied or not-applied. Requires a token that resolves to a user, so use the device authorization flow.
991
+ * One time link that opens a preview in a browser with no UltraCart login
992
+ */
993
+ createSfvbPreviewAccess(requestParameters: CreateSfvbPreviewAccessRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<SfvbPreviewAccessResponse>;
906
994
  /**
907
995
  * Returns a server generated session id to push containers into, and opens the session so that id exists rather than merely being random. The id is not caller supplied, because concurrent agents choosing their own would be free to collide, and the browser editor\'s habit of minting one with Math.random is not a property worth carrying into an API. Expires after eight hours and can be deleted sooner. Requires a token that resolves to a user, so use the device authorization flow.
908
996
  * Create a preview session
@@ -1031,6 +1119,26 @@ export declare class SfvbApi extends runtime.BaseAPI implements SfvbApiInterface
1031
1119
  * Read one library entry including its CJSON
1032
1120
  */
1033
1121
  getSfvbLibraryEntry(requestParameters: GetSfvbLibraryEntryRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<SfvbLibraryEntry>;
1122
+ /**
1123
+ * The whole tree, in render order. Page entries carry the page_path they resolve to and item entries the merchant_item_id, rather than the oids the storage keeps. Menu item oids are not returned at all because a write regenerates every one of them. Keep hash_sha256 - it is the If-Match a write needs.
1124
+ * Read one store menu and its entries
1125
+ */
1126
+ getSfvbMenuRaw(requestParameters: GetSfvbMenuRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<SfvbMenu>>;
1127
+ /**
1128
+ * The whole tree, in render order. Page entries carry the page_path they resolve to and item entries the merchant_item_id, rather than the oids the storage keeps. Menu item oids are not returned at all because a write regenerates every one of them. Keep hash_sha256 - it is the If-Match a write needs.
1129
+ * Read one store menu and its entries
1130
+ */
1131
+ getSfvbMenu(requestParameters: GetSfvbMenuRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<SfvbMenu>;
1132
+ /**
1133
+ * The menus a menu element\'s menuName can name, sorted by code and without their entries. A code the active theme\'s templates ask for but nothing has created is included with unconfigured true - that code renders an empty list today, and writing it creates it. A menu no template names is marked undeclared, which usually means a menuName is misspelled.
1134
+ * List a storefront\'s store menus
1135
+ */
1136
+ getSfvbMenusRaw(requestParameters: GetSfvbMenusRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<SfvbMenusResponse>>;
1137
+ /**
1138
+ * The menus a menu element\'s menuName can name, sorted by code and without their entries. A code the active theme\'s templates ask for but nothing has created is included with unconfigured true - that code renders an empty list today, and writing it creates it. A menu no template names is marked undeclared, which usually means a menuName is misspelled.
1139
+ * List a storefront\'s store menus
1140
+ */
1141
+ getSfvbMenus(requestParameters: GetSfvbMenusRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<SfvbMenusResponse>;
1034
1142
  /**
1035
1143
  * What the pageattribute and pageimage elements render for this page. These are not in any file, which is why a page folder can be empty and its elements still render something. Attributes and image codes a template declares but nothing has set are included, so the response describes what the page can show rather than only what has been saved.
1036
1144
  * Read a page\'s attributes and images
@@ -1195,6 +1303,16 @@ export declare class SfvbApi extends runtime.BaseAPI implements SfvbApiInterface
1195
1303
  * Write a storefront file
1196
1304
  */
1197
1305
  putSfvbFileContent(requestParameters: PutSfvbFileContentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<SfvbFileWriteResponse>;
1306
+ /**
1307
+ * A whole menu replace, not a merge - what you send is what the menu holds afterwards, so read it, change the tree and send it back. Omitting items changes only the title; sending an empty array empties the menu. Writing a code that does not exist creates it. Every entry is checked before any of it is written, including that a merchant_item_id and a page_path actually resolve, so a tree with one bad entry changes nothing. Always needs sfvb_publish, because a menu is shared by every theme and there is no dormant copy to change instead.
1308
+ * Replace a store menu\'s entries
1309
+ */
1310
+ putSfvbMenuRaw(requestParameters: PutSfvbMenuRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<SfvbMenu>>;
1311
+ /**
1312
+ * A whole menu replace, not a merge - what you send is what the menu holds afterwards, so read it, change the tree and send it back. Omitting items changes only the title; sending an empty array empties the menu. Writing a code that does not exist creates it. Every entry is checked before any of it is written, including that a merchant_item_id and a page_path actually resolve, so a tree with one bad entry changes nothing. Always needs sfvb_publish, because a menu is shared by every theme and there is no dormant copy to change instead.
1313
+ * Replace a store menu\'s entries
1314
+ */
1315
+ putSfvbMenu(requestParameters: PutSfvbMenuRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<SfvbMenu>;
1198
1316
  /**
1199
1317
  * A partial update. Only the attributes you name are changed. Every entry is checked before any is written. List, slider, item set, page collection and video list attributes are refused - edit those in the page editor. Always needs sfvb_publish, because a page\'s attributes are shared by every theme and there is no dormant copy to change instead.
1200
1318
  * Change a page\'s attributes
@@ -136,6 +136,67 @@ var SfvbApi = /** @class */ (function (_super) {
136
136
  });
137
137
  });
138
138
  };
139
+ /**
140
+ * The preview URL only works in a browser already signed in to UltraCart on the storefront\'s own host, and an agent\'s built in browser never is. This returns a single use access_url on the storefront host instead. Opening it gets past the storefront lock, shows the requested theme and applies the requested preview session for the rest of that browser session, then redirects to path. It expires two minutes after issue or on first use. Pages opened afterwards carry an X-UltraCart-Preview header of applied or not-applied. Requires a token that resolves to a user, so use the device authorization flow.
141
+ * One time link that opens a preview in a browser with no UltraCart login
142
+ */
143
+ SfvbApi.prototype.createSfvbPreviewAccessRaw = function (requestParameters, initOverrides) {
144
+ return __awaiter(this, void 0, void 0, function () {
145
+ var queryParameters, headerParameters, _a, _b, response;
146
+ return __generator(this, function (_c) {
147
+ switch (_c.label) {
148
+ case 0:
149
+ if (requestParameters.storefrontOid === null || requestParameters.storefrontOid === undefined) {
150
+ throw new runtime.RequiredError('storefrontOid', 'Required parameter requestParameters.storefrontOid was null or undefined when calling createSfvbPreviewAccess.');
151
+ }
152
+ queryParameters = {};
153
+ headerParameters = {};
154
+ headerParameters['Content-Type'] = 'application/json';
155
+ if (!(this.configuration && this.configuration.accessToken)) return [3 /*break*/, 2];
156
+ // oauth required
157
+ _a = headerParameters;
158
+ _b = "Authorization";
159
+ return [4 /*yield*/, this.configuration.accessToken("ultraCartOauth", [])];
160
+ case 1:
161
+ // oauth required
162
+ _a[_b] = _c.sent();
163
+ _c.label = 2;
164
+ case 2:
165
+ if (this.configuration && this.configuration.apiKey) {
166
+ headerParameters["x-ultracart-simple-key"] = this.configuration.apiKey("x-ultracart-simple-key"); // ultraCartSimpleApiKey authentication
167
+ }
168
+ return [4 /*yield*/, this.request({
169
+ path: "/sfvb/storefronts/{storefront_oid}/preview_access".replace("{".concat("storefront_oid", "}"), encodeURIComponent(String(requestParameters.storefrontOid))),
170
+ method: 'POST',
171
+ headers: headerParameters,
172
+ query: queryParameters,
173
+ body: (0, models_1.SfvbPreviewAccessRequestToJSON)(requestParameters.previewAccess),
174
+ }, initOverrides)];
175
+ case 3:
176
+ response = _c.sent();
177
+ return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, models_1.SfvbPreviewAccessResponseFromJSON)(jsonValue); })];
178
+ }
179
+ });
180
+ });
181
+ };
182
+ /**
183
+ * The preview URL only works in a browser already signed in to UltraCart on the storefront\'s own host, and an agent\'s built in browser never is. This returns a single use access_url on the storefront host instead. Opening it gets past the storefront lock, shows the requested theme and applies the requested preview session for the rest of that browser session, then redirects to path. It expires two minutes after issue or on first use. Pages opened afterwards carry an X-UltraCart-Preview header of applied or not-applied. Requires a token that resolves to a user, so use the device authorization flow.
184
+ * One time link that opens a preview in a browser with no UltraCart login
185
+ */
186
+ SfvbApi.prototype.createSfvbPreviewAccess = function (requestParameters, initOverrides) {
187
+ return __awaiter(this, void 0, void 0, function () {
188
+ var response;
189
+ return __generator(this, function (_a) {
190
+ switch (_a.label) {
191
+ case 0: return [4 /*yield*/, this.createSfvbPreviewAccessRaw(requestParameters, initOverrides)];
192
+ case 1:
193
+ response = _a.sent();
194
+ return [4 /*yield*/, response.value()];
195
+ case 2: return [2 /*return*/, _a.sent()];
196
+ }
197
+ });
198
+ });
199
+ };
139
200
  /**
140
201
  * Returns a server generated session id to push containers into, and opens the session so that id exists rather than merely being random. The id is not caller supplied, because concurrent agents choosing their own would be free to collide, and the browser editor\'s habit of minting one with Math.random is not a property worth carrying into an API. Expires after eight hours and can be deleted sooner. Requires a token that resolves to a user, so use the device authorization flow.
141
202
  * Create a preview session
@@ -965,6 +1026,127 @@ var SfvbApi = /** @class */ (function (_super) {
965
1026
  });
966
1027
  });
967
1028
  };
1029
+ /**
1030
+ * The whole tree, in render order. Page entries carry the page_path they resolve to and item entries the merchant_item_id, rather than the oids the storage keeps. Menu item oids are not returned at all because a write regenerates every one of them. Keep hash_sha256 - it is the If-Match a write needs.
1031
+ * Read one store menu and its entries
1032
+ */
1033
+ SfvbApi.prototype.getSfvbMenuRaw = function (requestParameters, initOverrides) {
1034
+ return __awaiter(this, void 0, void 0, function () {
1035
+ var queryParameters, headerParameters, _a, _b, response;
1036
+ return __generator(this, function (_c) {
1037
+ switch (_c.label) {
1038
+ case 0:
1039
+ if (requestParameters.storefrontOid === null || requestParameters.storefrontOid === undefined) {
1040
+ throw new runtime.RequiredError('storefrontOid', 'Required parameter requestParameters.storefrontOid was null or undefined when calling getSfvbMenu.');
1041
+ }
1042
+ if (requestParameters.code === null || requestParameters.code === undefined) {
1043
+ throw new runtime.RequiredError('code', 'Required parameter requestParameters.code was null or undefined when calling getSfvbMenu.');
1044
+ }
1045
+ queryParameters = {};
1046
+ headerParameters = {};
1047
+ if (!(this.configuration && this.configuration.accessToken)) return [3 /*break*/, 2];
1048
+ // oauth required
1049
+ _a = headerParameters;
1050
+ _b = "Authorization";
1051
+ return [4 /*yield*/, this.configuration.accessToken("ultraCartOauth", [])];
1052
+ case 1:
1053
+ // oauth required
1054
+ _a[_b] = _c.sent();
1055
+ _c.label = 2;
1056
+ case 2:
1057
+ if (this.configuration && this.configuration.apiKey) {
1058
+ headerParameters["x-ultracart-simple-key"] = this.configuration.apiKey("x-ultracart-simple-key"); // ultraCartSimpleApiKey authentication
1059
+ }
1060
+ return [4 /*yield*/, this.request({
1061
+ path: "/sfvb/storefronts/{storefront_oid}/menus/{code}".replace("{".concat("storefront_oid", "}"), encodeURIComponent(String(requestParameters.storefrontOid))).replace("{".concat("code", "}"), encodeURIComponent(String(requestParameters.code))),
1062
+ method: 'GET',
1063
+ headers: headerParameters,
1064
+ query: queryParameters,
1065
+ }, initOverrides)];
1066
+ case 3:
1067
+ response = _c.sent();
1068
+ return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, models_1.SfvbMenuFromJSON)(jsonValue); })];
1069
+ }
1070
+ });
1071
+ });
1072
+ };
1073
+ /**
1074
+ * The whole tree, in render order. Page entries carry the page_path they resolve to and item entries the merchant_item_id, rather than the oids the storage keeps. Menu item oids are not returned at all because a write regenerates every one of them. Keep hash_sha256 - it is the If-Match a write needs.
1075
+ * Read one store menu and its entries
1076
+ */
1077
+ SfvbApi.prototype.getSfvbMenu = function (requestParameters, initOverrides) {
1078
+ return __awaiter(this, void 0, void 0, function () {
1079
+ var response;
1080
+ return __generator(this, function (_a) {
1081
+ switch (_a.label) {
1082
+ case 0: return [4 /*yield*/, this.getSfvbMenuRaw(requestParameters, initOverrides)];
1083
+ case 1:
1084
+ response = _a.sent();
1085
+ return [4 /*yield*/, response.value()];
1086
+ case 2: return [2 /*return*/, _a.sent()];
1087
+ }
1088
+ });
1089
+ });
1090
+ };
1091
+ /**
1092
+ * The menus a menu element\'s menuName can name, sorted by code and without their entries. A code the active theme\'s templates ask for but nothing has created is included with unconfigured true - that code renders an empty list today, and writing it creates it. A menu no template names is marked undeclared, which usually means a menuName is misspelled.
1093
+ * List a storefront\'s store menus
1094
+ */
1095
+ SfvbApi.prototype.getSfvbMenusRaw = function (requestParameters, initOverrides) {
1096
+ return __awaiter(this, void 0, void 0, function () {
1097
+ var queryParameters, headerParameters, _a, _b, response;
1098
+ return __generator(this, function (_c) {
1099
+ switch (_c.label) {
1100
+ case 0:
1101
+ if (requestParameters.storefrontOid === null || requestParameters.storefrontOid === undefined) {
1102
+ throw new runtime.RequiredError('storefrontOid', 'Required parameter requestParameters.storefrontOid was null or undefined when calling getSfvbMenus.');
1103
+ }
1104
+ queryParameters = {};
1105
+ headerParameters = {};
1106
+ if (!(this.configuration && this.configuration.accessToken)) return [3 /*break*/, 2];
1107
+ // oauth required
1108
+ _a = headerParameters;
1109
+ _b = "Authorization";
1110
+ return [4 /*yield*/, this.configuration.accessToken("ultraCartOauth", [])];
1111
+ case 1:
1112
+ // oauth required
1113
+ _a[_b] = _c.sent();
1114
+ _c.label = 2;
1115
+ case 2:
1116
+ if (this.configuration && this.configuration.apiKey) {
1117
+ headerParameters["x-ultracart-simple-key"] = this.configuration.apiKey("x-ultracart-simple-key"); // ultraCartSimpleApiKey authentication
1118
+ }
1119
+ return [4 /*yield*/, this.request({
1120
+ path: "/sfvb/storefronts/{storefront_oid}/menus".replace("{".concat("storefront_oid", "}"), encodeURIComponent(String(requestParameters.storefrontOid))),
1121
+ method: 'GET',
1122
+ headers: headerParameters,
1123
+ query: queryParameters,
1124
+ }, initOverrides)];
1125
+ case 3:
1126
+ response = _c.sent();
1127
+ return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, models_1.SfvbMenusResponseFromJSON)(jsonValue); })];
1128
+ }
1129
+ });
1130
+ });
1131
+ };
1132
+ /**
1133
+ * The menus a menu element\'s menuName can name, sorted by code and without their entries. A code the active theme\'s templates ask for but nothing has created is included with unconfigured true - that code renders an empty list today, and writing it creates it. A menu no template names is marked undeclared, which usually means a menuName is misspelled.
1134
+ * List a storefront\'s store menus
1135
+ */
1136
+ SfvbApi.prototype.getSfvbMenus = function (requestParameters, initOverrides) {
1137
+ return __awaiter(this, void 0, void 0, function () {
1138
+ var response;
1139
+ return __generator(this, function (_a) {
1140
+ switch (_a.label) {
1141
+ case 0: return [4 /*yield*/, this.getSfvbMenusRaw(requestParameters, initOverrides)];
1142
+ case 1:
1143
+ response = _a.sent();
1144
+ return [4 /*yield*/, response.value()];
1145
+ case 2: return [2 /*return*/, _a.sent()];
1146
+ }
1147
+ });
1148
+ });
1149
+ };
968
1150
  /**
969
1151
  * What the pageattribute and pageimage elements render for this page. These are not in any file, which is why a page folder can be empty and its elements still render something. Attributes and image codes a template declares but nothing has set are included, so the response describes what the page can show rather than only what has been saved.
970
1152
  * Read a page\'s attributes and images
@@ -2032,6 +2214,76 @@ var SfvbApi = /** @class */ (function (_super) {
2032
2214
  });
2033
2215
  });
2034
2216
  };
2217
+ /**
2218
+ * A whole menu replace, not a merge - what you send is what the menu holds afterwards, so read it, change the tree and send it back. Omitting items changes only the title; sending an empty array empties the menu. Writing a code that does not exist creates it. Every entry is checked before any of it is written, including that a merchant_item_id and a page_path actually resolve, so a tree with one bad entry changes nothing. Always needs sfvb_publish, because a menu is shared by every theme and there is no dormant copy to change instead.
2219
+ * Replace a store menu\'s entries
2220
+ */
2221
+ SfvbApi.prototype.putSfvbMenuRaw = function (requestParameters, initOverrides) {
2222
+ return __awaiter(this, void 0, void 0, function () {
2223
+ var queryParameters, headerParameters, _a, _b, response;
2224
+ return __generator(this, function (_c) {
2225
+ switch (_c.label) {
2226
+ case 0:
2227
+ if (requestParameters.storefrontOid === null || requestParameters.storefrontOid === undefined) {
2228
+ throw new runtime.RequiredError('storefrontOid', 'Required parameter requestParameters.storefrontOid was null or undefined when calling putSfvbMenu.');
2229
+ }
2230
+ if (requestParameters.code === null || requestParameters.code === undefined) {
2231
+ throw new runtime.RequiredError('code', 'Required parameter requestParameters.code was null or undefined when calling putSfvbMenu.');
2232
+ }
2233
+ if (requestParameters.menuWriteRequest === null || requestParameters.menuWriteRequest === undefined) {
2234
+ throw new runtime.RequiredError('menuWriteRequest', 'Required parameter requestParameters.menuWriteRequest was null or undefined when calling putSfvbMenu.');
2235
+ }
2236
+ queryParameters = {};
2237
+ headerParameters = {};
2238
+ headerParameters['Content-Type'] = 'application/json';
2239
+ if (requestParameters.ifMatch !== undefined && requestParameters.ifMatch !== null) {
2240
+ headerParameters['If-Match'] = String(requestParameters.ifMatch);
2241
+ }
2242
+ if (!(this.configuration && this.configuration.accessToken)) return [3 /*break*/, 2];
2243
+ // oauth required
2244
+ _a = headerParameters;
2245
+ _b = "Authorization";
2246
+ return [4 /*yield*/, this.configuration.accessToken("ultraCartOauth", [])];
2247
+ case 1:
2248
+ // oauth required
2249
+ _a[_b] = _c.sent();
2250
+ _c.label = 2;
2251
+ case 2:
2252
+ if (this.configuration && this.configuration.apiKey) {
2253
+ headerParameters["x-ultracart-simple-key"] = this.configuration.apiKey("x-ultracart-simple-key"); // ultraCartSimpleApiKey authentication
2254
+ }
2255
+ return [4 /*yield*/, this.request({
2256
+ path: "/sfvb/storefronts/{storefront_oid}/menus/{code}".replace("{".concat("storefront_oid", "}"), encodeURIComponent(String(requestParameters.storefrontOid))).replace("{".concat("code", "}"), encodeURIComponent(String(requestParameters.code))),
2257
+ method: 'PUT',
2258
+ headers: headerParameters,
2259
+ query: queryParameters,
2260
+ body: (0, models_1.SfvbMenuWriteRequestToJSON)(requestParameters.menuWriteRequest),
2261
+ }, initOverrides)];
2262
+ case 3:
2263
+ response = _c.sent();
2264
+ return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, models_1.SfvbMenuFromJSON)(jsonValue); })];
2265
+ }
2266
+ });
2267
+ });
2268
+ };
2269
+ /**
2270
+ * A whole menu replace, not a merge - what you send is what the menu holds afterwards, so read it, change the tree and send it back. Omitting items changes only the title; sending an empty array empties the menu. Writing a code that does not exist creates it. Every entry is checked before any of it is written, including that a merchant_item_id and a page_path actually resolve, so a tree with one bad entry changes nothing. Always needs sfvb_publish, because a menu is shared by every theme and there is no dormant copy to change instead.
2271
+ * Replace a store menu\'s entries
2272
+ */
2273
+ SfvbApi.prototype.putSfvbMenu = function (requestParameters, initOverrides) {
2274
+ return __awaiter(this, void 0, void 0, function () {
2275
+ var response;
2276
+ return __generator(this, function (_a) {
2277
+ switch (_a.label) {
2278
+ case 0: return [4 /*yield*/, this.putSfvbMenuRaw(requestParameters, initOverrides)];
2279
+ case 1:
2280
+ response = _a.sent();
2281
+ return [4 /*yield*/, response.value()];
2282
+ case 2: return [2 /*return*/, _a.sent()];
2283
+ }
2284
+ });
2285
+ });
2286
+ };
2035
2287
  /**
2036
2288
  * A partial update. Only the attributes you name are changed. Every entry is checked before any is written. List, slider, item set, page collection and video list attributes are refused - edit those in the page editor. Always needs sfvb_publish, because a page\'s attributes are shared by every theme and there is no dormant copy to change instead.
2037
2289
  * Change a page\'s attributes
@@ -0,0 +1,68 @@
1
+ /**
2
+ * UltraCart Rest API V2
3
+ * UltraCart REST API Version 2
4
+ *
5
+ * The version of the OpenAPI document: 2.0.0
6
+ * Contact: support@ultracart.com
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ import { SfvbMenuItem } from './SfvbMenuItem';
13
+ /**
14
+ *
15
+ * @export
16
+ * @interface SfvbMenu
17
+ */
18
+ export interface SfvbMenu {
19
+ /**
20
+ * The menu's code, which is the value a menu element's menuName refers to. Compare case insensitively.
21
+ * @type {string}
22
+ * @memberof SfvbMenu
23
+ */
24
+ code?: string;
25
+ /**
26
+ * Content hash of the menu as stored. Send it back as If-Match when writing.
27
+ * @type {string}
28
+ * @memberof SfvbMenu
29
+ */
30
+ hash_sha256?: string;
31
+ /**
32
+ * How many entries the menu holds in total, counting every level of the tree.
33
+ * @type {number}
34
+ * @memberof SfvbMenu
35
+ */
36
+ item_count?: number;
37
+ /**
38
+ * The menu's entries, in the order they render. Omitted from the list endpoint, which returns each menu's identity and counts only.
39
+ * @type {Array<SfvbMenuItem>}
40
+ * @memberof SfvbMenu
41
+ */
42
+ items?: Array<SfvbMenuItem>;
43
+ /**
44
+ * The menu's own label, shown in the store admin rather than on the storefront. Trimmed to 250 characters.
45
+ * @type {string}
46
+ * @memberof SfvbMenu
47
+ */
48
+ title?: string;
49
+ /**
50
+ * True when a template names this code but no menu has been created for it. Such a code renders an empty list today. Write it to create it.
51
+ * @type {boolean}
52
+ * @memberof SfvbMenu
53
+ */
54
+ unconfigured?: boolean;
55
+ /**
56
+ * True when no template on the storefront names this code. The menu is stored and editable, but nothing renders it, which usually means a menu element's menuName is misspelled.
57
+ * @type {boolean}
58
+ * @memberof SfvbMenu
59
+ */
60
+ undeclared?: boolean;
61
+ }
62
+ /**
63
+ * Check if a given object implements the SfvbMenu interface.
64
+ */
65
+ export declare function instanceOfSfvbMenu(value: object): boolean;
66
+ export declare function SfvbMenuFromJSON(json: any): SfvbMenu;
67
+ export declare function SfvbMenuFromJSONTyped(json: any, ignoreDiscriminator: boolean): SfvbMenu;
68
+ export declare function SfvbMenuToJSON(value?: SfvbMenu | null): any;
@@ -0,0 +1,63 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * UltraCart Rest API V2
6
+ * UltraCart REST API Version 2
7
+ *
8
+ * The version of the OpenAPI document: 2.0.0
9
+ * Contact: support@ultracart.com
10
+ *
11
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
+ * https://openapi-generator.tech
13
+ * Do not edit the class manually.
14
+ */
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.SfvbMenuToJSON = exports.SfvbMenuFromJSONTyped = exports.SfvbMenuFromJSON = exports.instanceOfSfvbMenu = void 0;
17
+ var runtime_1 = require("../runtime");
18
+ var SfvbMenuItem_1 = require("./SfvbMenuItem");
19
+ /**
20
+ * Check if a given object implements the SfvbMenu interface.
21
+ */
22
+ function instanceOfSfvbMenu(value) {
23
+ var isInstance = true;
24
+ return isInstance;
25
+ }
26
+ exports.instanceOfSfvbMenu = instanceOfSfvbMenu;
27
+ function SfvbMenuFromJSON(json) {
28
+ return SfvbMenuFromJSONTyped(json, false);
29
+ }
30
+ exports.SfvbMenuFromJSON = SfvbMenuFromJSON;
31
+ function SfvbMenuFromJSONTyped(json, ignoreDiscriminator) {
32
+ if ((json === undefined) || (json === null)) {
33
+ return json;
34
+ }
35
+ return {
36
+ 'code': !(0, runtime_1.exists)(json, 'code') ? undefined : json['code'],
37
+ 'hash_sha256': !(0, runtime_1.exists)(json, 'hash_sha256') ? undefined : json['hash_sha256'],
38
+ 'item_count': !(0, runtime_1.exists)(json, 'item_count') ? undefined : json['item_count'],
39
+ 'items': !(0, runtime_1.exists)(json, 'items') ? undefined : (json['items'].map(SfvbMenuItem_1.SfvbMenuItemFromJSON)),
40
+ 'title': !(0, runtime_1.exists)(json, 'title') ? undefined : json['title'],
41
+ 'unconfigured': !(0, runtime_1.exists)(json, 'unconfigured') ? undefined : json['unconfigured'],
42
+ 'undeclared': !(0, runtime_1.exists)(json, 'undeclared') ? undefined : json['undeclared'],
43
+ };
44
+ }
45
+ exports.SfvbMenuFromJSONTyped = SfvbMenuFromJSONTyped;
46
+ function SfvbMenuToJSON(value) {
47
+ if (value === undefined) {
48
+ return undefined;
49
+ }
50
+ if (value === null) {
51
+ return null;
52
+ }
53
+ return {
54
+ 'code': value.code,
55
+ 'hash_sha256': value.hash_sha256,
56
+ 'item_count': value.item_count,
57
+ 'items': value.items === undefined ? undefined : (value.items.map(SfvbMenuItem_1.SfvbMenuItemToJSON)),
58
+ 'title': value.title,
59
+ 'unconfigured': value.unconfigured,
60
+ 'undeclared': value.undeclared,
61
+ };
62
+ }
63
+ exports.SfvbMenuToJSON = SfvbMenuToJSON;