@adminide-stack/yantra-mobile 12.0.162-alpha.1 → 12.0.162-alpha.2

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.
Files changed (103) hide show
  1. package/lib/components/CustomDrawer.js +70 -3
  2. package/lib/components/CustomDrawer.js.map +1 -1
  3. package/lib/compute.js +3 -1
  4. package/lib/config/env-config.js +4 -0
  5. package/lib/config/env-config.js.map +1 -1
  6. package/lib/features/credits/credits.js +151 -0
  7. package/lib/features/credits/credits.js.map +1 -0
  8. package/lib/features/credits/useLlmCredits.js +87 -0
  9. package/lib/features/credits/useLlmCredits.js.map +1 -0
  10. package/lib/features/design/surface/agentWriter.js +39 -0
  11. package/lib/features/design/surface/agentWriter.js.map +1 -0
  12. package/lib/features/design/surface/brandKit.js +9 -3
  13. package/lib/features/design/surface/brandKit.js.map +1 -1
  14. package/lib/features/design/surface/useBrandKitInUse.js.map +1 -1
  15. package/lib/features/design/surface/useDesignSurface.js +5 -39
  16. package/lib/features/design/surface/useDesignSurface.js.map +1 -1
  17. package/lib/features/webbuilder/WebBuilderExperience.js +64 -23
  18. package/lib/features/webbuilder/WebBuilderExperience.js.map +1 -1
  19. package/lib/features/webbuilder/brandKitMove.js +52 -0
  20. package/lib/features/webbuilder/brandKitMove.js.map +1 -0
  21. package/lib/features/webbuilder/codeToolbox.js +129 -0
  22. package/lib/features/webbuilder/codeToolbox.js.map +1 -0
  23. package/lib/features/webbuilder/components/CloudSheet.js +1451 -0
  24. package/lib/features/webbuilder/components/CloudSheet.js.map +1 -0
  25. package/lib/features/webbuilder/components/CodeActionsSheet.js +125 -0
  26. package/lib/features/webbuilder/components/CodeActionsSheet.js.map +1 -0
  27. package/lib/features/webbuilder/components/CodeView.js +10 -3
  28. package/lib/features/webbuilder/components/CodeView.js.map +1 -1
  29. package/lib/features/webbuilder/components/Composer.js.map +1 -1
  30. package/lib/features/webbuilder/components/IntegrationsPanel.js +643 -0
  31. package/lib/features/webbuilder/components/IntegrationsPanel.js.map +1 -0
  32. package/lib/features/webbuilder/components/ProjectChat.js +57 -44
  33. package/lib/features/webbuilder/components/ProjectChat.js.map +1 -1
  34. package/lib/features/webbuilder/components/SecretsSheet.js +235 -0
  35. package/lib/features/webbuilder/components/SecretsSheet.js.map +1 -0
  36. package/lib/features/webbuilder/components/StudioHome.js +38 -1
  37. package/lib/features/webbuilder/components/StudioHome.js.map +1 -1
  38. package/lib/features/webbuilder/studioCatalog.js +4 -19
  39. package/lib/features/webbuilder/studioCatalog.js.map +1 -1
  40. package/lib/features/webbuilder/web/data/cloud.js +387 -0
  41. package/lib/features/webbuilder/web/data/cloud.js.map +1 -0
  42. package/lib/features/webbuilder/web/data/dataApi.js +227 -0
  43. package/lib/features/webbuilder/web/data/dataApi.js.map +1 -0
  44. package/lib/features/webbuilder/web/data/database.js +190 -0
  45. package/lib/features/webbuilder/web/data/database.js.map +1 -0
  46. package/lib/features/webbuilder/web/data/graphql.js +95 -0
  47. package/lib/features/webbuilder/web/data/graphql.js.map +1 -0
  48. package/lib/features/webbuilder/web/design/directions.js +343 -0
  49. package/lib/features/webbuilder/web/design/directions.js.map +1 -0
  50. package/lib/features/webbuilder/web/integrations/appToken.js +165 -0
  51. package/lib/features/webbuilder/web/integrations/appToken.js.map +1 -0
  52. package/lib/features/webbuilder/web/integrations/catalog.js +238 -0
  53. package/lib/features/webbuilder/web/integrations/catalog.js.map +1 -0
  54. package/lib/features/webbuilder/web/integrations/siteBilling.js +67 -0
  55. package/lib/features/webbuilder/web/integrations/siteBilling.js.map +1 -0
  56. package/lib/features/webbuilder/web/integrations/siteMail.js +190 -0
  57. package/lib/features/webbuilder/web/integrations/siteMail.js.map +1 -0
  58. package/lib/features/webbuilder/web/project/projectSettings.js +11 -0
  59. package/lib/features/webbuilder/web/project/projectSettings.js.map +1 -0
  60. package/lib/features/webbuilder/web/project/restorePoint.js +16 -0
  61. package/lib/features/webbuilder/web/project/restorePoint.js.map +1 -0
  62. package/lib/features/webbuilder/web/project/serverSettings.js +157 -0
  63. package/lib/features/webbuilder/web/project/serverSettings.js.map +1 -0
  64. package/lib/features/webbuilder/web/secrets/secrets.js +162 -0
  65. package/lib/features/webbuilder/web/secrets/secrets.js.map +1 -0
  66. package/lib/features/webbuilder/web/secrets/secretsApi.js +302 -0
  67. package/lib/features/webbuilder/web/secrets/secretsApi.js.map +1 -0
  68. package/lib/features/webbuilder/web/secrets/secretsStore.js +39 -0
  69. package/lib/features/webbuilder/web/secrets/secretsStore.js.map +1 -0
  70. package/lib/features/webbuilder/web/sharing/okResult.js +40 -0
  71. package/lib/features/webbuilder/web/sharing/okResult.js.map +1 -0
  72. package/lib/features/webbuilder/web/sharing/roles.js +3 -0
  73. package/lib/features/webbuilder/web/sharing/roles.js.map +1 -0
  74. package/lib/features/webbuilder/web/state/storageKeys.js +59 -0
  75. package/lib/features/webbuilder/web/state/storageKeys.js.map +1 -0
  76. package/lib/features/webbuilder/web/webServices.js +282 -0
  77. package/lib/features/webbuilder/web/webServices.js.map +1 -0
  78. package/lib/features/webbuilder/workflow.js +1 -1
  79. package/lib/features/webbuilder/workflow.js.map +1 -1
  80. package/lib/routes.json +3 -1
  81. package/lib/screens/Account/AccountSheets.js +1049 -0
  82. package/lib/screens/Account/AccountSheets.js.map +1 -0
  83. package/lib/screens/Account/WorkspaceSection.js +271 -0
  84. package/lib/screens/Account/WorkspaceSection.js.map +1 -0
  85. package/lib/screens/Account/accountRules.js +103 -0
  86. package/lib/screens/Account/accountRules.js.map +1 -0
  87. package/lib/screens/Account/index.js +563 -259
  88. package/lib/screens/Account/index.js.map +1 -1
  89. package/lib/screens/Account/useAccountPreferences.js +87 -0
  90. package/lib/screens/Account/useAccountPreferences.js.map +1 -0
  91. package/lib/screens/WebBuilderNative/index.js +1 -1
  92. package/lib/screens/WebBuilderNative/index.js.map +1 -1
  93. package/lib/screens/WebBuilderNative/useWebBuilderHost.js +122 -12
  94. package/lib/screens/WebBuilderNative/useWebBuilderHost.js.map +1 -1
  95. package/lib/utils/authUserDisplay.js +1 -9
  96. package/lib/utils/authUserDisplay.js.map +1 -1
  97. package/package.json +4 -4
  98. package/lib/features/webbuilder/brandKitStorage.js +0 -69
  99. package/lib/features/webbuilder/brandKitStorage.js.map +0 -1
  100. package/lib/features/webbuilder/components/BrandKitSheet.js +0 -197
  101. package/lib/features/webbuilder/components/BrandKitSheet.js.map +0 -1
  102. package/lib/screens/Account/splitDisplayName.js +0 -15
  103. package/lib/screens/Account/splitDisplayName.js.map +0 -1
