@adobe/spacecat-shared-data-access 3.43.0 → 3.44.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.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## [@adobe/spacecat-shared-data-access-v3.44.0](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-data-access-v3.43.0...@adobe/spacecat-shared-data-access-v3.44.0) (2026-04-02)
2
+
3
+ ### Features
4
+
5
+ * add ContactSalesLead entity (SITES-42069) ([#1475](https://github.com/adobe/spacecat-shared/issues/1475)) ([d245781](https://github.com/adobe/spacecat-shared/commit/d2457810e7a01900b2da70b0f81f031f95acdffa))
6
+
1
7
  ## [@adobe/spacecat-shared-data-access-v3.43.0](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-data-access-v3.42.0...@adobe/spacecat-shared-data-access-v3.43.0) (2026-04-02)
2
8
 
3
9
  ### Features
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe/spacecat-shared-data-access",
3
- "version": "3.43.0",
3
+ "version": "3.44.0",
4
4
  "description": "Shared modules of the Spacecat Services - Data Access",
5
5
  "type": "module",
6
6
  "engines": {
@@ -15,6 +15,7 @@ import { collectionNameToEntityName, decapitalize } from '../../util/util.js';
15
15
 
16
16
  import ApiKeyCollection from '../api-key/api-key.collection.js';
17
17
  import AsyncJobCollection from '../async-job/async-job.collection.js';
18
+ import ContactSalesLeadCollection from '../contact-sales-lead/contact-sales-lead.collection.js';
18
19
  import AuditCollection from '../audit/audit.collection.js';
19
20
  import AuditUrlCollection from '../audit-url/audit-url.collection.js';
20
21
  import ConfigurationCollection from '../configuration/configuration.collection.js';
@@ -54,6 +55,7 @@ import SiteImsOrgAccessCollection from '../site-ims-org-access/site-ims-org-acce
54
55
 
55
56
  import ApiKeySchema from '../api-key/api-key.schema.js';
56
57
  import AsyncJobSchema from '../async-job/async-job.schema.js';
58
+ import ContactSalesLeadSchema from '../contact-sales-lead/contact-sales-lead.schema.js';
57
59
  import AuditSchema from '../audit/audit.schema.js';
58
60
  import AuditUrlSchema from '../audit-url/audit-url.schema.js';
59
61
  import ConsumerSchema from '../consumer/consumer.schema.js';
@@ -187,6 +189,7 @@ class EntityRegistry {
187
189
  // Register ElectroDB-based entities only (Configuration is handled separately)
188
190
  EntityRegistry.registerEntity(ApiKeySchema, ApiKeyCollection);
189
191
  EntityRegistry.registerEntity(AsyncJobSchema, AsyncJobCollection);
192
+ EntityRegistry.registerEntity(ContactSalesLeadSchema, ContactSalesLeadCollection);
190
193
  EntityRegistry.registerEntity(AuditSchema, AuditCollection);
191
194
  EntityRegistry.registerEntity(AuditUrlSchema, AuditUrlCollection);
192
195
  EntityRegistry.registerEntity(ConsumerSchema, ConsumerCollection);
@@ -0,0 +1,27 @@
1
+ /*
2
+ * Copyright 2026 Adobe. All rights reserved.
3
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ * you may not use this file except in compliance with the License. You may obtain a copy
5
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
6
+ *
7
+ * Unless required by applicable law or agreed to in writing, software distributed under
8
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ * OF ANY KIND, either express or implied. See the License for the specific language
10
+ * governing permissions and limitations under the License.
11
+ */
12
+
13
+ import BaseCollection from '../base/base.collection.js';
14
+
15
+ /**
16
+ * ContactSalesLeadCollection - A collection class responsible for managing
17
+ * ContactSalesLead entities. Extends the BaseCollection to provide specific
18
+ * methods for interacting with ContactSalesLead records.
19
+ *
20
+ * @class ContactSalesLeadCollection
21
+ * @extends BaseCollection
22
+ */
23
+ class ContactSalesLeadCollection extends BaseCollection {
24
+ static COLLECTION_NAME = 'ContactSalesLeadCollection';
25
+ }
26
+
27
+ export default ContactSalesLeadCollection;
@@ -0,0 +1,32 @@
1
+ /*
2
+ * Copyright 2026 Adobe. All rights reserved.
3
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ * you may not use this file except in compliance with the License. You may obtain a copy
5
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
6
+ *
7
+ * Unless required by applicable law or agreed to in writing, software distributed under
8
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ * OF ANY KIND, either express or implied. See the License for the specific language
10
+ * governing permissions and limitations under the License.
11
+ */
12
+
13
+ import BaseModel from '../base/base.model.js';
14
+
15
+ /**
16
+ * ContactSalesLead - A class representing a contact sales lead entity.
17
+ * Tracks users who have expressed interest in purchasing via the "Contact Sales" flow.
18
+ *
19
+ * @class ContactSalesLead
20
+ * @extends BaseModel
21
+ */
22
+ class ContactSalesLead extends BaseModel {
23
+ static ENTITY_NAME = 'ContactSalesLead';
24
+
25
+ static STATUSES = {
26
+ NEW: 'NEW',
27
+ CONTACTED: 'CONTACTED',
28
+ CLOSED: 'CLOSED',
29
+ };
30
+ }
31
+
32
+ export default ContactSalesLead;
@@ -0,0 +1,40 @@
1
+ /*
2
+ * Copyright 2026 Adobe. All rights reserved.
3
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ * you may not use this file except in compliance with the License. You may obtain a copy
5
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
6
+ *
7
+ * Unless required by applicable law or agreed to in writing, software distributed under
8
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ * OF ANY KIND, either express or implied. See the License for the specific language
10
+ * governing permissions and limitations under the License.
11
+ */
12
+
13
+ import SchemaBuilder from '../base/schema.builder.js';
14
+ import ContactSalesLead from './contact-sales-lead.model.js';
15
+ import ContactSalesLeadCollection from './contact-sales-lead.collection.js';
16
+
17
+ const schema = new SchemaBuilder(ContactSalesLead, ContactSalesLeadCollection)
18
+ .addReference('belongs_to', 'Organization')
19
+ .addReference('belongs_to', 'Site', [], { required: false })
20
+ .addAttribute('name', {
21
+ type: 'string',
22
+ required: true,
23
+ })
24
+ .addAttribute('email', {
25
+ type: 'string',
26
+ required: true,
27
+ })
28
+ .addAttribute('domain', {
29
+ type: 'string',
30
+ })
31
+ .addAttribute('notes', {
32
+ type: 'string',
33
+ })
34
+ .addAttribute('status', {
35
+ type: Object.values(ContactSalesLead.STATUSES),
36
+ required: true,
37
+ default: ContactSalesLead.STATUSES.NEW,
38
+ });
39
+
40
+ export default schema.build();
@@ -0,0 +1,41 @@
1
+ /*
2
+ * Copyright 2026 Adobe. All rights reserved.
3
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ * you may not use this file except in compliance with the License. You may obtain a copy
5
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
6
+ *
7
+ * Unless required by applicable law or agreed to in writing, software distributed under
8
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ * OF ANY KIND, either express or implied. See the License for the specific language
10
+ * governing permissions and limitations under the License.
11
+ */
12
+
13
+ import type {
14
+ BaseCollection, BaseModel, Organization, Site,
15
+ } from '../index';
16
+
17
+ export type ContactSalesLeadStatus = 'NEW' | 'CONTACTED' | 'CLOSED';
18
+
19
+ export interface ContactSalesLead extends BaseModel {
20
+ getName(): string;
21
+ getEmail(): string;
22
+ getDomain(): string | null;
23
+ getSiteId(): string | null;
24
+ getNotes(): string | null;
25
+ getStatus(): ContactSalesLeadStatus;
26
+ getOrganization(): Promise<Organization>;
27
+ getSite(): Promise<Site | null>;
28
+ setName(name: string): ContactSalesLead;
29
+ setEmail(email: string): ContactSalesLead;
30
+ setDomain(domain: string): ContactSalesLead;
31
+ setSiteId(siteId: string): ContactSalesLead;
32
+ setNotes(notes: string): ContactSalesLead;
33
+ setStatus(status: ContactSalesLeadStatus): ContactSalesLead;
34
+ }
35
+
36
+ export interface ContactSalesLeadCollection extends BaseCollection<ContactSalesLead> {
37
+ allByOrganizationId(organizationId: string): Promise<ContactSalesLead[]>;
38
+ allBySiteId(siteId: string): Promise<ContactSalesLead[]>;
39
+ findByOrganizationId(organizationId: string): Promise<ContactSalesLead | null>;
40
+ findBySiteId(siteId: string): Promise<ContactSalesLead | null>;
41
+ }
@@ -0,0 +1,19 @@
1
+ /*
2
+ * Copyright 2026 Adobe. All rights reserved.
3
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ * you may not use this file except in compliance with the License. You may obtain a copy
5
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
6
+ *
7
+ * Unless required by applicable law or agreed to in writing, software distributed under
8
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ * OF ANY KIND, either express or implied. See the License for the specific language
10
+ * governing permissions and limitations under the License.
11
+ */
12
+
13
+ import ContactSalesLead from './contact-sales-lead.model.js';
14
+ import ContactSalesLeadCollection from './contact-sales-lead.collection.js';
15
+
16
+ export {
17
+ ContactSalesLead,
18
+ ContactSalesLeadCollection,
19
+ };
@@ -13,6 +13,7 @@
13
13
  export * from './access-grant-log/index.js';
14
14
  export * from './api-key/index.js';
15
15
  export * from './async-job/index.js';
16
+ export * from './contact-sales-lead/index.js';
16
17
  export * from './audit/index.js';
17
18
  export * from './audit-url/index.js';
18
19
  export * from './base/index.js';