@walkeros/server-source-gcp 4.7.0-next-1790722899482 → 4.7.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.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$meta": {
3
3
  "package": "@walkeros/server-source-gcp",
4
- "version": "4.7.0-next-1790722899482",
4
+ "version": "4.7.0",
5
5
  "type": "source",
6
6
  "platform": [
7
7
  "server"
@@ -109,7 +109,7 @@
109
109
  },
110
110
  "examples": {
111
111
  "createTrigger": {
112
- "$code": "async e=>{let t;return{get flow(){return t},trigger:()=>async o=>{if(!t){const o=await S(e);t={collector:o.collector,elb:o.elb}}const r=function(e){for(const t of Object.values(e.sources||{}))if(\"cloudfunction\"===t.type)return t}(t.collector);if(!r)throw new Error(\"CloudFunction source not found in collector — ensure it is configured in sources\");const s={...o.body};s.name&&!s.event&&(s.event=s.name,delete s.name);const i=o.headers||{\"content-type\":\"application/json\"},n={method:o.method,body:s,headers:i,get:e=>i[e.toLowerCase()]};let a,c=200;const l={status:e=>(c=e,l),json:e=>(a=e,l),send:e=>(a=e,l),set:()=>l};return await r.push(n,l),{status:c,body:a}}}}"
112
+ "$code": "async e=>{let t;return{get flow(){return t},trigger:()=>async o=>{if(!t){const o=await p(e);t={collector:o.collector,elb:o.elb}}const r=function(e){for(const t of Object.values(e.sources||{}))if(\"cloudfunction\"===t.type)return t}(t.collector);if(!r)throw new Error(\"CloudFunction source not found in collector — ensure it is configured in sources\");const s={...o.body};s.name&&!s.event&&(s.event=s.name,delete s.name);const i=o.headers||{\"content-type\":\"application/json\"},n={method:o.method,body:s,headers:i,get:e=>i[e.toLowerCase()]};let a,c=200;const l={status:e=>(c=e,l),json:e=>(a=e,l),send:e=>(a=e,l),set:()=>l};return await r.push(n,l),{status:c,body:a}}}}"
113
113
  },
114
114
  "env": {
115
115
  "push": {
@@ -142,7 +142,7 @@
142
142
  "$code": "()=>{}"
143
143
  },
144
144
  "scope": {
145
- "$code": "()=>f"
145
+ "$code": "()=>n"
146
146
  }
147
147
  }
148
148
  }
@@ -259,7 +259,7 @@
259
259
  "exportExamples": {
260
260
  "sourceCloudFunction": {
261
261
  "createTrigger": {
262
- "$code": "async e=>{let t;return{get flow(){return t},trigger:()=>async o=>{if(!t){const o=await S(e);t={collector:o.collector,elb:o.elb}}const r=function(e){for(const t of Object.values(e.sources||{}))if(\"cloudfunction\"===t.type)return t}(t.collector);if(!r)throw new Error(\"CloudFunction source not found in collector — ensure it is configured in sources\");const s={...o.body};s.name&&!s.event&&(s.event=s.name,delete s.name);const i=o.headers||{\"content-type\":\"application/json\"},n={method:o.method,body:s,headers:i,get:e=>i[e.toLowerCase()]};let a,c=200;const l={status:e=>(c=e,l),json:e=>(a=e,l),send:e=>(a=e,l),set:()=>l};return await r.push(n,l),{status:c,body:a}}}}"
262
+ "$code": "async e=>{let t;return{get flow(){return t},trigger:()=>async o=>{if(!t){const o=await p(e);t={collector:o.collector,elb:o.elb}}const r=function(e){for(const t of Object.values(e.sources||{}))if(\"cloudfunction\"===t.type)return t}(t.collector);if(!r)throw new Error(\"CloudFunction source not found in collector — ensure it is configured in sources\");const s={...o.body};s.name&&!s.event&&(s.event=s.name,delete s.name);const i=o.headers||{\"content-type\":\"application/json\"},n={method:o.method,body:s,headers:i,get:e=>i[e.toLowerCase()]};let a,c=200;const l={status:e=>(c=e,l),json:e=>(a=e,l),send:e=>(a=e,l),set:()=>l};return await r.push(n,l),{status:c,body:a}}}}"
263
263
  },
264
264
  "env": {
265
265
  "push": {
@@ -292,7 +292,7 @@
292
292
  "$code": "()=>{}"
293
293
  },
294
294
  "scope": {
295
- "$code": "()=>f"
295
+ "$code": "()=>n"
296
296
  }
297
297
  }
298
298
  }
@@ -408,7 +408,7 @@
408
408
  },
