@zuplo/cli 6.72.8 → 6.72.9

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.
Files changed (36) hide show
  1. package/node_modules/@posthog/core/dist/surveys/activation.d.ts +20 -0
  2. package/node_modules/@posthog/core/dist/surveys/activation.d.ts.map +1 -0
  3. package/node_modules/@posthog/core/dist/surveys/activation.js +45 -0
  4. package/node_modules/@posthog/core/dist/surveys/activation.mjs +8 -0
  5. package/node_modules/@posthog/core/dist/surveys/events.d.ts +1 -4
  6. package/node_modules/@posthog/core/dist/surveys/events.d.ts.map +1 -1
  7. package/node_modules/@posthog/core/dist/surveys/index.d.ts +2 -0
  8. package/node_modules/@posthog/core/dist/surveys/index.d.ts.map +1 -1
  9. package/node_modules/@posthog/core/dist/surveys/index.js +16 -2
  10. package/node_modules/@posthog/core/dist/surveys/index.mjs +3 -1
  11. package/node_modules/@posthog/core/dist/surveys/keys.d.ts +14 -0
  12. package/node_modules/@posthog/core/dist/surveys/keys.d.ts.map +1 -0
  13. package/node_modules/@posthog/core/dist/surveys/keys.js +45 -0
  14. package/node_modules/@posthog/core/dist/surveys/keys.mjs +8 -0
  15. package/node_modules/@posthog/core/dist/types.d.ts +87 -76
  16. package/node_modules/@posthog/core/dist/types.d.ts.map +1 -1
  17. package/node_modules/@posthog/core/dist/types.js +65 -76
  18. package/node_modules/@posthog/core/dist/types.mjs +66 -77
  19. package/node_modules/@posthog/core/package.json +1 -1
  20. package/node_modules/@posthog/core/src/surveys/activation.spec.ts +61 -0
  21. package/node_modules/@posthog/core/src/surveys/activation.ts +28 -0
  22. package/node_modules/@posthog/core/src/surveys/events.ts +1 -5
  23. package/node_modules/@posthog/core/src/surveys/index.ts +2 -0
  24. package/node_modules/@posthog/core/src/surveys/keys.spec.ts +29 -0
  25. package/node_modules/@posthog/core/src/surveys/keys.ts +23 -0
  26. package/node_modules/@posthog/core/src/types.ts +88 -76
  27. package/node_modules/@zuplo/core/package.json +1 -1
  28. package/node_modules/@zuplo/graphql/package.json +1 -1
  29. package/node_modules/@zuplo/openapi-tools/package.json +1 -1
  30. package/node_modules/@zuplo/otel/package.json +1 -1
  31. package/node_modules/@zuplo/runtime/package.json +1 -1
  32. package/node_modules/ws/lib/receiver.js +15 -32
  33. package/node_modules/ws/lib/websocket-server.js +4 -4
  34. package/node_modules/ws/lib/websocket.js +4 -4
  35. package/node_modules/ws/package.json +5 -1
  36. package/package.json +6 -6
@@ -633,43 +633,49 @@ export type SurveyAppearance = {
633
633
  widgetColor?: string
634
634
  }
635
635
 
636
- export enum SurveyPosition {
637
- TopLeft = 'top_left',
638
- TopCenter = 'top_center',
639
- TopRight = 'top_right',
640
- MiddleLeft = 'middle_left',
641
- MiddleCenter = 'middle_center',
642
- MiddleRight = 'middle_right',
643
- Left = 'left',
644
- Right = 'right',
645
- Center = 'center',
646
- }
636
+ export const SurveyPosition = {
637
+ TopLeft: 'top_left',
638
+ TopCenter: 'top_center',
639
+ TopRight: 'top_right',
640
+ MiddleLeft: 'middle_left',
641
+ MiddleCenter: 'middle_center',
642
+ MiddleRight: 'middle_right',
643
+ Left: 'left',
644
+ Right: 'right',
645
+ Center: 'center',
646
+ } as const
647
+ export type SurveyPosition = (typeof SurveyPosition)[keyof typeof SurveyPosition]
647
648
 
648
- export enum SurveyWidgetType {
649
- Button = 'button',
650
- Tab = 'tab',
651
- Selector = 'selector',
652
- }
649
+ export const SurveyWidgetType = {
650
+ Button: 'button',
651
+ Tab: 'tab',
652
+ Selector: 'selector',
653
+ } as const
654
+ export type SurveyWidgetType = (typeof SurveyWidgetType)[keyof typeof SurveyWidgetType]
653
655
 
