zitejs 0.10.0-start.20 → 0.10.0-start.21
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/dist/cjs/auth/actions.d.ts +28 -0
- package/dist/cjs/auth/actions.js +93 -0
- package/dist/cjs/auth/client.d.ts +357 -0
- package/dist/cjs/auth/client.js +66 -0
- package/dist/cjs/auth/index.d.ts +2 -249
- package/dist/cjs/auth/index.js +11 -114
- package/dist/cjs/auth/index.test.js +18 -0
- package/dist/cjs/auth/profileUpdates.d.ts +9 -0
- package/dist/cjs/auth/profileUpdates.js +11 -0
- package/dist/cjs/check/start/sourceRules.js +70 -21
- package/dist/cjs/integrations/rules.js +5 -3
- package/dist/cjs/runtime/index.d.ts +54 -15
- package/dist/cjs/runtime/sendEmailParamsTypes.test-d.d.ts +1 -0
- package/dist/cjs/runtime/sendEmailParamsTypes.test-d.js +33 -0
- package/dist/cjs/sync/lib.js +10 -5
- package/dist/cjs/sync/lib.test.js +10 -0
- package/dist/esm/auth/actions.d.ts +28 -0
- package/dist/esm/auth/actions.js +55 -0
- package/dist/esm/auth/client.d.ts +357 -0
- package/dist/esm/auth/client.js +62 -0
- package/dist/esm/auth/index.d.ts +2 -249
- package/dist/esm/auth/index.js +2 -109
- package/dist/esm/auth/index.test.js +18 -0
- package/dist/esm/auth/profileUpdates.d.ts +9 -0
- package/dist/esm/auth/profileUpdates.js +6 -0
- package/dist/esm/check/start/sourceRules.js +70 -21
- package/dist/esm/integrations/rules.js +5 -3
- package/dist/esm/runtime/index.d.ts +54 -15
- package/dist/esm/runtime/sendEmailParamsTypes.test-d.d.ts +1 -0
- package/dist/esm/runtime/sendEmailParamsTypes.test-d.js +31 -0
- package/dist/esm/start/airtable/dispatch.js +3 -3
- package/dist/esm/start/airtable/formulas.d.ts +1 -1
- package/dist/esm/start/airtable/formulas.js +12 -10
- package/dist/esm/start/airtable/index.d.ts +2 -2
- package/dist/esm/start/describe.d.ts +8 -1
- package/dist/esm/start/describe.js +5 -3
- package/dist/esm/start/factories.test-d.d.ts +2 -1
- package/dist/esm/start/host.d.ts +2 -2
- package/dist/esm/start/index.d.ts +1 -1
- package/dist/esm/start/index.js +4 -2
- package/dist/esm/start/outbound.d.ts +2 -2
- package/dist/esm/start/outbound.js +3 -1
- package/dist/esm/start/router.d.ts +7 -0
- package/dist/esm/start/router.js +35 -0
- package/dist/esm/start/runLog.d.ts +2 -2
- package/dist/esm/start/scope.d.ts +3 -3
- package/dist/esm/start/server.d.ts +3 -3
- package/dist/esm/start/server.js +2 -1
- package/dist/esm/start/types.d.ts +1 -1
- package/dist/esm/start/version.d.ts +1 -1
- package/dist/esm/start/version.js +1 -1
- package/dist/esm/start/vite.js +3 -3
- package/dist/esm/start/workflow.d.ts +6 -2
- package/dist/esm/start/workflow.js +9 -2
- package/dist/esm/start/workflow.test-d.js +10 -1
- package/dist/esm/start/workflowRun.d.ts +5 -0
- package/dist/esm/start/workflowRun.js +11 -1
- package/dist/esm/sync/lib.js +10 -5
- package/dist/esm/sync/lib.test.js +10 -0
- package/package.json +1 -1
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
import { errorOf } from "./runLog.js";
|
|
5
5
|
import { runInScope } from "./scope.js";
|
|
6
6
|
import { createSteps } from "./steps.js";
|
|
7
|
-
import { isAutomation } from "./workflow.js";
|
|
7
|
+
import { isAutomation, isUnfinishedAutomation } from "./workflow.js";
|
|
8
8
|
import { workflowModules } from "./workflowModules.js";
|
|
9
9
|
const platformCall = (...args) => {
|
|
10
10
|
const call = globalThis.__wrapSdkCall;
|
|
@@ -113,6 +113,16 @@ export async function loadWorkflows(modules = workflowModules) {
|
|
|
113
113
|
}
|
|
114
114
|
return found;
|
|
115
115
|
}
|
|
116
|
+
/** Each `createAutomation(...)` exported without its `.handler()`, by export name: describe refuses them. */
|
|
117
|
+
export async function loadUnfinishedWorkflows(modules = workflowModules) {
|
|
118
|
+
const found = [];
|
|
119
|
+
for (const [file, load] of Object.entries(modules)) {
|
|
120
|
+
for (const [id, value] of Object.entries(await load()))
|
|
121
|
+
if (isUnfinishedAutomation(value))
|
|
122
|
+
found.push({ id, file });
|
|
123
|
+
}
|
|
124
|
+
return found;
|
|
125
|
+
}
|
|
116
126
|
/** The input as the run log keeps it: a trigger's `seen` list can hold thousands of ids. */
|
|
117
127
|
export const loggedInput = (rawInput) => {
|
|
118
128
|
const raw = asRecord(rawInput);
|
package/dist/esm/sync/lib.js
CHANGED
|
@@ -517,8 +517,9 @@ export function generateDbTs(inputSchema, { hasStartApps = false } = {}) {
|
|
|
517
517
|
lines.push('// `not: null` means "is set". An empty `in: []` matches nothing; an', "// empty `notIn: []` applies no filter.");
|
|
518
518
|
lines.push('// sort: [{ field: "fieldName", direction: "asc" | "desc" }]');
|
|
519
519
|
lines.push("// limit defaults to 500, max 2000; offset is a row count (a number)");
|
|
520
|
-
lines.push("// a filter value of `undefined`
|
|
520
|
+
lines.push("// a filter value of `undefined` drops that filter and reads as if it weren't", "// there. Check the value first: `{ owner: user?.id }` signed out reads every row.");
|
|
521
521
|
lines.push("// .findOne({ id?, filters?, fields? }) → T | undefined");
|
|
522
|
+
lines.push("// a filter value of `undefined`, or an `undefined` id with no filters, matches", "// no record and returns undefined");
|
|
522
523
|
lines.push("// .create({ record }) → T");
|
|
523
524
|
lines.push("// .update({ id, record }) → { id: string, fields: Partial<T> }");
|
|
524
525
|
lines.push("// .delete({ id }) → { success: true, id: string }");
|
|
@@ -1395,18 +1396,22 @@ export function generateEmailSdk(integrationId, runtime = "classic") {
|
|
|
1395
1396
|
"// Always use 'zitejs/email' — never a relative path like '../../.zite/integrations/email'.",
|
|
1396
1397
|
"// The tsconfig aliases resolve zitejs/* imports to the correct .zite/ files.",
|
|
1397
1398
|
"//",
|
|
1398
|
-
"// await Email.send({ to, subject,
|
|
1399
|
-
"// => { success: boolean; messageId: string }",
|
|
1399
|
+
"// await Email.send({ to, subject, html: '<p>...</p>' })",
|
|
1400
|
+
"// => { success: boolean; messageId: string; warnings?: string[] }",
|
|
1400
1401
|
"//",
|
|
1401
|
-
"//
|
|
1402
|
-
"//
|
|
1402
|
+
"// Emails written before html support pass `body` (blocks) instead; they",
|
|
1403
|
+
"// keep working.",
|
|
1404
|
+
"//",
|
|
1405
|
+
"// RTL languages (Hebrew, Arabic): pass direction: 'rtl'.",
|
|
1403
1406
|
"",
|
|
1404
1407
|
"import { createEmailClient } from 'zitejs/runtime';",
|
|
1405
1408
|
"",
|
|
1406
1409
|
"export type {",
|
|
1407
1410
|
" EmailBlock,",
|
|
1411
|
+
" SendBlocksEmailParams,",
|
|
1408
1412
|
" SendEmailParams,",
|
|
1409
1413
|
" SendEmailResult,",
|
|
1414
|
+
" SendHtmlEmailParams,",
|
|
1410
1415
|
"} from 'zitejs/runtime';",
|
|
1411
1416
|
"",
|
|
1412
1417
|
`export const Email = createEmailClient(${tsSingleQuoted(integrationId)});`,
|
|
@@ -577,6 +577,16 @@ describe('generateIntegrationsIndex', () => {
|
|
|
577
577
|
const jira = await integrations.get('tickets');
|
|
578
578
|
const cloudId: string = jira.cloudId;
|
|
579
579
|
const siteUrl: string = jira.siteUrl;
|
|
580
|
+
`)).toEqual([
|
|
581
|
+
expect.stringContaining("Type 'string | undefined' is not assignable"),
|
|
582
|
+
]);
|
|
583
|
+
});
|
|
584
|
+
it('types the Shopify storefront URL as always present and only its token as optional', () => {
|
|
585
|
+
const generated = generateIntegrationsIndex([{ name: 'shopify', serviceType: 'shopify', perUser: false }], { reexportAirtable: false });
|
|
586
|
+
expect(typeErrorsIn(generated, `import { integrations } from 'zitejs/integrations';
|
|
587
|
+
const shop = await integrations.get('shopify');
|
|
588
|
+
const storefrontApiUrl: string = shop.storefrontApiUrl;
|
|
589
|
+
const storefrontAccessToken: string = shop.storefrontAccessToken;
|
|
580
590
|
`)).toEqual([
|
|
581
591
|
expect.stringContaining("Type 'string | undefined' is not assignable"),
|
|
582
592
|
]);
|