409
409
  "sourcePubSubPull": {
410
410
  "createTrigger": {
411
- "$code": "async e=>{let t;return{get flow(){return t},trigger:()=>async o=>{if(!t){const o=await _(e);t={collector:o.collector,elb:o.elb}}const r=function(e){for(const t of Object.values(e.sources??{}))if(W(t))return t}(t.collector);if(!r)throw new Error(\"pubsub-pull source not registered in collector — ensure it is configured in sources\");const s={id:o.id,data:Buffer.from(o.dataString,\"utf8\"),attributes:o.attributes,orderingKey:o.orderingKey},i=await r.push(s),n=[];return i&&\"object\"==typeof i&&(i.acked&&n.push([\"message.ack\",o.id]),i.nacked&&n.push([\"message.nack\",o.id])),n}}}"
411
+ "$code": "async e=>{let t;return{get flow(){return t},trigger:()=>async o=>{if(!t){const o=await C(e);t={collector:o.collector,elb:o.elb}}const r=function(e){for(const t of Object.values(e.sources??{}))if(A(t))return t}(t.collector);if(!r)throw new Error(\"pubsub-pull source not registered in collector — ensure it is configured in sources\");const s={id:o.id,data:Buffer.from(o.dataString,\"utf8\"),attributes:o.attributes,orderingKey:o.orderingKey},i=await r.push(s),n=[];return i&&\"object\"==typeof i&&(i.acked&&n.push([\"message.ack\",o.id]),i.nacked&&n.push([\"message.nack\",o.id])),n}}}"
412
412
  },
413
413
  "env": {
414
414
  "moduleMockEnv": {
@@ -441,7 +441,7 @@
441
441
  "$code": "()=>{}"
442
442
  },
443
443
  "scope": {
444
- "$code": "()=>M"
444
+ "$code": "()=>h"
445
445
  }
446
446
  }
447
447
  },
@@ -475,11 +475,11 @@
475
475
  "$code": "()=>{}"
476
476
  },
477
477
  "scope": {
478
- "$code": "()=>M"
478
+ "$code": "()=>h"
479
479
  }
480
480
  },
481
481
  "PubSub": {
482
- "$code": "class{constructor(e){this.options=e}options;subscription(e,t){return new I(e,t)}async close(){}}"
482
+ "$code": "class{constructor(e){this.options=e}options;subscription(e,t){return new v(e,t)}async close(){}}"
483
483
  }
484
484
  },
485
485
  "simulation": [
@@ -569,7 +569,7 @@
569
569
  },
570
570
  "sourcePubSubPush": {
571
571
  "createTrigger": {
572
- "$code": "async e=>{let t;return{get flow(){return t},trigger:(o,r)=>async o=>{if(!t){const o=await be(e);t={collector:o.collector,elb:o.elb}}const s=(\"object\"==typeof r&&null!==r?r:{}).headers??{},i=function(e){for(const t of Object.values(e.sources??{}))if(me(t))return t}(t.collector);if(!i)throw new Error(\"pubsub-push source not registered\");const n={},a=function(e,t){return{method:\"POST\",body:e,headers:t,get:e=>t[e.toLowerCase()]??t[e]}}(o,s),c=function(e){const t={status:o=>(e.statusCode=o,t),json:o=>(e.body=o,t),send:o=>(e.body=o,t),set:()=>t};return t}(n);await i.push(a,c);return[[\"response\",n.statusCode??0,n.body??null]]}}}"
572
+ "$code": "async e=>{let t;return{get flow(){return t},trigger:(o,r)=>async o=>{if(!t){const o=await K(e);t={collector:o.collector,elb:o.elb}}const s=(\"object\"==typeof r&&null!==r?r:{}).headers??{},i=function(e){for(const t of Object.values(e.sources??{}))if(V(t))return t}(t.collector);if(!i)throw new Error(\"pubsub-push source not registered\");const n={},a=function(e,t){return{method:\"POST\",body:e,headers:t,get:e=>t[e.toLowerCase()]??t[e]}}(o,s),c=function(e){const t={status:o=>(e.statusCode=o,t),json:o=>(e.body=o,t),send:o=>(e.body=o,t),set:()=>t};return t}(n);await i.push(a,c);return[[\"response\",n.statusCode??0,n.body??null]]}}}"
573
573
  },
574
574
  "env": {
575
575
  "push": {
@@ -602,7 +602,7 @@
602
602
  "$code": "()=>{}"
603
603
  },
604
604
  "scope": {
605
- "$code": "()=>se"
605
+ "$code": "()=>I"
606
606
  }
607
607
  }
608
608
  },