@@ -0,0 +1,282 @@
1
+ import {createDataService}from'./data/dataApi.js';import {createSecretsService}from'./secrets/secretsApi.js';import {SecretsCredentialStore}from'./secrets/secretsStore.js';import {connectorConnectUrl,checkApiKey,API_KEY_CONNECT,INTEGRATION_CREDENTIALS_QUERY,parseCredentials,INTEGRATION_CATALOG_QUERY,withBuiltInEntries,parseCatalog}from'./integrations/catalog.js';import {createAppSecretsAdapter,mintAndStoreAppToken,appTokenStatusFromNames}from'./integrations/appToken.js';import {enableSiteBilling}from'./integrations/siteBilling.js';import {disableSiteMail,siteMailStatus,enableSiteMail}from'./integrations/siteMail.js';import {PROJECT_SETTINGS_QUERY,parseServerProjectSettings}from'./project/serverSettings.js';var __defProp = Object.defineProperty;
2
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
3
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
4
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
5
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6
+ var __spreadValues = (a, b) => {
7
+ for (var prop in b || (b = {}))
8
+ if (__hasOwnProp.call(b, prop))
9
+ __defNormalProp(a, prop, b[prop]);
10
+ if (__getOwnPropSymbols)
11
+ for (var prop of __getOwnPropSymbols(b)) {
12
+ if (__propIsEnum.call(b, prop))
13
+ __defNormalProp(a, prop, b[prop]);
14
+ }
15
+ return a;
16
+ };
17
+ const SITE_AGENT_URL = "https://cdecli-agent.cdebase.dev";
18
+ const CREATE_CUSTOM_CONNECTOR = `
19
+ mutation CreateCustomConnectorExtension($input: CreateCustomConnectorExtensionInput!) {
20
+ createCustomConnectorExtension(input: $input) {
21
+ success message credentialId authorizationUrl connectorType
22
+ }
23
+ }`;
24
+ function credentialSafeName(raw) {
25
+ return raw.replace(/[^A-Za-z0-9 _-]+/g, " ").replace(/\s+/g, " ").trim() || "Credential";
26
+ }
27
+ function newUuid() {
28
+ return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (c) => {
29
+ const r = Math.floor(Math.random() * 16);
30
+ return (c === "x" ? r : r % 4 + 8).toString(16);
31
+ });
32
+ }
33
+ function apiKeyConnectorInput(connectorId, spec, key, scope) {
34
+ const name = credentialSafeName(`${spec.label} web builder`);
35
+ return {
36
+ name,
37
+ description: `Custom connector for ${connectorId}`,
38
+ extensionUuid: newUuid(),
39
+ orgName: scope.orgName,
40
+ projectId: scope.projectId,
41
+ environmentTag: scope.environmentTagId,
42
+ publisher: scope.orgName,
43
+ connectorType: "app",
44
+ provider: {
45
+ id: connectorId,
46
+ name,
47
+ title: name,
48
+ description: `${spec.label} credential`,
49
+ baseUrl: spec.baseUrl,
50
+ providerUrl: "",
51
+ logo: "",
52
+ categories: ["other"],
53
+ category: "other",
54
+ authMethods: ["api_key"],
55
+ authorizationUrl: "",
56
+ tokenUrl: "",
57
+ revocationUrl: "",
58
+ mcpUrl: "",
59
+ scopes: "",
60
+ clientAuthMethod: "client_secret_post",
61
+ useBasicAuth: false,
62
+ useCustomOAuthEndpoints: false,
63
+ usePKCE: false,
64
+ color: "",
65
+ iconName: "AiOutlineApi",
66
+ iconFontSize: "large",
67
+ enabled: true,
68
+ fields: [{
69
+ defaultValue: "",
70
+ description: "",
71
+ enumValues: "",
72
+ genericType: "api_key",
73
+ iconType: "",
74
+ isConfigField: true,
75
+ isSecret: true,
76
+ label: spec.field.label,
77
+ name: spec.field.name,
78
+ placeholder: "",
79
+ placement: "none",
80
+ placementKey: "",
81
+ readOnly: false,
82
+ required: false,
83
+ scope: 4,
84
+ secretKey: spec.field.secretKey,
85
+ secretType: "ENVIRONMENT_VAR",
86
+ type: "string",
87
+ uiWidget: "password"
88
+ }]
89
+ },
90
+ values: {
91
+ authMethod: "api_key",
92
+ [spec.field.name]: key.trim()
93
+ }
94
+ };
95
+ }
96
+ function createWebServices(opts) {
97
+ const {
98
+ transport,
99
+ scope
100
+ } = opts;
101
+ const data = createDataService(transport);
102
+ const secrets = createSecretsService({
103
+ transport,
104
+ data,
105
+ store: new SecretsCredentialStore(null),
106
+ scope: () => {
107
+ const s = scope();
108
+ return {
109
+ orgName: s.orgName,
110
+ project: s.projectId
111
+ };
112
+ }
113
+ });
114
+ const appSecrets = createAppSecretsAdapter(secrets);
115
+ const gql = (query, variables) => transport.mutate(query, variables);
116
+ const keepCredential = async (channelId, credentialId) => {
117
+ var _a;
118
+ if (!credentialId) return;
119
+ const s = await data.getSettings(channelId);
120
+ if (s.ok && ((_a = s.value) == null ? void 0 : _a.secretsCredentialId) !== credentialId) {
121
+ await data.updateSettings(channelId, {
122
+ secretsCredentialId: credentialId
123
+ });
124
+ }
125
+ };
126
+ let catalog = null;
127
+ const integrations = {
128
+ loadCatalog: async () => {
129
+ if (!catalog) {
130
+ catalog = transport.query(INTEGRATION_CATALOG_QUERY, {}).then((r) => {
131
+ var _a, _b, _c;
132
+ if (((_a = r.errors) == null ? void 0 : _a.length) && !((_b = r.data) == null ? void 0 : _b.integrationConnectors)) {
133
+ catalog = null;
134
+ throw new Error(r.errors[0].message || "Couldn't load the integrations.");
135
+ }
136
+ return withBuiltInEntries(parseCatalog((_c = r.data) == null ? void 0 : _c.integrationConnectors));
137
+ });
138
+ }
139
+ return catalog;
140
+ },
141
+ loadConnections: async () => {
142
+ var _a, _b, _c, _d;
143
+ const s = scope();
144
+ if (!s.orgName || !s.projectId) return null;
145
+ const r = await transport.query(INTEGRATION_CREDENTIALS_QUERY, {
146
+ filter: __spreadValues({
147
+ orgName: s.orgName,
148
+ projectId: s.projectId
149
+ }, s.environmentTagId ? {
150
+ environmentTag: s.environmentTagId
151
+ } : {}),
152
+ limit: 200
153
+ });
154
+ if (((_a = r.errors) == null ? void 0 : _a.length) && !((_b = r.data) == null ? void 0 : _b.formBuilderCredentials)) return null;
155
+ return parseCredentials((_d = (_c = r.data) == null ? void 0 : _c.formBuilderCredentials) == null ? void 0 : _d.data);
156
+ },
157
+ connectUrl: (connectorId) => opts.appUrl ? connectorConnectUrl(opts.appUrl, connectorId, scope().projectId) : null,
158
+ projectIntegrations: async (channelId) => {
159
+ var _a, _b, _c, _d, _e;
160
+ const r = await transport.query(PROJECT_SETTINGS_QUERY, {
161
+ channelId
162
+ });
163
+ if (((_a = r.errors) == null ? void 0 : _a.length) && ((_b = r.data) == null ? void 0 : _b.aiCodeProjectSettings) === void 0) return null;
164
+ return (_e = (_d = parseServerProjectSettings((_c = r.data) == null ? void 0 : _c.aiCodeProjectSettings)) == null ? void 0 : _d.integrations) != null ? _e : [];
165
+ },
166
+ appTokenStatus: async (project) => {
167
+ var _a;
168
+ if (!project.channelId) return "unavailable";
169
+ try {
170
+ return appTokenStatusFromNames(await appSecrets.listSecretNames({
171
+ channelId: project.channelId,
172
+ projectId: (_a = project.projectId) != null ? _a : void 0
173
+ }));
174
+ } catch (e) {
175
+ return "unavailable";
176
+ }
177
+ },
178
+ createAppToken: async (project) => {
179
+ var _a;
180
+ if (!project.channelId) return {
181
+ ok: false,
182
+ message: "Open a project first."
183
+ };
184
+ const r = await mintAndStoreAppToken({
185
+ channelId: project.channelId,
186
+ projectId: (_a = project.projectId) != null ? _a : void 0,
187
+ scope: scope(),
188
+ agentUrl: SITE_AGENT_URL,
189
+ secrets: appSecrets,
190
+ gql
191
+ });
192
+ const minted = r;
193
+ if (!minted.ok) return {
194
+ ok: false,
195
+ message: minted.message
196
+ };
197
+ await keepCredential(project.channelId, minted.credentialId);
198
+ return minted.warning ? {
199
+ ok: true,
200
+ message: minted.warning
201
+ } : {
202
+ ok: true
203
+ };
204
+ },
205
+ enableSiteBilling: async (project, stripeCredentialId) => {
206
+ var _a;
207
+ if (!project.channelId) return {
208
+ ok: false,
209
+ message: "Open a project first."
210
+ };
211
+ const r = await enableSiteBilling({
212
+ channelId: project.channelId,
213
+ projectId: (_a = project.projectId) != null ? _a : void 0,
214
+ stripeCredentialId,
215
+ secrets: appSecrets,
216
+ gql
217
+ });
218
+ const billed = r;
219
+ if (billed.ok) await keepCredential(project.channelId, billed.credentialId);
220
+ return billed.ok ? {
221
+ ok: true
222
+ } : {
223
+ ok: false,
224
+ message: billed.message
225
+ };
226
+ },
227
+ connectApiKey: async (connectorId, key) => {
228
+ var _a, _b, _c, _d;
229
+ const spec = API_KEY_CONNECT[connectorId];
230
+ if (!spec || !checkApiKey(connectorId, key).ok) {
231
+ return {
232
+ ok: false,
233
+ message: `That doesn't look like a ${(_a = spec == null ? void 0 : spec.label) != null ? _a : ""} secret key.`
234
+ };
235
+ }
236
+ const s = scope();
237
+ if (!s.orgName || !s.projectId || !s.environmentTagId) {
238
+ return {
239
+ ok: false,
240
+ message: "Can't tell which workspace to save the key in. Sign in again, then retry."
241
+ };
242
+ }
243
+ const r = await transport.mutate(CREATE_CUSTOM_CONNECTOR, {
244
+ input: apiKeyConnectorInput(connectorId, spec, key, s)
245
+ });
246
+ const created = (_b = r.data) == null ? void 0 : _b.createCustomConnectorExtension;
247
+ if (!(created == null ? void 0 : created.credentialId)) {
248
+ return {
249
+ ok: false,
250
+ message: (created == null ? void 0 : created.message) || ((_d = (_c = r.errors) == null ? void 0 : _c[0]) == null ? void 0 : _d.message) || `${spec.label} couldn't be connected.`
251
+ };
252
+ }
253
+ return {
254
+ ok: true
255
+ };
256
+ },
257
+ siteMail: {
258
+ enable: async (project, domain, notifyTo) => {
259
+ var _a;
260
+ const r = await enableSiteMail({
261
+ channelId: project.channelId,
262
+ projectId: (_a = project.projectId) != null ? _a : void 0,
263
+ domain,
264
+ notifyTo,
265
+ secrets: appSecrets,
266
+ gql
267
+ });
268
+ const mailed = r;
269
+ if (mailed.ok) await keepCredential(project.channelId, mailed.credentialId);
270
+ return r;
271
+ },
272
+ status: (project, diagnose) => siteMailStatus(gql, project.channelId, diagnose),
273
+ disable: (project) => disableSiteMail(gql, project.channelId)
274
+ }
275
+ };
276
+ return {
277
+ data,
278
+ secrets,
279
+ appSecrets,
280
+ integrations
281
+ };
282
+ }export{SITE_AGENT_URL,createWebServices};//# sourceMappingURL=webServices.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"webServices.js","sources":["../../../../src/features/webbuilder/web/webServices.ts"],"sourcesContent":["/**\n * The web panels' services on the phone: Secrets (`secrets/secretsApi`), Cloud (`data/dataApi`) and\n * Integrations (web `integrations/useIntegrationsService`), built from the web's own modules over the\n * host's GraphQL seam. Each call is the web's request, unchanged. Pure (no React).\n */\nimport { createDataService, type WebBuilderDataService } from './data/dataApi';\nimport type { GraphqlTransport } from './data/graphql';\nimport { createSecretsService, type WebBuilderSecretsService } from './secrets/secretsApi';\nimport { SecretsCredentialStore } from './secrets/secretsStore';\nimport {\n API_KEY_CONNECT,\n INTEGRATION_CATALOG_QUERY,\n INTEGRATION_CREDENTIALS_QUERY,\n checkApiKey,\n connectorConnectUrl,\n parseCatalog,\n parseCredentials,\n withBuiltInEntries,\n type IntegrationCatalogEntry,\n type IntegrationCredential,\n} from './integrations/catalog';\nimport {\n appTokenStatusFromNames,\n createAppSecretsAdapter,\n mintAndStoreAppToken,\n type AppSecretsAdapter,\n type AppTokenStatus,\n} from './integrations/appToken';\nimport { enableSiteBilling } from './integrations/siteBilling';\nimport { disableSiteMail, enableSiteMail, siteMailStatus } from './integrations/siteMail';\nimport { PROJECT_SETTINGS_QUERY, parseServerProjectSettings, type ProjectIntegration } from './project/serverSettings';\n\nexport interface WebScope {\n orgName: string;\n projectId: string;\n environmentTagId: string;\n}\n\n/** The agent a published site calls (`YANTRA_AGENT_URL`), as the web's hosted agent. */\nexport const SITE_AGENT_URL = 'https://cdecli-agent.cdebase.dev';\n\n/** surface-kit `connectApiKeyConnector`'s request: the connector entry plus the key, recorded `active`. */\nconst CREATE_CUSTOM_CONNECTOR = `\n mutation CreateCustomConnectorExtension($input: CreateCustomConnectorExtensionInput!) {\n createCustomConnectorExtension(input: $input) {\n success message credentialId authorizationUrl connectorType\n }\n }`;\n\nfunction credentialSafeName(raw: string): string {\n return (\n raw\n .replace(/[^A-Za-z0-9 _-]+/g, ' ')\n .replace(/\\s+/g, ' ')\n .trim() || 'Credential'\n );\n}\n\nfunction newUuid(): string {\n return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, (c) => {\n const r = Math.floor(Math.random() * 16);\n return (c === 'x' ? r : (r % 4) + 8).toString(16);\n });\n}\n\n/** surface-kit `buildCustomConnectorInput` for an api_key connector (the fields Stripe sends). */\nfunction apiKeyConnectorInput(\n connectorId: string,\n spec: (typeof API_KEY_CONNECT)[string],\n key: string,\n scope: WebScope,\n): Record<string, unknown> {\n const name = credentialSafeName(`${spec.label} web builder`);\n return {\n name,\n description: `Custom connector for ${connectorId}`,\n extensionUuid: newUuid(),\n orgName: scope.orgName,\n projectId: scope.projectId,\n environmentTag: scope.environmentTagId,\n publisher: scope.orgName,\n connectorType: 'app',\n provider: {\n id: connectorId,\n name,\n title: name,\n description: `${spec.label} credential`,\n baseUrl: spec.baseUrl,\n providerUrl: '',\n logo: '',\n categories: ['other'],\n category: 'other',\n authMethods: ['api_key'],\n authorizationUrl: '',\n tokenUrl: '',\n revocationUrl: '',\n mcpUrl: '',\n scopes: '',\n clientAuthMethod: 'client_secret_post',\n useBasicAuth: false,\n useCustomOAuthEndpoints: false,\n usePKCE: false,\n color: '',\n iconName: 'AiOutlineApi',\n iconFontSize: 'large',\n enabled: true,\n fields: [\n {\n defaultValue: '',\n description: '',\n enumValues: '',\n genericType: 'api_key',\n iconType: '',\n isConfigField: true,\n isSecret: true,\n label: spec.field.label,\n name: spec.field.name,\n placeholder: '',\n placement: 'none',\n placementKey: '',\n readOnly: false,\n required: false,\n scope: 4,\n secretKey: spec.field.secretKey,\n secretType: 'ENVIRONMENT_VAR',\n type: 'string',\n uiWidget: 'password',\n },\n ],\n },\n values: { authMethod: 'api_key', [spec.field.name]: key.trim() },\n };\n}\n\n/** A project as the web services read it. */\nexport interface WebProjectRef {\n channelId: string;\n projectId?: string | null;\n sandboxId?: string | null;\n templateId?: string | null;\n}\n\nexport interface WebIntegrationsService {\n loadCatalog: () => Promise<IntegrationCatalogEntry[]>;\n /** The person's connections in this workspace; null when they can't be read. */\n loadConnections: () => Promise<IntegrationCredential[] | null>;\n connectUrl: (connectorId: string) => string | null;\n /** The project's saved integrations (server settings); null when they can't be read. */\n projectIntegrations: (channelId: string) => Promise<ProjectIntegration[] | null>;\n appTokenStatus: (project: WebProjectRef) => Promise<AppTokenStatus>;\n createAppToken: (project: WebProjectRef) => Promise<{ ok: boolean; message?: string }>;\n enableSiteBilling: (\n project: WebProjectRef,\n stripeCredentialId: string,\n ) => Promise<{ ok: boolean; message?: string }>;\n connectApiKey: (connectorId: string, key: string) => Promise<{ ok: boolean; message?: string }>;\n siteMail: {\n enable: (project: WebProjectRef, domain: string, notifyTo: string) => ReturnType<typeof enableSiteMail>;\n status: (project: WebProjectRef, diagnose?: boolean) => ReturnType<typeof siteMailStatus>;\n disable: (project: WebProjectRef) => ReturnType<typeof disableSiteMail>;\n };\n}\n\nexport interface WebServices {\n data: WebBuilderDataService;\n secrets: WebBuilderSecretsService;\n appSecrets: AppSecretsAdapter;\n integrations: WebIntegrationsService;\n}\n\nexport function createWebServices(opts: {\n transport: GraphqlTransport;\n scope: () => WebScope;\n appUrl?: string;\n}): WebServices {\n const { transport, scope } = opts;\n const data = createDataService(transport);\n const secrets = createSecretsService({\n transport,\n data,\n store: new SecretsCredentialStore(null),\n scope: () => {\n const s = scope();\n return { orgName: s.orgName, project: s.projectId };\n },\n });\n const appSecrets = createAppSecretsAdapter(secrets);\n // The web helpers type `errors` as a plain array; the seam's is read-only (same values).\n const gql = <T>(query: string, variables: Record<string, unknown>) =>\n transport.mutate<T>(query, variables) as Promise<{ data?: T; errors?: Array<{ message: string }> }>;\n /** The project's secrets credential is recorded on its settings (web `settingsSync.update`). */\n const keepCredential = async (channelId: string, credentialId?: string | null) => {\n if (!credentialId) return;\n const s = await data.getSettings(channelId);\n if (s.ok && s.value?.secretsCredentialId !== credentialId) {\n await data.updateSettings(channelId, { secretsCredentialId: credentialId });\n }\n };\n let catalog: Promise<IntegrationCatalogEntry[]> | null = null;\n\n const integrations: WebIntegrationsService = {\n loadCatalog: async () => {\n if (!catalog) {\n catalog = transport\n .query<{ integrationConnectors?: unknown }>(INTEGRATION_CATALOG_QUERY, {})\n .then((r) => {\n if (r.errors?.length && !r.data?.integrationConnectors) {\n catalog = null;\n throw new Error(r.errors[0].message || \"Couldn't load the integrations.\");\n }\n return withBuiltInEntries(parseCatalog(r.data?.integrationConnectors));\n });\n }\n return catalog;\n },\n loadConnections: async () => {\n const s = scope();\n if (!s.orgName || !s.projectId) return null;\n const r = await transport.query<{ formBuilderCredentials?: { data?: unknown } }>(\n INTEGRATION_CREDENTIALS_QUERY,\n {\n filter: {\n orgName: s.orgName,\n projectId: s.projectId,\n ...(s.environmentTagId ? { environmentTag: s.environmentTagId } : {}),\n },\n limit: 200,\n },\n );\n if (r.errors?.length && !r.data?.formBuilderCredentials) return null;\n return parseCredentials(r.data?.formBuilderCredentials?.data);\n },\n connectUrl: (connectorId) =>\n opts.appUrl ? connectorConnectUrl(opts.appUrl, connectorId, scope().projectId) : null,\n projectIntegrations: async (channelId) => {\n const r = await transport.query<{ aiCodeProjectSettings?: unknown }>(PROJECT_SETTINGS_QUERY, { channelId });\n if (r.errors?.length && r.data?.aiCodeProjectSettings === undefined) return null;\n return parseServerProjectSettings(r.data?.aiCodeProjectSettings)?.integrations ?? [];\n },\n appTokenStatus: async (project) => {\n if (!project.channelId) return 'unavailable';\n try {\n return appTokenStatusFromNames(\n await appSecrets.listSecretNames({\n channelId: project.channelId,\n projectId: project.projectId ?? undefined,\n }),\n );\n } catch {\n return 'unavailable';\n }\n },\n createAppToken: async (project) => {\n if (!project.channelId) return { ok: false, message: 'Open a project first.' };\n const r = await mintAndStoreAppToken({\n channelId: project.channelId,\n projectId: project.projectId ?? undefined,\n scope: scope(),\n agentUrl: SITE_AGENT_URL,\n secrets: appSecrets,\n gql,\n });\n // The web's result union, read without narrowing (native: no strict null checks).\n const minted = r as { ok: boolean; credentialId?: string; warning?: string; message?: string };\n if (!minted.ok) return { ok: false, message: minted.message };\n await keepCredential(project.channelId, minted.credentialId);\n return minted.warning ? { ok: true, message: minted.warning } : { ok: true };\n },\n enableSiteBilling: async (project, stripeCredentialId) => {\n if (!project.channelId) return { ok: false, message: 'Open a project first.' };\n const r = await enableSiteBilling({\n channelId: project.channelId,\n projectId: project.projectId ?? undefined,\n stripeCredentialId,\n secrets: appSecrets,\n gql,\n });\n const billed = r as { ok: boolean; credentialId?: string; message?: string };\n if (billed.ok) await keepCredential(project.channelId, billed.credentialId);\n return billed.ok ? { ok: true } : { ok: false, message: billed.message };\n },\n connectApiKey: async (connectorId, key) => {\n const spec = API_KEY_CONNECT[connectorId];\n if (!spec || !checkApiKey(connectorId, key).ok) {\n return { ok: false, message: `That doesn't look like a ${spec?.label ?? ''} secret key.` };\n }\n const s = scope();\n if (!s.orgName || !s.projectId || !s.environmentTagId) {\n return {\n ok: false,\n message: \"Can't tell which workspace to save the key in. Sign in again, then retry.\",\n };\n }\n const r = await transport.mutate<{\n createCustomConnectorExtension?: { credentialId?: string; message?: string };\n }>(CREATE_CUSTOM_CONNECTOR, { input: apiKeyConnectorInput(connectorId, spec, key, s) });\n const created = r.data?.createCustomConnectorExtension;\n if (!created?.credentialId) {\n return {\n ok: false,\n message: created?.message || r.errors?.[0]?.message || `${spec.label} couldn't be connected.`,\n };\n }\n return { ok: true };\n },\n siteMail: {\n enable: async (project, domain, notifyTo) => {\n const r = await enableSiteMail({\n channelId: project.channelId,\n projectId: project.projectId ?? undefined,\n domain,\n notifyTo,\n secrets: appSecrets,\n gql,\n });\n const mailed = r as { ok: boolean; credentialId?: string };\n if (mailed.ok) await keepCredential(project.channelId, mailed.credentialId);\n return r;\n },\n status: (project, diagnose) => siteMailStatus(gql, project.channelId, diagnose),\n disable: (project) => disableSiteMail(gql, project.channelId),\n },\n };\n\n return { data, secrets, appSecrets, integrations };\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAqBO,MAAM,cAAiB,GAAA;AAG9B,MAAM,uBAA0B,GAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAAA,CAAA;AAMhC,SAAS,mBAAmB,GAAqB,EAAA;AAC/C,EAAO,OAAA,GAAA,CAAI,OAAQ,CAAA,mBAAA,EAAqB,GAAG,CAAA,CAAE,QAAQ,MAAQ,EAAA,GAAG,CAAE,CAAA,IAAA,EAAU,IAAA,YAAA;AAC9E;AACA,SAAS,OAAkB,GAAA;AACzB,EAAO,OAAA,sCAAA,CAAuC,OAAQ,CAAA,OAAA,EAAS,CAAK,CAAA,KAAA;AAClE,IAAA,MAAM,IAAI,IAAK,CAAA,KAAA,CAAM,IAAK,CAAA,MAAA,KAAW,EAAE,CAAA;AACvC,IAAA,OAAA,CAAQ,MAAM,GAAM,GAAA,CAAA,GAAI,IAAI,CAAI,GAAA,CAAA,EAAG,SAAS,EAAE,CAAA;AAAA,GAC/C,CAAA;AACH;AAGA,SAAS,oBAAqB,CAAA,WAAA,EAAqB,IAAwC,EAAA,GAAA,EAAa,KAA0C,EAAA;AAChJ,EAAA,MAAM,IAAO,GAAA,kBAAA,CAAmB,CAAG,EAAA,IAAA,CAAK,KAAK,CAAc,YAAA,CAAA,CAAA;AAC3D,EAAO,OAAA;AAAA,IACL,IAAA;AAAA,IACA,WAAA,EAAa,wBAAwB,WAAW,CAAA,CAAA;AAAA,IAChD,eAAe,OAAQ,EAAA;AAAA,IACvB,SAAS,KAAM,CAA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,GAAA,EAAA,CAAA,CAAA,CAAA,KAAX,IAAe,GAAA,MAAA,GAAA,EAAA,CAAA,OAAA,CAAA,IAAW,CAAG,EAAA,IAAA,CAAK,KAAK,CAAA,uBAAA;AAAA,SACtE;AAAA;AAEF,MAAO,OAAA;AAAA,QACL,EAAI,EAAA;AAAA,OACN;AAAA,KACF;AAAA,IACA,QAAU,EAAA;AAAA,MACR,MAAQ,EAAA,OAAO,OAAS,EAAA,MAAA,EAAQ,QAAa,KAAA;AA7UnD,QAAA,IAAA,EAAA;AA8UQ,QAAM,MAAA,CAAA,GAAI,MAAM,cAAe,CAAA;AAAA,UAC7B,WAAW,OAAQ,CAAA,SAAA;AAAA,UACnB,SAAA,EAAA,CAAW,EAAQ,GAAA,OAAA,CAAA,SAAA,KAAR,IAAqB,GAAA,EAAA,GAAA,MAAA;AAAA,UAChC,MAAA;AAAA,UACA,QAAA;AAAA,UACA,OAAS,EAAA,UAAA;AAAA,UACT;AAAA,SACD,CAAA;AACD,QAAA,MAAM,MAAS,GAAA,CAAA;AAIf,QAAA,IAAI,OAAO,EAAI,EAAA,MAAM,eAAe,OAAQ,CAAA,SAAA,EAAW,OAAO,YAAY,CAAA;AAC1E,QAAO,OAAA,CAAA;AAAA,OACT;AAAA,MACA,MAAA,EAAQ,CAAC,OAAS,EAAA,QAAA,KAAa,eAAe,GAAK,EAAA,OAAA,CAAQ,WAAW,QAAQ,CAAA;AAAA,MAC9E,OAAS,EAAA,CAAA,OAAA,KAAW,eAAgB,CAAA,GAAA,EAAK,QAAQ,SAAS;AAAA;AAC5D,GACF;AACA,EAAO,OAAA;AAAA,IACL,IAAA;AAAA,IACA,OAAA;AAAA,IACA,UAAA;AAAA,IACA;AAAA,GACF;AACF"}
@@ -537,4 +537,4 @@ function templateRemixNote(template) {
537
537
  const boot = snapshot ? `Boot it with WEBBUILDER_CREATE_SANDBOX {"snapshotId":"${snapshot}","builder":"vite","timeoutMs":3600000,"private":true}.` : `Find it with WEBBUILDER_LIST_TEMPLATES and boot it with that card's start.params.`;
538
538
  return [`[Template] The user picked the Yantra template "${template.title}" to start from - remix it (Remix a template).`, boot, "They already chose this template: do not ask how to start. Ask only what you still need, then build and give the live preview link."].join(" ");
539
539
  }
