@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.
@@ -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-CPcmGK_X.mjs";
4
- import { output } from "../../index-DHpKRtq3.mjs";
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
@@ -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
 
@@ -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
+ ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tailor-platform/sdk",
3
- "version": "0.8.6",
3
+ "version": "0.10.0",
4
4
  "description": "Tailor Platform SDK - The SDK to work with Tailor Platform",
5
5
  "license": "MIT",
6
6
  "main": "./dist/configure/index.mjs",