@@ -674,5 +674,348 @@
674
674
  }
675
675
  }
676
676
  }
677
+ },
678
+ "exportSchemas": {
679
+ "sourceCloudFunction": {
680
+ "settings": {
681
+ "$schema": "http://json-schema.org/draft-07/schema#",
682
+ "type": "object",
683
+ "properties": {
684
+ "cors": {
685
+ "anyOf": [
686
+ {
687
+ "type": "boolean"
688
+ },
689
+ {
690
+ "type": "object",
691
+ "properties": {
692
+ "origin": {
693
+ "anyOf": [
694
+ {
695
+ "type": "string"
696
+ },
697
+ {
698
+ "type": "array",
699
+ "items": {
700
+ "type": "string"
701
+ }
702
+ },
703
+ {
704
+ "type": "string",
705
+ "const": "*"
706
+ }
707
+ ],
708
+ "description": "Allowed origins (* for all, URL string, or array of URLs)"
709
+ },
710
+ "methods": {
711
+ "type": "array",
712
+ "items": {
713
+ "type": "string",
714
+ "enum": [
715
+ "GET",
716
+ "POST",
717
+ "PUT",
718
+ "PATCH",
719
+ "DELETE",
720
+ "OPTIONS",
721
+ "HEAD"
722
+ ]
723
+ },
724
+ "description": "Allowed HTTP methods"
725
+ },
726
+ "headers": {
727
+ "type": "array",
728
+ "items": {
729
+ "type": "string"
730
+ },
731
+ "description": "Allowed request headers"
732
+ },
733
+ "credentials": {
734
+ "type": "boolean",
735
+ "description": "Allow credentials (cookies, authorization headers)"
736
+ },
737
+ "maxAge": {
738
+ "type": "integer",
739
+ "exclusiveMinimum": 0,
740
+ "maximum": 9007199254740991,
741
+ "description": "Preflight cache duration in seconds"
742
+ }
743
+ },
744
+ "additionalProperties": false
745
+ }
746
+ ],
747
+ "description": "CORS configuration: false = disabled, true = allow all origins, object = custom configuration"
748
+ },
749
+ "maxBatchSize": {
750
+ "default": 100,
751
+ "type": "integer",
752
+ "minimum": 1,
753
+ "maximum": 9007199254740991,
754
+ "description": "Maximum number of events accepted in a single batch request"
755
+ },
756
+ "enablePixelTracking": {
757
+ "default": true,
758
+ "type": "boolean",
759
+ "description": "Serve a tracking pixel for GET requests"
760
+ },
761
+ "timeout": {
762
+ "type": "integer",
763
+ "exclusiveMinimum": 0,
764
+ "maximum": 540000,
765
+ "description": "Request timeout in milliseconds (max: 540000 for GCP)"
766
+ }
767
+ },
768
+ "required": [],
769
+ "additionalProperties": false
770
+ }
771
+ },
772
+ "sourcePubSubPull": {
773
+ "settings": {
774
+ "$schema": "http://json-schema.org/draft-07/schema#",
775
+ "type": "object",
776
+ "properties": {
777
+ "client": {
778
+ "description": "Pre-configured Google Cloud Pub/Sub client (like new PubSub({ projectId })). Bypasses credentials resolution when supplied."
779
+ },
780
+ "projectId": {
781
+ "type": "string",
782
+ "minLength": 1,
783
+ "description": "Google Cloud Project ID (like my-gcp-project)."
784
+ },
785
+ "subscription": {
786
+ "type": "string",
787
+ "minLength": 1,
788
+ "description": "Pub/Sub subscription short name (like events-sub). The full resource name projects/<projectId>/subscriptions/<subscription> is built by the SDK."
789
+ },
790
+ "topic": {
791
+ "type": "string",
792
+ "description": "Pub/Sub topic short name. Required when setup.createTopic is true; otherwise informational."
793
+ },
794
+ "credentials": {
795
+ "description": "Service account credentials as a JSON string or an object with client_email and private_key. Default: Application Default Credentials (ADC). (deprecated: use config.credentials)"
796
+ },
797
+ "apiEndpoint": {
798
+ "type": "string",
799
+ "description": "Override Pub/Sub API endpoint. Useful for the local emulator (like localhost:8085)."
800
+ },
801
+ "decoder": {
802
+ "type": "string",
803
+ "enum": [
804
+ "json",
805
+ "text",
806
+ "raw"
807
+ ],
808
+ "description": "Decoder for the message data field. json (default) parses JSON, text decodes UTF-8, raw forwards the Buffer."
809
+ },
810
+ "flowControl": {
811
+ "type": "object",
812
+ "properties": {
813
+ "maxMessages": {
814
+ "type": "number",
815
+ "description": "Maximum in-flight messages. Default: 100."
816
+ },
817
+ "maxBytes": {
818
+ "type": "number",
819
+ "description": "Maximum in-flight bytes. Default: 10485760 (10 MB)."
820
+ }
821
+ },
822
+ "additionalProperties": false,
823
+ "description": "Subscriber flow control. Tightens the SDK defaults.",
824
+ "title": "flowControl"
825
+ },
826
+ "ackDeadline": {
827
+ "type": "number",
828
+ "description": "Subscriber ack deadline in seconds. Default: 60."
829
+ },
830
+ "shutdownTimeoutMs": {
831
+ "type": "number",
832
+ "description": "Graceful shutdown timeout in milliseconds. Default: 30000. After this window, destroy() force-closes the subscriber."
833
+ },
834
+ "onPushError": {
835
+ "type": "string",
836
+ "enum": [
837
+ "nack",
838
+ "ack"
839
+ ],
840
+ "description": "Behavior when forwarding to the collector throws. nack (default) redelivers the message; ack drops it."
841
+ }
842
+ },
843
+ "required": [
844
+ "projectId",
845
+ "subscription"
846
+ ],
847
+ "additionalProperties": false
848
+ },
849
+ "setup": {
850
+ "$schema": "http://json-schema.org/draft-07/schema#",
851
+ "type": "object",
852
+ "properties": {
853
+ "createTopic": {
854
+ "type": "boolean",
855
+ "description": "Create the topic if it does not exist. Requires settings.topic. Default: false (require pre-existing topic)."
856
+ },
857
+ "ackDeadlineSeconds": {
858
+ "type": "number",
859
+ "description": "Subscription ack deadline in seconds. Default: 60."
860
+ },
861
+ "messageRetentionDuration": {
862
+ "type": "object",
863
+ "properties": {
864
+ "seconds": {
865
+ "type": "number",
866
+ "description": "Retention window in seconds. Default: project default."
867
+ }
868
+ },
869
+ "required": [
870
+ "seconds"
871
+ ],
872
+ "additionalProperties": false,
873
+ "description": "Subscription-level retention configuration.",
874
+ "title": "messageRetentionDuration"
875
+ },
876
+ "filter": {
877
+ "type": "string",
878
+ "description": "Subscription filter expression. Only messages matching this filter are delivered."
879
+ },
880
+ "deadLetterPolicy": {
881
+ "type": "object",
882
+ "properties": {
883
+ "deadLetterTopic": {
884
+ "type": "string",
885
+ "description": "Dead-letter topic short name."
886
+ },
887
+ "maxDeliveryAttempts": {
888
+ "type": "number",
889
+ "description": "Maximum delivery attempts before forwarding to the dead-letter topic."
890
+ },
891
+ "createDeadLetterTopic": {
892
+ "type": "boolean",
893
+ "description": "Auto-create the dead-letter topic if it does not exist. Default: false."
894
+ }
895
+ },
896
+ "required": [
897
+ "deadLetterTopic",
898
+ "maxDeliveryAttempts"
899
+ ],
900
+ "additionalProperties": false,
901
+ "description": "Dead-letter policy. Strongly recommended for production.",
902
+ "title": "deadLetterPolicy"
903
+ },
904
+ "retryPolicy": {
905
+ "type": "object",
906
+ "properties": {
907
+ "minimumBackoff": {
908
+ "type": "object",
909
+ "properties": {
910
+ "seconds": {
911
+ "type": "number",
912
+ "description": "Minimum backoff in seconds."
913
+ }
914
+ },
915
+ "required": [
916
+ "seconds"
917
+ ],
918
+ "additionalProperties": false,
919
+ "title": "minimumBackoff"
920
+ },
921
+ "maximumBackoff": {
922
+ "type": "object",
923
+ "properties": {
924
+ "seconds": {
925
+ "type": "number",
926
+ "description": "Maximum backoff in seconds."
927
+ }
928
+ },
929
+ "required": [
930
+ "seconds"
931
+ ],
932
+ "additionalProperties": false,
933
+ "title": "maximumBackoff"
934
+ }
935
+ },
936
+ "required": [
937
+ "minimumBackoff",
938
+ "maximumBackoff"
939
+ ],
940
+ "additionalProperties": false,
941
+ "description": "Subscription retry policy.",
942
+ "title": "retryPolicy"
943
+ },
944
+ "enableMessageOrdering": {
945
+ "type": "boolean",
946
+ "description": "Enable message ordering on the subscription. Default: false."
947
+ },
948
+ "labels": {
949
+ "type": "object",
950
+ "propertyNames": {
951
+ "type": "string"
952
+ },
953
+ "additionalProperties": {
954
+ "type": "string"
955
+ },
956
+ "description": "Subscription labels for organization and billing."
957
+ },
958
+ "expirationPolicy": {
959
+ "type": "object",
960
+ "properties": {
961
+ "ttl": {
962
+ "anyOf": [
963
+ {
964
+ "type": "object",
965
+ "properties": {
966
+ "seconds": {
967
+ "type": "number",
968
+ "description": "TTL in seconds. null means never expire."
969
+ }
970
+ },
971
+ "required": [
972
+ "seconds"
973
+ ],
974
+ "additionalProperties": false
975
+ },
976
+ {
977
+ "type": "null"
978
+ }
979
+ ]
980
+ }
981
+ },
982
+ "additionalProperties": false,
983
+ "description": "Subscription expiration policy.",
984
+ "title": "expirationPolicy"
985
+ }
986
+ },
987
+ "additionalProperties": false
988
+ }
989
+ },
990
+ "sourcePubSubPush": {
991
+ "settings": {
992
+ "$schema": "http://json-schema.org/draft-07/schema#",
993
+ "type": "object",
994
+ "properties": {
995
+ "projectId": {
996
+ "type": "string",
997
+ "description": "Google Cloud Project ID (informational, surfaced in error messages)."
998
+ },
999
+ "decoder": {
1000
+ "type": "string",
1001
+ "enum": [
1002
+ "json",
1003
+ "text",
1004
+ "raw"
1005
+ ],
1006
+ "description": "Decoder for the message data field. json (default) parses JSON, text decodes UTF-8, raw forwards the Buffer."
1007
+ },
1008
+ "verifyOidc": {
1009
+ "type": "boolean",
1010
+ "description": "Verify the OIDC bearer token Pub/Sub attaches to push requests. Default: false."
1011
+ },
1012
+ "audience": {
1013
+ "type": "string",
1014
+ "description": "OIDC audience (your endpoint URL or a custom audience). Required when verifyOidc is true."
1015
+ }
1016
+ },
1017
+ "additionalProperties": false
1018
+ }
1019
+ }
677
1020
  }
678
1021
  }
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, Pub/Sub)",
4
- "version": "4.7.0-next-1790722899482",
4
+ "version": "4.7.0",
5
5
  "license": "MIT",
6
6
  "main": "./dist/index.js",
7
7
  "module": "./dist/index.mjs",
@@ -21,8 +21,8 @@
21
21
  },
22
22
  "dependencies": {
23
23
  "@google-cloud/pubsub": "^5.3.0",
24
- "@walkeros/collector": "4.7.0-next-1790722899482",
25
- "@walkeros/core": "4.7.0-next-1790722899482"
24
+ "@walkeros/collector": "4.7.0",
25
+ "@walkeros/core": "4.7.0"
26
26
  },
27
27
  "peerDependencies": {
28
28
  "@google-cloud/functions-framework": "^5.0.2"