@walkeros/server-source-gcp 1.0.4 → 1.0.6-next-1771252576264

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/dev.d.mts ADDED
@@ -0,0 +1,117 @@
1
+ import * as _walkeros_core_dev from '@walkeros/core/dev';
2
+ import { z } from '@walkeros/core/dev';
3
+ import { Source } from '@walkeros/core';
4
+
5
+ /**
6
+ * HTTP methods enum
7
+ */
8
+ declare const HttpMethod: z.ZodEnum<{
9
+ GET: "GET";
10
+ POST: "POST";
11
+ PUT: "PUT";
12
+ PATCH: "PATCH";
13
+ DELETE: "DELETE";
14
+ OPTIONS: "OPTIONS";
15
+ HEAD: "HEAD";
16
+ }>;
17
+ /**
18
+ * CORS origin configuration
19
+ * Accepts:
20
+ * - '*' for all origins
21
+ * - Single URL string
22
+ * - Array of URL strings
23
+ */
24
+ declare const CorsOrigin: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>, z.ZodLiteral<"*">]>;
25
+ /**
26
+ * CORS options schema
27
+ * Configuration for Cross-Origin Resource Sharing
28
+ */
29
+ declare const CorsOptionsSchema: z.ZodObject<{
30
+ origin: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>, z.ZodLiteral<"*">]>>;
31
+ methods: z.ZodOptional<z.ZodArray<z.ZodEnum<{
32
+ GET: "GET";
33
+ POST: "POST";
34
+ PUT: "PUT";
35
+ PATCH: "PATCH";
36
+ DELETE: "DELETE";
37
+ OPTIONS: "OPTIONS";
38
+ HEAD: "HEAD";
39
+ }>>>;
40
+ headers: z.ZodOptional<z.ZodArray<z.ZodString>>;
41
+ credentials: z.ZodOptional<z.ZodBoolean>;
42
+ maxAge: z.ZodOptional<z.ZodNumber>;
43
+ }, z.core.$strip>;
44
+ type CorsOptions = z.infer<typeof CorsOptionsSchema>;
45
+
46
+ /**
47
+ * GCP CloudFunction source settings schema
48
+ */
49
+ declare const SettingsSchema: z.ZodObject<{
50
+ cors: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodObject<{
51
+ origin: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>, z.ZodLiteral<"*">]>>;
52
+ methods: z.ZodOptional<z.ZodArray<z.ZodEnum<{
53
+ GET: "GET";
54
+ POST: "POST";
55
+ PUT: "PUT";
56
+ PATCH: "PATCH";
57
+ DELETE: "DELETE";
58
+ OPTIONS: "OPTIONS";
59
+ HEAD: "HEAD";
60
+ }>>>;
61
+ headers: z.ZodOptional<z.ZodArray<z.ZodString>>;
62
+ credentials: z.ZodOptional<z.ZodBoolean>;
63
+ maxAge: z.ZodOptional<z.ZodNumber>;
64
+ }, z.core.$strip>]>>;
65
+ timeout: z.ZodOptional<z.ZodNumber>;
66
+ }, z.core.$strip>;
67
+ type Settings = z.infer<typeof SettingsSchema>;
68
+
69
+ declare const settings: _walkeros_core_dev.JSONSchema;
70
+
71
+ type index$1_CorsOptions = CorsOptions;
72
+ declare const index$1_CorsOptionsSchema: typeof CorsOptionsSchema;
73
+ declare const index$1_CorsOrigin: typeof CorsOrigin;
74
+ declare const index$1_HttpMethod: typeof HttpMethod;
75
+ type index$1_Settings = Settings;
76
+ declare const index$1_SettingsSchema: typeof SettingsSchema;
77
+ declare const index$1_settings: typeof settings;
78
+ declare namespace index$1 {
79
+ export { type index$1_CorsOptions as CorsOptions, index$1_CorsOptionsSchema as CorsOptionsSchema, index$1_CorsOrigin as CorsOrigin, index$1_HttpMethod as HttpMethod, type index$1_Settings as Settings, index$1_SettingsSchema as SettingsSchema, index$1_settings as settings };
80
+ }
81
+
82
+ interface Request {
83
+ method: string;
84
+ body?: unknown;
85
+ headers: Record<string, string | string[]>;
86
+ get(name: string): string | undefined;
87
+ }
88
+ interface Response {
89
+ status(code: number): Response;
90
+ json(body: unknown): Response;
91
+ send(body?: unknown): Response;
92
+ set(key: string, value: string): Response;
93
+ }
94
+ interface Env extends Source.Env {
95
+ req?: Request;
96
+ res?: Response;
97
+ }
98
+
99
+ /**
100
+ * Standard mock environment for testing cloud function source
101
+ *
102
+ * Use this for testing HTTP event ingestion and request/response handling
103
+ * without requiring a real GCP Cloud Function environment.
104
+ */
105
+ declare const push: Env;
106
+
107
+ declare const env_push: typeof push;
108
+ declare namespace env {
109
+ export { env_push as push };
110
+ }
111
+
112
+ declare const index_env: typeof env;
113
+ declare namespace index {
114
+ export { index_env as env };
115
+ }
116
+
117
+ export { index as examples, index$1 as schemas };
package/dist/dev.d.ts ADDED
@@ -0,0 +1,117 @@
1
+ import * as _walkeros_core_dev from '@walkeros/core/dev';
2
+ import { z } from '@walkeros/core/dev';
3
+ import { Source } from '@walkeros/core';
4
+
5
+ /**
6
+ * HTTP methods enum
7
+ */
8
+ declare const HttpMethod: z.ZodEnum<{
9
+ GET: "GET";
10
+ POST: "POST";
11
+ PUT: "PUT";
12
+ PATCH: "PATCH";
13
+ DELETE: "DELETE";
14
+ OPTIONS: "OPTIONS";
15
+ HEAD: "HEAD";
16
+ }>;
17
+ /**
18
+ * CORS origin configuration
19
+ * Accepts:
20
+ * - '*' for all origins
21
+ * - Single URL string
22
+ * - Array of URL strings
23
+ */
24
+ declare const CorsOrigin: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>, z.ZodLiteral<"*">]>;
25
+ /**
26
+ * CORS options schema
27
+ * Configuration for Cross-Origin Resource Sharing
28
+ */
29
+ declare const CorsOptionsSchema: z.ZodObject<{
30
+ origin: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>, z.ZodLiteral<"*">]>>;
31
+ methods: z.ZodOptional<z.ZodArray<z.ZodEnum<{
32
+ GET: "GET";
33
+ POST: "POST";
34
+ PUT: "PUT";
35
+ PATCH: "PATCH";
36
+ DELETE: "DELETE";
37
+ OPTIONS: "OPTIONS";
38
+ HEAD: "HEAD";
39
+ }>>>;
40
+ headers: z.ZodOptional<z.ZodArray<z.ZodString>>;
41
+ credentials: z.ZodOptional<z.ZodBoolean>;
42
+ maxAge: z.ZodOptional<z.ZodNumber>;
43
+ }, z.core.$strip>;
44
+ type CorsOptions = z.infer<typeof CorsOptionsSchema>;
45
+
46
+ /**
47
+ * GCP CloudFunction source settings schema
48
+ */
49
+ declare const SettingsSchema: z.ZodObject<{
50
+ cors: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodObject<{
51
+ origin: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>, z.ZodLiteral<"*">]>>;
52
+ methods: z.ZodOptional<z.ZodArray<z.ZodEnum<{
53
+ GET: "GET";
54
+ POST: "POST";
55
+ PUT: "PUT";
56
+ PATCH: "PATCH";
57
+ DELETE: "DELETE";
58
+ OPTIONS: "OPTIONS";
59
+ HEAD: "HEAD";
60
+ }>>>;
61
+ headers: z.ZodOptional<z.ZodArray<z.ZodString>>;
62
+ credentials: z.ZodOptional<z.ZodBoolean>;
63
+ maxAge: z.ZodOptional<z.ZodNumber>;
64
+ }, z.core.$strip>]>>;
65
+ timeout: z.ZodOptional<z.ZodNumber>;
66
+ }, z.core.$strip>;
67
+ type Settings = z.infer<typeof SettingsSchema>;
68
+
69
+ declare const settings: _walkeros_core_dev.JSONSchema;
70
+
71
+ type index$1_CorsOptions = CorsOptions;
72
+ declare const index$1_CorsOptionsSchema: typeof CorsOptionsSchema;
73
+ declare const index$1_CorsOrigin: typeof CorsOrigin;
74
+ declare const index$1_HttpMethod: typeof HttpMethod;
75
+ type index$1_Settings = Settings;
76
+ declare const index$1_SettingsSchema: typeof SettingsSchema;
77
+ declare const index$1_settings: typeof settings;
78
+ declare namespace index$1 {
79
+ export { type index$1_CorsOptions as CorsOptions, index$1_CorsOptionsSchema as CorsOptionsSchema, index$1_CorsOrigin as CorsOrigin, index$1_HttpMethod as HttpMethod, type index$1_Settings as Settings, index$1_SettingsSchema as SettingsSchema, index$1_settings as settings };
80
+ }
81
+
82
+ interface Request {
83
+ method: string;
84
+ body?: unknown;
85
+ headers: Record<string, string | string[]>;
86
+ get(name: string): string | undefined;
87
+ }
88
+ interface Response {
89
+ status(code: number): Response;
90
+ json(body: unknown): Response;
91
+ send(body?: unknown): Response;
92
+ set(key: string, value: string): Response;
93
+ }
94
+ interface Env extends Source.Env {
95
+ req?: Request;
96
+ res?: Response;
97
+ }
98
+
99
+ /**
100
+ * Standard mock environment for testing cloud function source
101
+ *
102
+ * Use this for testing HTTP event ingestion and request/response handling
103
+ * without requiring a real GCP Cloud Function environment.
104
+ */
105
+ declare const push: Env;
106
+
107
+ declare const env_push: typeof push;
108
+ declare namespace env {
109
+ export { env_push as push };
110
+ }
111
+
112
+ declare const index_env: typeof env;
113
+ declare namespace index {
114
+ export { index_env as env };
115
+ }
116
+
117
+ export { index as examples, index$1 as schemas };
package/dist/dev.js ADDED
@@ -0,0 +1 @@
1
+ "use strict";var e,r=Object.defineProperty,o=Object.getOwnPropertyDescriptor,t=Object.getOwnPropertyNames,i=Object.prototype.hasOwnProperty,n=(e,o)=>{for(var t in o)r(e,t,{get:o[t],enumerable:!0})},a={};n(a,{examples:()=>h,schemas:()=>s}),module.exports=(e=a,((e,n,a,s)=>{if(n&&"object"==typeof n||"function"==typeof n)for(let l of t(n))i.call(e,l)||l===a||r(e,l,{get:()=>n[l],enumerable:!(s=o(n,l))||s.enumerable});return e})(r({},"__esModule",{value:!0}),e));var s={};n(s,{CorsOptionsSchema:()=>b,CorsOrigin:()=>p,HttpMethod:()=>d,SettingsSchema:()=>g,settings:()=>m});var l=require("@walkeros/core/dev"),c=require("@walkeros/core/dev"),u=require("@walkeros/core/dev"),d=u.z.enum(["GET","POST","PUT","PATCH","DELETE","OPTIONS","HEAD"]),p=u.z.union([u.z.string(),u.z.array(u.z.string()),u.z.literal("*")]),b=u.z.object({origin:p.describe("Allowed origins (* for all, URL string, or array of URLs)").optional(),methods:u.z.array(d).describe("Allowed HTTP methods").optional(),headers:u.z.array(u.z.string()).describe("Allowed request headers").optional(),credentials:u.z.boolean().describe("Allow credentials (cookies, authorization headers)").optional(),maxAge:u.z.number().int().positive().describe("Preflight cache duration in seconds").optional()}),g=c.z.object({cors:c.z.union([c.z.boolean(),b]).describe("CORS configuration: false = disabled, true = allow all origins, object = custom configuration").optional(),timeout:c.z.number().int().positive().max(54e4).describe("Request timeout in milliseconds (max: 540000 for GCP)").optional()}),m=(0,l.zodToSchema)(g),h={};n(h,{env:()=>z});var z={};n(z,{push:()=>O});var f=()=>()=>Promise.resolve({ok:!0}),v=()=>{},w={error:v,info:v,debug:v,throw:e=>{throw"string"==typeof e?new Error(e):e},scope:()=>w},O={get push(){return f()},get command(){return f()},get elb(){return f()},logger:w};//# sourceMappingURL=dev.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/dev.ts","../src/cloudfunction/schemas/index.ts","../src/cloudfunction/schemas/settings.ts","../src/cloudfunction/schemas/primitives.ts","../src/cloudfunction/examples/index.ts","../src/cloudfunction/examples/env.ts"],"sourcesContent":["export { schemas, examples } from './cloudfunction';\n","import { zodToSchema } from '@walkeros/core/dev';\nimport { SettingsSchema } from './settings';\n\n// Export primitives\nexport * from './primitives';\n\n// Export Zod schemas and types\nexport { SettingsSchema, type Settings } from './settings';\n\n// JSON Schema exports (for website PropertyTable and documentation tools)\nexport const settings = zodToSchema(SettingsSchema);\n","import { z } from '@walkeros/core/dev';\nimport { CorsOptionsSchema } from './primitives';\n\n/**\n * GCP CloudFunction source settings schema\n */\nexport const SettingsSchema = z.object({\n cors: z\n .union([z.boolean(), CorsOptionsSchema])\n .describe(\n 'CORS configuration: false = disabled, true = allow all origins, object = custom configuration',\n )\n .optional(),\n\n timeout: z\n .number()\n .int()\n .positive()\n .max(540000) // GCP Cloud Functions max timeout: 9 minutes\n .describe('Request timeout in milliseconds (max: 540000 for GCP)')\n .optional(),\n});\n\nexport type Settings = z.infer<typeof SettingsSchema>;\n","import { z } from '@walkeros/core/dev';\n\n/**\n * HTTP methods enum\n */\nexport const HttpMethod = z.enum([\n 'GET',\n 'POST',\n 'PUT',\n 'PATCH',\n 'DELETE',\n 'OPTIONS',\n 'HEAD',\n]);\n\n/**\n * CORS origin configuration\n * Accepts:\n * - '*' for all origins\n * - Single URL string\n * - Array of URL strings\n */\nexport const CorsOrigin = z.union([\n z.string(),\n z.array(z.string()),\n z.literal('*'),\n]);\n\n/**\n * CORS options schema\n * Configuration for Cross-Origin Resource Sharing\n */\nexport const CorsOptionsSchema = z.object({\n origin: CorsOrigin.describe(\n 'Allowed origins (* for all, URL string, or array of URLs)',\n ).optional(),\n\n methods: z.array(HttpMethod).describe('Allowed HTTP methods').optional(),\n\n headers: z.array(z.string()).describe('Allowed request headers').optional(),\n\n credentials: z\n .boolean()\n .describe('Allow credentials (cookies, authorization headers)')\n .optional(),\n\n maxAge: z\n .number()\n .int()\n .positive()\n .describe('Preflight cache duration in seconds')\n .optional(),\n});\n\nexport type CorsOptions = z.infer<typeof CorsOptionsSchema>;\n","export * as env from './env';\n","import type { Env } from '../types';\nimport type { Elb, Logger } from '@walkeros/core';\n\n/**\n * Example environment configurations for GCP Cloud Function source\n *\n * These environments provide standardized mock structures for testing\n * HTTP request handling without requiring actual cloud function deployment.\n */\n\n// Create a properly typed elb/push/command function that returns a promise with PushResult\nconst createMockElbFn = (): Elb.Fn => {\n const fn = (() =>\n Promise.resolve({\n ok: true,\n })) as Elb.Fn;\n return fn;\n};\n\n// Simple no-op logger for demo purposes\nconst noopFn = () => {};\nconst noopLogger: Logger.Instance = {\n error: noopFn,\n info: noopFn,\n debug: noopFn,\n throw: (message: string | Error) => {\n throw typeof message === 'string' ? new Error(message) : message;\n },\n scope: () => noopLogger,\n};\n\n/**\n * Standard mock environment for testing cloud function source\n *\n * Use this for testing HTTP event ingestion and request/response handling\n * without requiring a real GCP Cloud Function environment.\n */\nexport const push: Env = {\n get push() {\n return createMockElbFn();\n },\n get command() {\n return createMockElbFn();\n },\n get elb() {\n return createMockElbFn();\n },\n logger: noopLogger,\n};\n"],"mappings":";;;;;;;;;;;;;;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,IAAI;AAAA,EACN,CAAC;AACH,SAAO;AACT;AAGA,IAAM,SAAS,MAAM;AAAC;AACtB,IAAM,aAA8B;AAAA,EAClC,OAAO;AAAA,EACP,MAAM;AAAA,EACN,OAAO;AAAA,EACP,OAAO,CAAC,YAA4B;AAClC,UAAM,OAAO,YAAY,WAAW,IAAI,MAAM,OAAO,IAAI;AAAA,EAC3D;AAAA,EACA,OAAO,MAAM;AACf;AAQO,IAAM,OAAY;AAAA,EACvB,IAAI,OAAO;AACT,WAAO,gBAAgB;AAAA,EACzB;AAAA,EACA,IAAI,UAAU;AACZ,WAAO,gBAAgB;AAAA,EACzB;AAAA,EACA,IAAI,MAAM;AACR,WAAO,gBAAgB;AAAA,EACzB;AAAA,EACA,QAAQ;AACV;","names":["import_dev","import_dev"]}
package/dist/dev.mjs ADDED
@@ -0,0 +1 @@
1
+ var e=Object.defineProperty,o=(o,r)=>{for(var i in r)e(o,i,{get:r[i],enumerable:!0})},r={};o(r,{CorsOptionsSchema:()=>l,CorsOrigin:()=>n,HttpMethod:()=>a,SettingsSchema:()=>c,settings:()=>d});import{zodToSchema as i}from"@walkeros/core/dev";import{z as t}from"@walkeros/core/dev";import{z as s}from"@walkeros/core/dev";var a=s.enum(["GET","POST","PUT","PATCH","DELETE","OPTIONS","HEAD"]),n=s.union([s.string(),s.array(s.string()),s.literal("*")]),l=s.object({origin:n.describe("Allowed origins (* for all, URL string, or array of URLs)").optional(),methods:s.array(a).describe("Allowed HTTP methods").optional(),headers:s.array(s.string()).describe("Allowed request headers").optional(),credentials:s.boolean().describe("Allow credentials (cookies, authorization headers)").optional(),maxAge:s.number().int().positive().describe("Preflight cache duration in seconds").optional()}),c=t.object({cors:t.union([t.boolean(),l]).describe("CORS configuration: false = disabled, true = allow all origins, object = custom configuration").optional(),timeout:t.number().int().positive().max(54e4).describe("Request timeout in milliseconds (max: 540000 for GCP)").optional()}),d=i(c),m={};o(m,{env:()=>g});var g={};o(g,{push:()=>h});var u=()=>()=>Promise.resolve({ok:!0}),p=()=>{},b={error:p,info:p,debug:p,throw:e=>{throw"string"==typeof e?new Error(e):e},scope:()=>b},h={get push(){return u()},get command(){return u()},get elb(){return u()},logger:b};export{m as examples,r as schemas};//# sourceMappingURL=dev.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/cloudfunction/schemas/index.ts","../src/cloudfunction/schemas/settings.ts","../src/cloudfunction/schemas/primitives.ts","../src/cloudfunction/examples/index.ts","../src/cloudfunction/examples/env.ts"],"sourcesContent":["import { zodToSchema } from '@walkeros/core/dev';\nimport { SettingsSchema } from './settings';\n\n// Export primitives\nexport * from './primitives';\n\n// Export Zod schemas and types\nexport { SettingsSchema, type Settings } from './settings';\n\n// JSON Schema exports (for website PropertyTable and documentation tools)\nexport const settings = zodToSchema(SettingsSchema);\n","import { z } from '@walkeros/core/dev';\nimport { CorsOptionsSchema } from './primitives';\n\n/**\n * GCP CloudFunction source settings schema\n */\nexport const SettingsSchema = z.object({\n cors: z\n .union([z.boolean(), CorsOptionsSchema])\n .describe(\n 'CORS configuration: false = disabled, true = allow all origins, object = custom configuration',\n )\n .optional(),\n\n timeout: z\n .number()\n .int()\n .positive()\n .max(540000) // GCP Cloud Functions max timeout: 9 minutes\n .describe('Request timeout in milliseconds (max: 540000 for GCP)')\n .optional(),\n});\n\nexport type Settings = z.infer<typeof SettingsSchema>;\n","import { z } from '@walkeros/core/dev';\n\n/**\n * HTTP methods enum\n */\nexport const HttpMethod = z.enum([\n 'GET',\n 'POST',\n 'PUT',\n 'PATCH',\n 'DELETE',\n 'OPTIONS',\n 'HEAD',\n]);\n\n/**\n * CORS origin configuration\n * Accepts:\n * - '*' for all origins\n * - Single URL string\n * - Array of URL strings\n */\nexport const CorsOrigin = z.union([\n z.string(),\n z.array(z.string()),\n z.literal('*'),\n]);\n\n/**\n * CORS options schema\n * Configuration for Cross-Origin Resource Sharing\n */\nexport const CorsOptionsSchema = z.object({\n origin: CorsOrigin.describe(\n 'Allowed origins (* for all, URL string, or array of URLs)',\n ).optional(),\n\n methods: z.array(HttpMethod).describe('Allowed HTTP methods').optional(),\n\n headers: z.array(z.string()).describe('Allowed request headers').optional(),\n\n credentials: z\n .boolean()\n .describe('Allow credentials (cookies, authorization headers)')\n .optional(),\n\n maxAge: z\n .number()\n .int()\n .positive()\n .describe('Preflight cache duration in seconds')\n .optional(),\n});\n\nexport type CorsOptions = z.infer<typeof CorsOptionsSchema>;\n","export * as env from './env';\n","import type { Env } from '../types';\nimport type { Elb, Logger } from '@walkeros/core';\n\n/**\n * Example environment configurations for GCP Cloud Function source\n *\n * These environments provide standardized mock structures for testing\n * HTTP request handling without requiring actual cloud function deployment.\n */\n\n// Create a properly typed elb/push/command function that returns a promise with PushResult\nconst createMockElbFn = (): Elb.Fn => {\n const fn = (() =>\n Promise.resolve({\n ok: true,\n })) as Elb.Fn;\n return fn;\n};\n\n// Simple no-op logger for demo purposes\nconst noopFn = () => {};\nconst noopLogger: Logger.Instance = {\n error: noopFn,\n info: noopFn,\n debug: noopFn,\n throw: (message: string | Error) => {\n throw typeof message === 'string' ? new Error(message) : message;\n },\n scope: () => noopLogger,\n};\n\n/**\n * Standard mock environment for testing cloud function source\n *\n * Use this for testing HTTP event ingestion and request/response handling\n * without requiring a real GCP Cloud Function environment.\n */\nexport const push: Env = {\n get push() {\n return createMockElbFn();\n },\n get command() {\n return createMockElbFn();\n },\n get elb() {\n return createMockElbFn();\n },\n logger: noopLogger,\n};\n"],"mappings":";;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,SAAS,mBAAmB;;;ACA5B,SAAS,KAAAA,UAAS;;;ACAlB,SAAS,SAAS;AAKX,IAAM,aAAa,EAAE,KAAK;AAAA,EAC/B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AASM,IAAM,aAAa,EAAE,MAAM;AAAA,EAChC,EAAE,OAAO;AAAA,EACT,EAAE,MAAM,E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AAI,UAAU;AACZ,WAAO,gBAAgB;AAAA,EACzB;AAAA,EACA,IAAI,MAAM;AACR,WAAO,gBAAgB;AAAA,EACzB;AAAA,EACA,QAAQ;AACV;","names":["z","z"]}
@@ -0,0 +1,120 @@
1
+ {
2
+ "$meta": {
3
+ "package": "@walkeros/server-source-gcp",
4
+ "version": "1.0.5",
5
+ "type": "source",
6
+ "platform": "server"
7
+ },
8
+ "schemas": {
9
+ "settings": {
10
+ "$schema": "http://json-schema.org/draft-07/schema#",
11
+ "type": "object",
12
+ "properties": {
13
+ "cors": {
14
+ "anyOf": [
15
+ {
16
+ "type": "boolean"
17
+ },
18
+ {
19
+ "type": "object",
20
+ "properties": {
21
+ "origin": {
22
+ "anyOf": [
23
+ {
24
+ "type": "string"
25
+ },
26
+ {
27
+ "type": "array",
28
+ "items": {
29
+ "type": "string"
30
+ }
31
+ },
32
+ {
33
+ "type": "string",
34
+ "const": "*"
35
+ }
36
+ ],
37
+ "description": "Allowed origins (* for all, URL string, or array of URLs)"
38
+ },
39
+ "methods": {
40
+ "type": "array",
41
+ "items": {
42
+ "type": "string",
43
+ "enum": [
44
+ "GET",
45
+ "POST",
46
+ "PUT",
47
+ "PATCH",
48
+ "DELETE",
49
+ "OPTIONS",
50
+ "HEAD"
51
+ ]
52
+ },
53
+ "description": "Allowed HTTP methods"
54
+ },
55
+ "headers": {
56
+ "type": "array",
57
+ "items": {
58
+ "type": "string"
59
+ },
60
+ "description": "Allowed request headers"
61
+ },
62
+ "credentials": {
63
+ "type": "boolean",
64
+ "description": "Allow credentials (cookies, authorization headers)"
65
+ },
66
+ "maxAge": {
67
+ "type": "integer",
68
+ "exclusiveMinimum": 0,
69
+ "maximum": 9007199254740991,
70
+ "description": "Preflight cache duration in seconds"
71
+ }
72
+ },
73
+ "additionalProperties": false
74
+ }
75
+ ],
76
+ "description": "CORS configuration: false = disabled, true = allow all origins, object = custom configuration"
77
+ },
78
+ "timeout": {
79
+ "type": "integer",
80
+ "exclusiveMinimum": 0,
81
+ "maximum": 540000,
82
+ "description": "Request timeout in milliseconds (max: 540000 for GCP)"
83
+ }
84
+ },
85
+ "additionalProperties": false
86
+ }
87
+ },
88
+ "examples": {
89
+ "env": {
90
+ "push": {
91
+ "push": {
92
+ "$code": "()=>Promise.resolve({ok:!0})"
93
+ },
94
+ "command": {
95
+ "$code": "()=>Promise.resolve({ok:!0})"
96
+ },
97
+ "elb": {
98
+ "$code": "()=>Promise.resolve({ok:!0})"
99
+ },
100
+ "logger": {
101
+ "error": {
102
+ "$code": "()=>{}"
103
+ },
104
+ "info": {
105
+ "$code": "()=>{}"
106
+ },
107
+ "debug": {
108
+ "$code": "()=>{}"
109
+ },
110
+ "throw": {
111
+ "$code": "e=>{throw\"string\"==typeof e?new Error(e):e}"
112
+ },
113
+ "scope": {
114
+ "$code": "()=>b"
115
+ }
116
+ }
117
+ }
118
+ }
119
+ }
120
+ }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@walkeros/server-source-gcp",
3
3
  "description": "Google Cloud Platform server sources for walkerOS (Cloud Functions)",
