-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathadditional-domains.fixtures.ts
More file actions
151 lines (137 loc) · 4.48 KB
/
Copy pathadditional-domains.fixtures.ts
File metadata and controls
151 lines (137 loc) · 4.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
// Copyright (c) 2025 ObjectStack. Licensed under the Apache-2.0 license.
// FROZEN bare-literal fixtures for the remaining authoring domains (#2035), so
// the downstream contract exercises the FULL writable surface, not just a few
// domains. Authored the way a third party on a published release did, typed with
// the spec's own input aliases. DO NOT migrate these to the defineX factories
// and DO NOT edit them to make a failing spec change pass — see the README.
import type { DatasourceInput, MappingInput, CubeInput, ObjectExtensionInput } from '@objectstack/spec/data';
import type { ConnectorInput } from '@objectstack/spec/integration';
import type { PolicyInput, SharingRuleInput, PermissionSetInput } from '@objectstack/spec/security';
import type { RoleInput } from '@objectstack/spec/identity';
import type { EmailTemplateDefinitionInput, TranslationBundleInput } from '@objectstack/spec/system';
import type { WebhookInput } from '@objectstack/spec/automation';
import type { ThemeInput } from '@objectstack/spec/ui';
export const DcDatasource: DatasourceInput = {
name: 'dc_primary',
label: 'DC Primary',
driver: 'sqlite',
config: { filename: ':memory:' },
active: true,
};
export const DcConnector: ConnectorInput = {
name: 'dc_hubspot',
label: 'DC HubSpot',
type: 'saas',
description: 'Example SaaS connector.',
authentication: {
type: 'oauth2',
authorizationUrl: 'https://example.com/oauth/authorize',
tokenUrl: 'https://example.com/oauth/token',
clientId: 'env:DC_CLIENT_ID',
clientSecret: 'env:DC_CLIENT_SECRET',
},
actions: [
{
key: 'create_contact',
label: 'Create Contact',
description: 'Create a contact',
inputSchema: { type: 'object', properties: { email: { type: 'string' } }, required: ['email'] },
},
],
};
export const DcPolicy: PolicyInput = {
name: 'dc_default_policy',
isDefault: true,
password: { minLength: 12, requireUppercase: true, requireNumbers: true },
session: { idleTimeout: 30, absoluteTimeout: 480 },
};
export const DcSharingRule: SharingRuleInput = {
type: 'criteria',
name: 'dc_share_customers',
label: 'Customers → managers',
object: 'dc_account',
condition: 'record.stage == "customer"',
accessLevel: 'read',
sharedWith: { type: 'role', value: 'dc_manager' },
active: true,
};
export const DcRole: RoleInput = {
name: 'dc_manager',
label: 'DC Manager',
description: 'Manager role.',
};
export const DcPermissionSet: PermissionSetInput = {
name: 'dc_user',
label: 'DC User',
isProfile: false,
objects: {
dc_account: { allowRead: true, allowCreate: true, allowEdit: true, allowDelete: false },
},
};
export const DcEmail: EmailTemplateDefinitionInput = {
name: 'dc.welcome',
label: 'DC Welcome',
category: 'marketing',
locale: 'en-US',
subject: 'Welcome {{contact.first_name}}',
bodyHtml: '<p>Hi {{contact.first_name}}, welcome.</p>',
bodyText: 'Hi {{contact.first_name}}, welcome.',
variables: [{ name: 'contact.first_name', type: 'string', required: true }],
active: true,
};
export const DcWebhook: WebhookInput = {
name: 'dc_account_changed',
label: 'Account Changed',
object: 'dc_account',
triggers: ['create', 'update'],
url: 'https://hooks.example.com/dc/account',
method: 'POST',
isActive: true,
};
export const DcObjectExtension: ObjectExtensionInput = {
extend: 'dc_account',
label: 'Account (extended)',
fields: {
note: { name: 'note', label: 'Note', type: 'text', maxLength: 255 },
},
priority: 210,
};
export const DcCube: CubeInput = {
name: 'dc_pipeline',
title: 'DC Pipeline',
description: 'Account analytics.',
sql: 'dc_account',
measures: {
count: { name: 'count', label: 'Count', type: 'count', sql: '*' },
},
dimensions: {
stage: { name: 'stage', label: 'Stage', type: 'string', sql: 'stage' },
},
};
export const DcMapping: MappingInput = {
name: 'dc_csv_import',
label: 'CSV Import: Accounts',
sourceFormat: 'csv',
targetObject: 'dc_account',
mode: 'upsert',
upsertKey: ['name'],
fieldMapping: [{ source: 'Name', target: 'name', transform: 'none' }],
};
export const DcTheme: ThemeInput = {
name: 'dc_light',
label: 'DC Light',
mode: 'light',
colors: {
primary: '#1E6FD9',
secondary: '#6C757D',
background: '#FFFFFF',
surface: '#F8F9FA',
text: '#212529',
},
};
export const DcTranslationBundle: TranslationBundleInput = {
en: {
objects: { dc_account: { label: 'Account', pluralLabel: 'Accounts' } },
messages: { 'common.save': 'Save' },
},
};