654
- export enum SurveyType {
655
- Popover = 'popover',
656
- API = 'api',
657
- Widget = 'widget',
658
- ExternalSurvey = 'external_survey',
659
- }
656
+ export const SurveyType = {
657
+ Popover: 'popover',
658
+ API: 'api',
659
+ Widget: 'widget',
660
+ ExternalSurvey: 'external_survey',
661
+ } as const
662
+ export type SurveyType = (typeof SurveyType)[keyof typeof SurveyType]
660
663
 
661
664
  export type SurveyQuestion = BasicSurveyQuestion | LinkSurveyQuestion | RatingSurveyQuestion | MultipleSurveyQuestion
662
665
 
663
- export enum SurveyQuestionDescriptionContentType {
664
- Html = 'html',
665
- Text = 'text',
666
- }
666
+ export const SurveyQuestionDescriptionContentType = {
667
+ Html: 'html',
668
+ Text: 'text',
669
+ } as const
670
+ export type SurveyQuestionDescriptionContentType =
671
+ (typeof SurveyQuestionDescriptionContentType)[keyof typeof SurveyQuestionDescriptionContentType]
667
672
 
668
673
  // Survey validation types
669
- export enum SurveyValidationType {
670
- MinLength = 'min_length',
671
- MaxLength = 'max_length',
672
- }
674
+ export const SurveyValidationType = {
675
+ MinLength: 'min_length',
676
+ MaxLength: 'max_length',
677
+ } as const
678
+ export type SurveyValidationType = (typeof SurveyValidationType)[keyof typeof SurveyValidationType]
673
679
 