540
- const WEBBUILDER_CHAT_SKILL = "yantra-skills/webbuilder-design-pro";export{APP_SETTINGS_AIEDITOR_KEY,CODE_ASSISTANT_TEMPLATE_CONFIG_KEY,DEFAULT_MODEL_ID,DEFAULT_STACK_TEMPLATE,FALLBACK_TEMPLATES,WEBBUILDER_CHAT_SKILL,WEBBUILDER_CONNECTOR_ID,WEBBUILDER_TRIGGER_WORKFLOW_ACTION,buildTriggerParams,buildWorkflowPayloadFromTemplate,newObjectId,normalizeStackTemplate,templateRemixNote,templatesFromSettings,tenantIdFromToken,workflowDefaultsFromSettings};//# sourceMappingURL=workflow.js.map
540
+ const WEBBUILDER_CHAT_SKILL = "webbuilder/design-pro";export{APP_SETTINGS_AIEDITOR_KEY,CODE_ASSISTANT_TEMPLATE_CONFIG_KEY,DEFAULT_MODEL_ID,DEFAULT_STACK_TEMPLATE,FALLBACK_TEMPLATES,WEBBUILDER_CHAT_SKILL,WEBBUILDER_CONNECTOR_ID,WEBBUILDER_TRIGGER_WORKFLOW_ACTION,buildTriggerParams,buildWorkflowPayloadFromTemplate,newObjectId,normalizeStackTemplate,templateRemixNote,templatesFromSettings,tenantIdFromToken,workflowDefaultsFromSettings};//# sourceMappingURL=workflow.js.map