@adobe/spacecat-shared-data-access 1.9.4 → 1.9.5

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/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ # [@adobe/spacecat-shared-data-access-v1.9.5](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-data-access-v1.9.4...@adobe/spacecat-shared-data-access-v1.9.5) (2024-01-22)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * set default organization ([#92](https://github.com/adobe/spacecat-shared/issues/92)) ([ac7e70c](https://github.com/adobe/spacecat-shared/commit/ac7e70c65f643c2f52730c3d5da4a0c4be282632))
7
+
1
8
  # [@adobe/spacecat-shared-data-access-v1.9.4](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-data-access-v1.9.3...@adobe/spacecat-shared-data-access-v1.9.4) (2024-01-20)
2
9
 
3
10
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe/spacecat-shared-data-access",
3
- "version": "1.9.4",
3
+ "version": "1.9.5",
4
4
  "description": "Shared modules of the Spacecat Services - Data Access",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
@@ -15,6 +15,8 @@ import { hasText, isObject } from '@adobe/spacecat-shared-utils';
15
15
  import { Base } from './base.js';
16
16
  import { Config, DEFAULT_CONFIG } from './site/config.js';
17
17
 
18
+ export const DEFAULT_ORGANIZATION_ID = 'default';
19
+
18
20
  /**
19
21
  * Creates a new Organization.
20
22
  *
@@ -10,11 +10,12 @@
10
10
  * governing permissions and limitations under the License.
11
11
  */
12
12
 
13
- import { isObject, isValidUrl } from '@adobe/spacecat-shared-utils';
13
+ import { hasText, isObject, isValidUrl } from '@adobe/spacecat-shared-utils';
14
14
 
15
15
  import { Base } from './base.js';
16
16
  import AuditConfig from './site/audit-config.js';
17
17
  import { Config, DEFAULT_CONFIG } from './site/config.js';
18
+ import { DEFAULT_ORGANIZATION_ID } from './organization.js';
18
19
 
19
20
  export const DELIVERY_TYPES = {
20
21
  AEM_CS: 'aem_cs',
@@ -162,6 +163,10 @@ export const createSite = (data) => {
162
163
  throw new Error('Base URL must be a valid URL');
163
164
  }
164
165
 
166
+ if (!hasText(newState.organizationId)) {
167
+ newState.organizationId = DEFAULT_ORGANIZATION_ID;
168
+ }
169
+
165
170
  newState.deliveryType = newState.deliveryType || DEFAULT_DELIVERY_TYPE;
166
171
  if (!Object.values(DELIVERY_TYPES).includes(newState.deliveryType)) {
167
172
  throw new Error(`Invalid delivery type: ${newState.deliveryType}`);