@tailor-platform/sdk 0.8.6 → 0.10.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 +64 -0
- package/dist/cli/api.d.mts +12 -11
- package/dist/cli/api.mjs +1 -1
- package/dist/cli/index.mjs +4 -5
- package/dist/configure/index.d.mts +2 -2
- package/dist/{index-DHpKRtq3.d.mts → index-DxmBZtRb.d.mts} +15 -2
- package/dist/{token-Cbs_El75.mjs → token-BD9c1mlS.mjs} +709 -274
- package/dist/{types-CPcmGK_X.d.mts → types-DcpYyMM2.d.mts} +4 -3
- package/dist/utils/test/index.d.mts +2 -2
- package/docs/cli-reference.md +1 -0
- package/docs/configuration.md +31 -0
- package/package.json +1 -1
|
@@ -1252,8 +1252,9 @@ type GeneratorConfig = z.input<typeof BaseGeneratorConfigSchema>;
|
|
|
1252
1252
|
type CodeGeneratorBase = z.output<typeof CodeGeneratorSchema>;
|
|
1253
1253
|
//#endregion
|
|
1254
1254
|
//#region src/configure/config.d.ts
|
|
1255
|
-
interface AppConfig<Auth extends AuthConfig = AuthConfig, Idp extends IdPConfig[] = IdPConfig[], StaticWebsites extends StaticWebsiteConfig[] = StaticWebsiteConfig[]> {
|
|
1255
|
+
interface AppConfig<Auth extends AuthConfig = AuthConfig, Idp extends IdPConfig[] = IdPConfig[], StaticWebsites extends StaticWebsiteConfig[] = StaticWebsiteConfig[], Env extends Record<string, string | number | boolean> = Record<string, string | number | boolean>> {
|
|
1256
1256
|
name: string;
|
|
1257
|
+
env?: Env;
|
|
1257
1258
|
cors?: string[];
|
|
1258
1259
|
allowedIPAddresses?: string[];
|
|
1259
1260
|
disableIntrospection?: boolean;
|
|
@@ -1321,7 +1322,7 @@ declare const FunctionOperationSchema: z.ZodObject<{
|
|
|
1321
1322
|
}, z.core.$strip>;
|
|
1322
1323
|
declare const GqlOperationSchema: z.ZodObject<{
|
|
1323
1324
|
kind: z.ZodLiteral<"graphql">;
|
|
1324
|
-
appName: z.ZodString
|
|
1325
|
+
appName: z.ZodOptional<z.ZodString>;
|
|
1325
1326
|
query: z.ZodString;
|
|
1326
1327
|
variables: z.ZodOptional<z.ZodCustom<Function, Function>>;
|
|
1327
1328
|
invoker: z.ZodOptional<z.ZodObject<{
|
|
@@ -1373,7 +1374,7 @@ declare const ExecutorSchema: z.ZodObject<{
|
|
|
1373
1374
|
}, z.core.$strip>>;
|
|
1374
1375
|
}, z.core.$strip>, z.ZodObject<{
|
|
1375
1376
|
kind: z.ZodLiteral<"graphql">;
|
|
1376
|
-
appName: z.ZodString
|
|
1377
|
+
appName: z.ZodOptional<z.ZodString>;
|
|
1377
1378
|
query: z.ZodString;
|
|
1378
1379
|
variables: z.ZodOptional<z.ZodCustom<Function, Function>>;
|
|
1379
1380
|
invoker: z.ZodOptional<z.ZodObject<{
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference path="./../../plugin-generated.d.ts" />
|
|
2
2
|
|
|
3
|
-
import { TailorDBType, TailorField, TailorUser } from "../../types-
|
|
4
|
-
import { output } from "../../index-
|
|
3
|
+
import { TailorDBType, TailorField, TailorUser } from "../../types-DcpYyMM2.mjs";
|
|
4
|
+
import { output } from "../../index-DxmBZtRb.mjs";
|
|
5
5
|
import { StandardSchemaV1 } from "@standard-schema/spec";
|
|
6
6
|
|
|
7
7
|
//#region src/utils/test/index.d.ts
|
package/docs/cli-reference.md
CHANGED
|
@@ -69,6 +69,7 @@ tailor-sdk apply [options]
|
|
|
69
69
|
- `-p, --profile` - Workspace profile to use
|
|
70
70
|
- `-c, --config` - Path to the SDK config file (default: `tailor.config.ts`)
|
|
71
71
|
- `-d, --dryRun` - Run the command without making any changes
|
|
72
|
+
- `-y, --yes` - Skip confirmation prompt
|
|
72
73
|
|
|
73
74
|
### show
|
|
74
75
|
|
package/docs/configuration.md
CHANGED
|
@@ -130,3 +130,34 @@ export default defineConfig({
|
|
|
130
130
|
**description**: Description of the site.
|
|
131
131
|
|
|
132
132
|
**allowedIPAddresses**: List of IP addresses allowed to access the site in CIDR format.
|
|
133
|
+
|
|
134
|
+
### Environment Variables
|
|
135
|
+
|
|
136
|
+
Define environment variables that can be accessed in resolvers and executors:
|
|
137
|
+
|
|
138
|
+
```typescript
|
|
139
|
+
export default defineConfig({
|
|
140
|
+
name: "my-app",
|
|
141
|
+
env: {
|
|
142
|
+
foo: 1,
|
|
143
|
+
bar: "hello",
|
|
144
|
+
baz: true,
|
|
145
|
+
},
|
|
146
|
+
});
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
```typescript
|
|
150
|
+
// In resolvers
|
|
151
|
+
body: ({ input, env }) => {
|
|
152
|
+
return {
|
|
153
|
+
result: input.multiplier * env.foo,
|
|
154
|
+
message: env.bar,
|
|
155
|
+
enabled: env.baz,
|
|
156
|
+
};
|
|
157
|
+
};
|
|
158
|
+
|
|
159
|
+
// In executors
|
|
160
|
+
body: ({ newRecord, env }) => {
|
|
161
|
+
console.log(`Environment: ${env.bar}, User: ${newRecord.name}`);
|
|
162
|
+
};
|
|
163
|
+
```
|