674
680
  export interface SurveyValidationRule {
675
681
  type: SurveyValidationType
@@ -710,16 +716,16 @@ type SurveyQuestionBase = {
710
716
  }
711
717
 
712
718
  export type BasicSurveyQuestion = SurveyQuestionBase & {
713
- type: SurveyQuestionType.Open
719
+ type: typeof SurveyQuestionType.Open
714
720
  }
715
721
 
716
722
  export type LinkSurveyQuestion = SurveyQuestionBase & {
717
- type: SurveyQuestionType.Link
723
+ type: typeof SurveyQuestionType.Link
718
724
  link?: string | null
719
725
  }
720
726
 
721
727
  export type RatingSurveyQuestion = SurveyQuestionBase & {
722
- type: SurveyQuestionType.Rating
728
+ type: typeof SurveyQuestionType.Rating
723
729
  display: SurveyRatingDisplay
724
730
  scale: 2 | 3 | 5 | 7 | 10
725
731
  lowerBoundLabel: string
@@ -727,49 +733,52 @@ export type RatingSurveyQuestion = SurveyQuestionBase & {
727
733
  skipSubmitButton?: boolean
728
734
  }
729
735
 
730
- export enum SurveyRatingDisplay {
731
- Number = 'number',
732
- Emoji = 'emoji',
733
- }
736
+ export const SurveyRatingDisplay = {
737
+ Number: 'number',
738
+ Emoji: 'emoji',
739
+ } as const
740
+ export type SurveyRatingDisplay = (typeof SurveyRatingDisplay)[keyof typeof SurveyRatingDisplay]
734
741
 
735
742
  export type MultipleSurveyQuestion = SurveyQuestionBase & {
736
- type: SurveyQuestionType.SingleChoice | SurveyQuestionType.MultipleChoice
743
+ type: typeof SurveyQuestionType.SingleChoice | typeof SurveyQuestionType.MultipleChoice
737
744
  choices: string[]
738
745
  hasOpenChoice?: boolean
739
746
  shuffleOptions?: boolean
740
747
  skipSubmitButton?: boolean
741
748
  }
742
749
 
743
- export enum SurveyQuestionType {
744
- Open = 'open',
745
- MultipleChoice = 'multiple_choice',
746
- SingleChoice = 'single_choice',
747
- Rating = 'rating',
748
- Link = 'link',
749
- }
750
+ export const SurveyQuestionType = {
751
+ Open: 'open',
752
+ MultipleChoice: 'multiple_choice',
753
+ SingleChoice: 'single_choice',
754
+ Rating: 'rating',
755
+ Link: 'link',
756
+ } as const
757
+ export type SurveyQuestionType = (typeof SurveyQuestionType)[keyof typeof SurveyQuestionType]
750
758
 
751
- export enum SurveyQuestionBranchingType {
752
- NextQuestion = 'next_question',
753
- End = 'end',
754
- ResponseBased = 'response_based',
755
- SpecificQuestion = 'specific_question',
756
- }
759
+ export const SurveyQuestionBranchingType = {
760
+ NextQuestion: 'next_question',
761
+ End: 'end',
762
+ ResponseBased: 'response_based',
763
+ SpecificQuestion: 'specific_question',
764
+ } as const
765
+ export type SurveyQuestionBranchingType = (typeof SurveyQuestionBranchingType)[keyof typeof SurveyQuestionBranchingType]
757
766
 
758
767
  export type NextQuestionBranching = {
759
- type: SurveyQuestionBranchingType.NextQuestion
768
+ type: typeof SurveyQuestionBranchingType.NextQuestion
760
769
  }
761
770
 
762
771
  export type EndBranching = {
763
- type: SurveyQuestionBranchingType.End
772
+ type: typeof SurveyQuestionBranchingType.End
764
773
  }
765
774
 
766
775
  export type ResponseBasedBranching = {
767
- type: SurveyQuestionBranchingType.ResponseBased
776
+ type: typeof SurveyQuestionBranchingType.ResponseBased
768
777
  responseValues: Record<string, any>
769
778
  }
770
779
 
771
780
  export type SpecificQuestionBranching = {
772
- type: SurveyQuestionBranchingType.SpecificQuestion
781
+ type: typeof SurveyQuestionBranchingType.SpecificQuestion
773
782
  index: number
774
783
  }
775
784
 
@@ -783,20 +792,22 @@ export type SurveyResponses = Record<string, SurveyResponseValue>
783
792
 
784
793
  export type SurveyCallback = (surveys: Survey[]) => void
785
794
 
786
- export enum SurveyMatchType {
787
- Regex = 'regex',
788
- NotRegex = 'not_regex',
789
- Exact = 'exact',
790
- IsNot = 'is_not',
791
- Icontains = 'icontains',
792
- NotIcontains = 'not_icontains',
793
- }
795
+ export const SurveyMatchType = {
796
+ Regex: 'regex',
797
+ NotRegex: 'not_regex',
798
+ Exact: 'exact',
799
+ IsNot: 'is_not',
800
+ Icontains: 'icontains',
801
+ NotIcontains: 'not_icontains',
802
+ } as const
803
+ export type SurveyMatchType = (typeof SurveyMatchType)[keyof typeof SurveyMatchType]
794
804
 
795
- export enum SurveySchedule {
796
- Once = 'once',
797
- Recurring = 'recurring',
798
- Always = 'always',
799
- }
805
+ export const SurveySchedule = {
806
+ Once: 'once',
807
+ Recurring: 'recurring',
808
+ Always: 'always',
809
+ } as const
810
+ export type SurveySchedule = (typeof SurveySchedule)[keyof typeof SurveySchedule]
800
811
 
801
812
  export type SurveyElement = {
802
813
  text?: string
@@ -853,9 +864,9 @@ export type Survey = {
853
864
  }
854
865
  start_date?: string
855
866
  end_date?: string
856
- current_iteration?: number
857
- current_iteration_start_date?: string
858
- schedule?: SurveySchedule
867
+ current_iteration?: number | null
868
+ current_iteration_start_date?: string | null
869
+ schedule?: SurveySchedule | null
859
870
  }
860
871
 
861
872
  export type SurveyActionType = {
@@ -865,11 +876,12 @@ export type SurveyActionType = {
865
876
  }
866
877
 
867
878
  /** Sync with plugin-server/src/types.ts */
868
- export enum ActionStepStringMatching {
869
- Contains = 'contains',
870
- Exact = 'exact',
871
- Regex = 'regex',
872
- }
879
+ export const ActionStepStringMatching = {
880
+ Contains: 'contains',
881
+ Exact: 'exact',
882
+ Regex: 'regex',
883
+ } as const
884
+ export type ActionStepStringMatching = (typeof ActionStepStringMatching)[keyof typeof ActionStepStringMatching]
873
885
 
874
886
  export type ActionStepType = {
875
887
  event?: string
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zuplo/core",
3
- "version": "6.72.8",
3
+ "version": "6.72.9",
4
4
  "repository": "https://github.com/zuplo/zuplo",
5
5
  "author": "Zuplo, Inc.",
6
6
  "type": "module",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@zuplo/graphql",
3
3
  "type": "module",
4
- "version": "6.72.8",
4
+ "version": "6.72.9",
5
5
  "repository": "https://github.com/zuplo/zuplo",
6
6
  "author": "Zuplo, Inc.",
7
7
  "exports": {
@@ -2,7 +2,7 @@
2
2
  "name": "@zuplo/openapi-tools",
3
3
  "type": "module",
4
4
  "sideEffects": false,
5
- "version": "6.72.8",
5
+ "version": "6.72.9",
6
6
  "description": "Tooling for OpenAPI files",
7
7
  "repository": {
8
8
  "type": "git",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@zuplo/otel",
3
3
  "type": "module",
4
- "version": "6.72.8",
4
+ "version": "6.72.9",
5
5
  "repository": "https://github.com/zuplo/zuplo",
6
6
  "author": "Zuplo, Inc.",
7
7
  "exports": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@zuplo/runtime",
3
3
  "type": "module",
4
- "version": "6.72.8",
4
+ "version": "6.72.9",
5
5
  "repository": "https://github.com/zuplo/zuplo",
6
6
  "author": "Zuplo, Inc.",
7
7
  "exports": {
@@ -77,6 +77,7 @@ class Receiver extends Writable {
77
77
 
78
78
  this._totalPayloadLength = 0;
79
79
  this._messageLength = 0;
80
+ this._numFragments = 0;
80
81
  this._fragments = [];
81
82
 
82
83
  this._errored = false;
@@ -500,6 +501,19 @@ class Receiver extends Writable {
500
501
  return;
501
502
  }
502
503
 
504
+ if (this._maxFragments > 0 && ++this._numFragments > this._maxFragments) {
505
+ const error = this.createError(
506
+ RangeError,
507
+ 'Too many message fragments',
508
+ false,
509
+ 1008,
510
+ 'WS_ERR_TOO_MANY_BUFFERED_PARTS'
511
+ );
512
+
513
+ cb(error);
514
+ return;
515
+ }
516
+
503
517
  if (this._compressed) {
504
518
  this._state = INFLATING;
505
519
  this.decompress(data, cb);
@@ -507,22 +521,6 @@ class Receiver extends Writable {
507
521
  }
508
522
 
509
523
  if (data.length) {
510
- if (
511
- this._maxFragments > 0 &&
512
- this._fragments.length >= this._maxFragments
513
- ) {
514
- const error = this.createError(
515
- RangeError,
516
- 'Too many message fragments',
517
- false,
518
- 1008,
519
- 'WS_ERR_TOO_MANY_BUFFERED_PARTS'
520
- );
521
-
522
- cb(error);
523
- return;
524
- }
525
-
526
524
  //
527
525
  // This message is not compressed so its length is the sum of the payload
528
526
  // length of all fragments.
@@ -562,22 +560,6 @@ class Receiver extends Writable {
562
560
  return;
563
561
  }
564
562
 
565
- if (
566
- this._maxFragments > 0 &&
567
- this._fragments.length >= this._maxFragments
568
- ) {
569
- const error = this.createError(
570
- RangeError,
571
- 'Too many message fragments',
572
- false,
573
- 1008,
574
- 'WS_ERR_TOO_MANY_BUFFERED_PARTS'
575
- );
576
-
577
- cb(error);
578
- return;
579
- }
580
-
581
563
  this._fragments.push(buf);
582
564
  }
583
565
 
@@ -604,6 +586,7 @@ class Receiver extends Writable {
604
586
  this._totalPayloadLength = 0;
605
587
  this._messageLength = 0;
606
588
  this._fragmented = 0;
589
+ this._numFragments = 0;
607
590
  this._fragments = [];
608
591
 
609
592
  if (this._opcode === 2) {
@@ -43,9 +43,9 @@ class WebSocketServer extends EventEmitter {
43
43
  * called
44
44
  * @param {Function} [options.handleProtocols] A hook to handle protocols
45
45
  * @param {String} [options.host] The hostname where to bind the server
46
- * @param {Number} [options.maxBufferedChunks=1048576] The maximum number of
46
+ * @param {Number} [options.maxBufferedChunks=262144] The maximum number of
47
47
  * buffered data chunks
48
- * @param {Number} [options.maxFragments=131072] The maximum number of message
48
+ * @param {Number} [options.maxFragments=16384] The maximum number of message
49
49
  * fragments
50
50
  * @param {Number} [options.maxPayload=104857600] The maximum allowed message
51
51
  * size
@@ -69,8 +69,8 @@ class WebSocketServer extends EventEmitter {
69
69
  options = {
70
70
  allowSynchronousEvents: true,
71
71
  autoPong: true,
72
- maxBufferedChunks: 1024 * 1024,
73
- maxFragments: 128 * 1024,
72
+ maxBufferedChunks: 256 * 1024,
73
+ maxFragments: 16 * 1024,
74
74
  maxPayload: 100 * 1024 * 1024,
75
75
  skipUTF8Validation: false,
76
76
  perMessageDeflate: false,
@@ -646,9 +646,9 @@ module.exports = WebSocket;
646
646
  * masking key
647
647
  * @param {Number} [options.handshakeTimeout] Timeout in milliseconds for the
648
648
  * handshake request
649
- * @param {Number} [options.maxBufferedChunks=1048576] The maximum number of
649
+ * @param {Number} [options.maxBufferedChunks=262144] The maximum number of
650
650
  * buffered data chunks
651
- * @param {Number} [options.maxFragments=131072] The maximum number of message
651
+ * @param {Number} [options.maxFragments=16384] The maximum number of message
652
652
  * fragments
653
653
  * @param {Number} [options.maxPayload=104857600] The maximum allowed message
654
654
  * size
@@ -670,8 +670,8 @@ function initAsClient(websocket, address, protocols, options) {
670
670
  autoPong: true,
671
671
  closeTimeout: CLOSE_TIMEOUT,
672
672
  protocolVersion: protocolVersions[1],
673
- maxBufferedChunks: 1024 * 1024,
674
- maxFragments: 128 * 1024,
673
+ maxBufferedChunks: 256 * 1024,
674
+ maxFragments: 16 * 1024,
675
675
  maxPayload: 100 * 1024 * 1024,
676
676
  skipUTF8Validation: false,
677
677
  perMessageDeflate: true,
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ws",
3
- "version": "8.21.0",
3
+ "version": "8.21.1",
4
4
  "description": "Simple to use, blazing fast and thoroughly tested websocket client and server for Node.js",
5
5
  "keywords": [
6
6
  "HyBi",
@@ -66,5 +66,9 @@
66
66
  "nyc": "^15.0.0",
67
67
  "prettier": "^3.0.0",
68
68
  "utf-8-validate": "^6.0.0"
69
+ },
70
+ "allowScripts": {
71
+ "bufferutil": true,
72
+ "utf-8-validate": true
69
73
  }
70
74
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zuplo/cli",
3
- "version": "6.72.8",
3
+ "version": "6.72.9",
4
4
  "repository": "https://github.com/zuplo/zuplo",
5
5
  "author": "Zuplo, Inc.",
6
6
  "type": "module",
@@ -27,10 +27,10 @@
27
27
  "@opentelemetry/api": "1.9.0",
28
28
  "@opentelemetry/api-logs": "0.201.1",
29
29
  "@swc/core": "1.10.18",
30
- "@zuplo/core": "6.72.8",
30
+ "@zuplo/core": "6.72.9",
31
31
  "@zuplo/editor": "1.0.20821740935",
32
- "@zuplo/openapi-tools": "6.72.8",
33
- "@zuplo/runtime": "6.72.8",
32
+ "@zuplo/openapi-tools": "6.72.9",
33
+ "@zuplo/runtime": "6.72.9",
34
34
  "chalk": "5.4.1",
35
35
  "chokidar": "3.5.3",
36
36
  "cookie": "1.0.2",
@@ -61,8 +61,8 @@
61
61
  "workerd": "1.20241230.0",
62
62
  "yargs": "17.7.2",
63
63
  "zod": "3.25.76",
64
- "@zuplo/graphql": "6.72.8",
65
- "@zuplo/otel": "6.72.8"
64
+ "@zuplo/graphql": "6.72.9",
65
+ "@zuplo/otel": "6.72.9"
66
66
  },
67
67
  "bundleDependencies": [
68
68
  "@inquirer/prompts",