4
- "version": "1.0.4",
4
+ "version": "1.0.6-next-1771252576264",
5
5
  "license": "MIT",
6
6
  "main": "./dist/index.js",
7
7
  "module": "./dist/index.mjs",
@@ -13,12 +13,13 @@
13
13
  "build": "tsup --silent",
14
14
  "clean": "rm -rf .turbo && rm -rf node_modules && rm -rf dist",
15
15
  "dev": "jest --watchAll --colors",
16
- "lint": "tsc && eslint \"**/*.ts*\"",
16
+ "typecheck": "tsc --noEmit",
17
+ "lint": "eslint \"**/*.ts*\"",
17
18
  "test": "jest",
18
19
  "update": "npx npm-check-updates -u && npm update"
19
20
  },
20
21
  "dependencies": {
21
- "@walkeros/core": "1.2.2"
22
+ "@walkeros/core": "1.4.0-next-1771252576264"
22
23
  },
23
24
  "peerDependencies": {
24
25
  "@google-cloud/functions-framework": "^3.0.0"
@@ -33,13 +34,18 @@
33
34
  "bugs": {
34
35
  "url": "https://github.com/elbwalker/walkerOS/issues"
35
36
  },
37
+ "walkerOS": {
38
+ "type": "source",
39
+ "platform": "server"
40
+ },
36
41
  "keywords": [
37
- "walker",
38
42
  "walkerOS",
43
+ "walkerOS-source",
39
44
  "source",
40
45
  "server",
41
46
  "gcp",
42
- "cloud functions"
47
+ "cloud functions",
48
+ "analytics"
43
49
  ],
44
50
  "funding": [
45
51
  {