@pushwoosh/rpc-v2-http-api-data 0.2.376 → 0.2.378

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/data.js CHANGED
@@ -17730,6 +17730,462 @@ export const data = {
17730
17730
  }
17731
17731
  }
17732
17732
  },
17733
+ "pushwoosh.rpc_v2.feature_flags.FeatureFlagsService_FieldViolations": {
17734
+ "type": "E",
17735
+ "values": [
17736
+ "FV_UNSPECIFIED",
17737
+ "KEY_INVALID",
17738
+ "KEY_TAKEN",
17739
+ "TEXT_INVALID",
17740
+ "PROPERTIES_LIMIT",
17741
+ "PROPERTY_KEY_INVALID",
17742
+ "PROPERTY_TYPE_INVALID",
17743
+ "PROPERTY_TYPE_IMMUTABLE",
17744
+ "VALUE_INVALID",
17745
+ "PROPERTIES_TOO_LARGE",
17746
+ "RULES_LIMIT",
17747
+ "RULE_NOT_FOUND",
17748
+ "PERCENT_INVALID",
17749
+ "OVERRIDE_UNKNOWN_PROPERTY",
17750
+ "SEGMENT_NOT_FOUND",
17751
+ "INVALID_SEGMENT_TYPE",
17752
+ "FLAG_DEPENDENCY",
17753
+ "CONFIRM_REQUIRED",
17754
+ "TAG_CONFLICT"
17755
+ ],
17756
+ "valuesArgs": {
17757
+ "KEY_INVALID": [
17758
+ "pattern"
17759
+ ],
17760
+ "KEY_TAKEN": [
17761
+ "key"
17762
+ ],
17763
+ "PROPERTIES_LIMIT": [
17764
+ "max"
17765
+ ],
17766
+ "PROPERTY_TYPE_IMMUTABLE": [
17767
+ "key"
17768
+ ],
17769
+ "PROPERTIES_TOO_LARGE": [
17770
+ "size"
17771
+ ],
17772
+ "RULES_LIMIT": [
17773
+ "max"
17774
+ ],
17775
+ "RULE_NOT_FOUND": [
17776
+ "rule_id"
17777
+ ],
17778
+ "OVERRIDE_UNKNOWN_PROPERTY": [
17779
+ "key"
17780
+ ],
17781
+ "SEGMENT_NOT_FOUND": [
17782
+ "filter_code"
17783
+ ],
17784
+ "INVALID_SEGMENT_TYPE": [
17785
+ "leaf"
17786
+ ],
17787
+ "FLAG_DEPENDENCY": [
17788
+ "filter_code"
17789
+ ],
17790
+ "TAG_CONFLICT": [
17791
+ "tag"
17792
+ ]
17793
+ }
17794
+ },
17795
+ "pushwoosh.rpc_v2.feature_flags.FeatureFlagsService_FailedPreconditions": {
17796
+ "type": "E",
17797
+ "values": [
17798
+ "FP_UNSPECIFIED",
17799
+ "FEATURE_FLAGS_NOT_ALLOWED",
17800
+ "FLAGS_LIMIT",
17801
+ "VERSION_CONFLICT",
17802
+ "PAYLOAD_TOO_LARGE",
17803
+ "STATUS_CONFLICT"
17804
+ ]
17805
+ },
17806
+ "pushwoosh.rpc_v2.feature_flags.FeatureFlagsService": {
17807
+ "type": "S",
17808
+ "key": "featureFlags",
17809
+ "methods": {
17810
+ "List": {
17811
+ "request": "pushwoosh.rpc_v2.feature_flags.ListFeatureFlagsRequest",
17812
+ "response": "pushwoosh.rpc_v2.feature_flags.ListFeatureFlagsResponse",
17813
+ "method": "get",
17814
+ "path": "/api/applications/{application_code}/feature_flags"
17815
+ },
17816
+ "Get": {
17817
+ "request": "pushwoosh.rpc_v2.feature_flags.GetFeatureFlagRequest",
17818
+ "response": "pushwoosh.rpc_v2.feature_flags.GetFeatureFlagResponse",
17819
+ "method": "get",
17820
+ "path": "/api/applications/{application_code}/feature_flags/{key}"
17821
+ },
17822
+ "Create": {
17823
+ "request": "pushwoosh.rpc_v2.feature_flags.CreateFeatureFlagRequest",
17824
+ "response": "pushwoosh.rpc_v2.feature_flags.CreateFeatureFlagResponse",
17825
+ "method": "post",
17826
+ "path": "/api/applications/{application_code}/feature_flags"
17827
+ },
17828
+ "Update": {
17829
+ "request": "pushwoosh.rpc_v2.feature_flags.UpdateFeatureFlagRequest",
17830
+ "response": "pushwoosh.rpc_v2.feature_flags.UpdateFeatureFlagResponse",
17831
+ "method": "post",
17832
+ "path": "/api/applications/{application_code}/feature_flags/{key}"
17833
+ },
17834
+ "SetRulePercent": {
17835
+ "request": "pushwoosh.rpc_v2.feature_flags.SetFeatureFlagRulePercentRequest",
17836
+ "response": "pushwoosh.rpc_v2.feature_flags.SetFeatureFlagRulePercentResponse",
17837
+ "method": "post",
17838
+ "path": "/api/applications/{application_code}/feature_flags/{key}/rules/{rule_id}/percent"
17839
+ },
17840
+ "Kill": {
17841
+ "request": "pushwoosh.rpc_v2.feature_flags.KillFeatureFlagRequest",
17842
+ "response": "pushwoosh.rpc_v2.feature_flags.KillFeatureFlagResponse",
17843
+ "method": "post",
17844
+ "path": "/api/applications/{application_code}/feature_flags/{key}/kill"
17845
+ },
17846
+ "Unkill": {
17847
+ "request": "pushwoosh.rpc_v2.feature_flags.UnkillFeatureFlagRequest",
17848
+ "response": "pushwoosh.rpc_v2.feature_flags.UnkillFeatureFlagResponse",
17849
+ "method": "post",
17850
+ "path": "/api/applications/{application_code}/feature_flags/{key}/unkill"
17851
+ },
17852
+ "Archive": {
17853
+ "request": "pushwoosh.rpc_v2.feature_flags.ArchiveFeatureFlagRequest",
17854
+ "response": "pushwoosh.rpc_v2.feature_flags.ArchiveFeatureFlagResponse",
17855
+ "method": "post",
17856
+ "path": "/api/applications/{application_code}/feature_flags/{key}/archive"
17857
+ },
17858
+ "Restore": {
17859
+ "request": "pushwoosh.rpc_v2.feature_flags.RestoreFeatureFlagRequest",
17860
+ "response": "pushwoosh.rpc_v2.feature_flags.RestoreFeatureFlagResponse",
17861
+ "method": "post",
17862
+ "path": "/api/applications/{application_code}/feature_flags/{key}/restore"
17863
+ },
17864
+ "Reshuffle": {
17865
+ "request": "pushwoosh.rpc_v2.feature_flags.ReshuffleFeatureFlagRequest",
17866
+ "response": "pushwoosh.rpc_v2.feature_flags.ReshuffleFeatureFlagResponse",
17867
+ "method": "post",
17868
+ "path": "/api/applications/{application_code}/feature_flags/{key}/reshuffle"
17869
+ }
17870
+ }
17871
+ },
17872
+ "pushwoosh.rpc_v2.feature_flags.FeatureFlagProperty": {
17873
+ "type": "I",
17874
+ "fields": {
17875
+ "key": {
17876
+ "type": "string"
17877
+ },
17878
+ "type": {
17879
+ "type": "string"
17880
+ }
17881
+ }
17882
+ },
17883
+ "pushwoosh.rpc_v2.feature_flags.FeatureFlagRule": {
17884
+ "type": "I",
17885
+ "fields": {
17886
+ "ruleId": {
17887
+ "type": "string"
17888
+ },
17889
+ "name": {
17890
+ "type": "string"
17891
+ },
17892
+ "filterCode": {
17893
+ "type": "string"
17894
+ },
17895
+ "percentBp": {
17896
+ "type": "number"
17897
+ },
17898
+ "overrides": {
17899
+ "type": "object"
17900
+ }
17901
+ }
17902
+ },
17903
+ "pushwoosh.rpc_v2.feature_flags.FeatureFlag": {
17904
+ "type": "I",
17905
+ "fields": {
17906
+ "applicationCode": {
17907
+ "type": "string"
17908
+ },
17909
+ "key": {
17910
+ "type": "string"
17911
+ },
17912
+ "name": {
17913
+ "type": "string"
17914
+ },
17915
+ "description": {
17916
+ "type": "string"
17917
+ },
17918
+ "status": {
17919
+ "type": "string"
17920
+ },
17921
+ "properties": {
17922
+ "type": "pushwoosh.rpc_v2.feature_flags.FeatureFlagProperty",
17923
+ "array": true
17924
+ },
17925
+ "defaults": {
17926
+ "type": "object"
17927
+ },
17928
+ "rules": {
17929
+ "type": "pushwoosh.rpc_v2.feature_flags.FeatureFlagRule",
17930
+ "array": true
17931
+ },
17932
+ "version": {
17933
+ "type": "number"
17934
+ },
17935
+ "created": {
17936
+ "type": "Date"
17937
+ },
17938
+ "updated": {
17939
+ "type": "Date"
17940
+ },
17941
+ "lastModifiedByUserId": {
17942
+ "type": "number"
17943
+ }
17944
+ }
17945
+ },
17946
+ "pushwoosh.rpc_v2.feature_flags.ListFeatureFlagsRequest": {
17947
+ "type": "I",
17948
+ "fields": {
17949
+ "applicationCode": {
17950
+ "type": "string"
17951
+ },
17952
+ "status": {
17953
+ "type": "string"
17954
+ }
17955
+ }
17956
+ },
17957
+ "pushwoosh.rpc_v2.feature_flags.ListFeatureFlagsResponse": {
17958
+ "type": "I",
17959
+ "fields": {
17960
+ "flags": {
17961
+ "type": "pushwoosh.rpc_v2.feature_flags.FeatureFlag",
17962
+ "array": true
17963
+ }
17964
+ }
17965
+ },
17966
+ "pushwoosh.rpc_v2.feature_flags.GetFeatureFlagRequest": {
17967
+ "type": "I",
17968
+ "fields": {
17969
+ "applicationCode": {
17970
+ "type": "string"
17971
+ },
17972
+ "key": {
17973
+ "type": "string"
17974
+ }
17975
+ }
17976
+ },
17977
+ "pushwoosh.rpc_v2.feature_flags.GetFeatureFlagResponse": {
17978
+ "type": "I",
17979
+ "fields": {
17980
+ "flag": {
17981
+ "type": "pushwoosh.rpc_v2.feature_flags.FeatureFlag"
17982
+ }
17983
+ }
17984
+ },
17985
+ "pushwoosh.rpc_v2.feature_flags.CreateFeatureFlagRequest": {
17986
+ "type": "I",
17987
+ "fields": {
17988
+ "applicationCode": {
17989
+ "type": "string"
17990
+ },
17991
+ "key": {
17992
+ "type": "string"
17993
+ },
17994
+ "name": {
17995
+ "type": "string"
17996
+ },
17997
+ "description": {
17998
+ "type": "string"
17999
+ },
18000
+ "properties": {
18001
+ "type": "pushwoosh.rpc_v2.feature_flags.FeatureFlagProperty",
18002
+ "array": true
18003
+ },
18004
+ "defaults": {
18005
+ "type": "object"
18006
+ },
18007
+ "rules": {
18008
+ "type": "pushwoosh.rpc_v2.feature_flags.FeatureFlagRule",
18009
+ "array": true
18010
+ }
18011
+ }
18012
+ },
18013
+ "pushwoosh.rpc_v2.feature_flags.CreateFeatureFlagResponse": {
18014
+ "type": "I",
18015
+ "fields": {
18016
+ "flag": {
18017
+ "type": "pushwoosh.rpc_v2.feature_flags.FeatureFlag"
18018
+ }
18019
+ }
18020
+ },
18021
+ "pushwoosh.rpc_v2.feature_flags.UpdateFeatureFlagRequest": {
18022
+ "type": "I",
18023
+ "fields": {
18024
+ "applicationCode": {
18025
+ "type": "string"
18026
+ },
18027
+ "key": {
18028
+ "type": "string"
18029
+ },
18030
+ "version": {
18031
+ "type": "number"
18032
+ },
18033
+ "name": {
18034
+ "type": "string"
18035
+ },
18036
+ "description": {
18037
+ "type": "string"
18038
+ },
18039
+ "properties": {
18040
+ "type": "pushwoosh.rpc_v2.feature_flags.FeatureFlagProperty",
18041
+ "array": true
18042
+ },
18043
+ "defaults": {
18044
+ "type": "object"
18045
+ },
18046
+ "rules": {
18047
+ "type": "pushwoosh.rpc_v2.feature_flags.FeatureFlagRule",
18048
+ "array": true
18049
+ }
18050
+ }
18051
+ },
18052
+ "pushwoosh.rpc_v2.feature_flags.UpdateFeatureFlagResponse": {
18053
+ "type": "I",
18054
+ "fields": {
18055
+ "flag": {
18056
+ "type": "pushwoosh.rpc_v2.feature_flags.FeatureFlag"
18057
+ }
18058
+ }
18059
+ },
18060
+ "pushwoosh.rpc_v2.feature_flags.SetFeatureFlagRulePercentRequest": {
18061
+ "type": "I",
18062
+ "fields": {
18063
+ "applicationCode": {
18064
+ "type": "string"
18065
+ },
18066
+ "key": {
18067
+ "type": "string"
18068
+ },
18069
+ "ruleId": {
18070
+ "type": "string"
18071
+ },
18072
+ "percentBp": {
18073
+ "type": "number"
18074
+ },
18075
+ "version": {
18076
+ "type": "number"
18077
+ }
18078
+ }
18079
+ },
18080
+ "pushwoosh.rpc_v2.feature_flags.SetFeatureFlagRulePercentResponse": {
18081
+ "type": "I",
18082
+ "fields": {
18083
+ "flag": {
18084
+ "type": "pushwoosh.rpc_v2.feature_flags.FeatureFlag"
18085
+ }
18086
+ }
18087
+ },
18088
+ "pushwoosh.rpc_v2.feature_flags.KillFeatureFlagRequest": {
18089
+ "type": "I",
18090
+ "fields": {
18091
+ "applicationCode": {
18092
+ "type": "string"
18093
+ },
18094
+ "key": {
18095
+ "type": "string"
18096
+ }
18097
+ }
18098
+ },
18099
+ "pushwoosh.rpc_v2.feature_flags.KillFeatureFlagResponse": {
18100
+ "type": "I",
18101
+ "fields": {
18102
+ "flag": {
18103
+ "type": "pushwoosh.rpc_v2.feature_flags.FeatureFlag"
18104
+ }
18105
+ }
18106
+ },
18107
+ "pushwoosh.rpc_v2.feature_flags.UnkillFeatureFlagRequest": {
18108
+ "type": "I",
18109
+ "fields": {
18110
+ "applicationCode": {
18111
+ "type": "string"
18112
+ },
18113
+ "key": {
18114
+ "type": "string"
18115
+ }
18116
+ }
18117
+ },
18118
+ "pushwoosh.rpc_v2.feature_flags.UnkillFeatureFlagResponse": {
18119
+ "type": "I",
18120
+ "fields": {
18121
+ "flag": {
18122
+ "type": "pushwoosh.rpc_v2.feature_flags.FeatureFlag"
18123
+ }
18124
+ }
18125
+ },
18126
+ "pushwoosh.rpc_v2.feature_flags.ArchiveFeatureFlagRequest": {
18127
+ "type": "I",
18128
+ "fields": {
18129
+ "applicationCode": {
18130
+ "type": "string"
18131
+ },
18132
+ "key": {
18133
+ "type": "string"
18134
+ }
18135
+ }
18136
+ },
18137
+ "pushwoosh.rpc_v2.feature_flags.ArchiveFeatureFlagResponse": {
18138
+ "type": "I",
18139
+ "fields": {
18140
+ "flag": {
18141
+ "type": "pushwoosh.rpc_v2.feature_flags.FeatureFlag"
18142
+ }
18143
+ }
18144
+ },
18145
+ "pushwoosh.rpc_v2.feature_flags.RestoreFeatureFlagRequest": {
18146
+ "type": "I",
18147
+ "fields": {
18148
+ "applicationCode": {
18149
+ "type": "string"
18150
+ },
18151
+ "key": {
18152
+ "type": "string"
18153
+ }
18154
+ }
18155
+ },
18156
+ "pushwoosh.rpc_v2.feature_flags.RestoreFeatureFlagResponse": {
18157
+ "type": "I",
18158
+ "fields": {
18159
+ "flag": {
18160
+ "type": "pushwoosh.rpc_v2.feature_flags.FeatureFlag"
18161
+ }
18162
+ }
18163
+ },
18164
+ "pushwoosh.rpc_v2.feature_flags.ReshuffleFeatureFlagRequest": {
18165
+ "type": "I",
18166
+ "fields": {
18167
+ "applicationCode": {
18168
+ "type": "string"
18169
+ },
18170
+ "key": {
18171
+ "type": "string"
18172
+ },
18173
+ "confirm": {
18174
+ "type": "boolean"
18175
+ },
18176
+ "version": {
18177
+ "type": "number"
18178
+ }
18179
+ }
18180
+ },
18181
+ "pushwoosh.rpc_v2.feature_flags.ReshuffleFeatureFlagResponse": {
18182
+ "type": "I",
18183
+ "fields": {
18184
+ "flag": {
18185
+ "type": "pushwoosh.rpc_v2.feature_flags.FeatureFlag"
18186
+ }
18187
+ }
18188
+ },
17733
18189
  "pushwoosh.rpc_v2.filters.FiltersService": {
17734
18190
  "type": "S",
17735
18191
  "key": "filters",
@@ -32974,7 +33430,8 @@ export const data = {
32974
33430
  "FILTER_EXPRESSION_HIGH_SPEED_NO_DAYS_AGO",
32975
33431
  "FILTER_EXPRESSION_INVALID_COUNTRY_TAG_VALUE",
32976
33432
  "FILTER_EXPRESSION_INVALID_LANGUAGE_TAG_VALUE",
32977
- "FILTER_EXPRESSION_EXTERNAL_SEGMENT_NOT_ALLOWED"
33433
+ "FILTER_EXPRESSION_EXTERNAL_SEGMENT_NOT_ALLOWED",
33434
+ "FILTER_EXPRESSION_FEATURE_FLAG_NOT_ALLOWED"
32978
33435
  ],
32979
33436
  "valuesArgs": {
32980
33437
  "NAME_TOO_LONG": [
@@ -0,0 +1,313 @@
1
+ import { RpcMethod } from './commonTypes';
2
+ export type FeatureFlagsService_FieldViolations = {
3
+ reason: 'FV_UNSPECIFIED';
4
+ field: string;
5
+ description: string;
6
+ } | {
7
+ reason: 'KEY_INVALID';
8
+ field: string;
9
+ description: string;
10
+ args: {
11
+ pattern: string;
12
+ };
13
+ } | {
14
+ reason: 'KEY_TAKEN';
15
+ field: string;
16
+ description: string;
17
+ args: {
18
+ key: string;
19
+ };
20
+ } | {
21
+ reason: 'TEXT_INVALID';
22
+ field: string;
23
+ description: string;
24
+ } | {
25
+ reason: 'PROPERTIES_LIMIT';
26
+ field: string;
27
+ description: string;
28
+ args: {
29
+ max: string;
30
+ };
31
+ } | {
32
+ reason: 'PROPERTY_KEY_INVALID';
33
+ field: string;
34
+ description: string;
35
+ } | {
36
+ reason: 'PROPERTY_TYPE_INVALID';
37
+ field: string;
38
+ description: string;
39
+ } | {
40
+ reason: 'PROPERTY_TYPE_IMMUTABLE';
41
+ field: string;
42
+ description: string;
43
+ args: {
44
+ key: string;
45
+ };
46
+ } | {
47
+ reason: 'VALUE_INVALID';
48
+ field: string;
49
+ description: string;
50
+ } | {
51
+ reason: 'PROPERTIES_TOO_LARGE';
52
+ field: string;
53
+ description: string;
54
+ args: {
55
+ size: string;
56
+ };
57
+ } | {
58
+ reason: 'RULES_LIMIT';
59
+ field: string;
60
+ description: string;
61
+ args: {
62
+ max: string;
63
+ };
64
+ } | {
65
+ reason: 'RULE_NOT_FOUND';
66
+ field: string;
67
+ description: string;
68
+ args: {
69
+ rule_id: string;
70
+ };
71
+ } | {
72
+ reason: 'PERCENT_INVALID';
73
+ field: string;
74
+ description: string;
75
+ } | {
76
+ reason: 'OVERRIDE_UNKNOWN_PROPERTY';
77
+ field: string;
78
+ description: string;
79
+ args: {
80
+ key: string;
81
+ };
82
+ } | {
83
+ reason: 'SEGMENT_NOT_FOUND';
84
+ field: string;
85
+ description: string;
86
+ args: {
87
+ filter_code: string;
88
+ };
89
+ } | {
90
+ reason: 'INVALID_SEGMENT_TYPE';
91
+ field: string;
92
+ description: string;
93
+ args: {
94
+ leaf: string;
95
+ };
96
+ } | {
97
+ reason: 'FLAG_DEPENDENCY';
98
+ field: string;
99
+ description: string;
100
+ args: {
101
+ filter_code: string;
102
+ };
103
+ } | {
104
+ reason: 'CONFIRM_REQUIRED';
105
+ field: string;
106
+ description: string;
107
+ } | {
108
+ reason: 'TAG_CONFLICT';
109
+ field: string;
110
+ description: string;
111
+ args: {
112
+ tag: string;
113
+ };
114
+ };
115
+ export type FeatureFlagsService_FailedPreconditions = {
116
+ type: 'FP_UNSPECIFIED';
117
+ description: string;
118
+ } | {
119
+ type: 'FEATURE_FLAGS_NOT_ALLOWED';
120
+ description: string;
121
+ } | {
122
+ type: 'FLAGS_LIMIT';
123
+ description: string;
124
+ } | {
125
+ type: 'VERSION_CONFLICT';
126
+ description: string;
127
+ } | {
128
+ type: 'PAYLOAD_TOO_LARGE';
129
+ description: string;
130
+ } | {
131
+ type: 'STATUS_CONFLICT';
132
+ description: string;
133
+ };
134
+ export type FeatureFlagsService_List = RpcMethod<ListFeatureFlagsRequest, ListFeatureFlagsResponse>;
135
+ export type FeatureFlagsService_Get = RpcMethod<GetFeatureFlagRequest, GetFeatureFlagResponse>;
136
+ export type FeatureFlagsService_Create = RpcMethod<CreateFeatureFlagRequest, CreateFeatureFlagResponse>;
137
+ export type FeatureFlagsService_Update = RpcMethod<UpdateFeatureFlagRequest, UpdateFeatureFlagResponse>;
138
+ export type FeatureFlagsService_SetRulePercent = RpcMethod<SetFeatureFlagRulePercentRequest, SetFeatureFlagRulePercentResponse>;
139
+ export type FeatureFlagsService_Kill = RpcMethod<KillFeatureFlagRequest, KillFeatureFlagResponse>;
140
+ export type FeatureFlagsService_Unkill = RpcMethod<UnkillFeatureFlagRequest, UnkillFeatureFlagResponse>;
141
+ export type FeatureFlagsService_Archive = RpcMethod<ArchiveFeatureFlagRequest, ArchiveFeatureFlagResponse>;
142
+ export type FeatureFlagsService_Restore = RpcMethod<RestoreFeatureFlagRequest, RestoreFeatureFlagResponse>;
143
+ export type FeatureFlagsService_Reshuffle = RpcMethod<ReshuffleFeatureFlagRequest, ReshuffleFeatureFlagResponse>;
144
+ /**
145
+ * Feature flags: remotely configured switches and properties an application reads through the SDK.
146
+ *
147
+ * A flag is identified by its application and key. Rules are evaluated in order; the first rule
148
+ * whose segment matches the device decides, and its percent_bp rolls the flag out to that share of users.
149
+ * Every write that carries a form takes the version the caller read and fails with VERSION_CONFLICT
150
+ * when the flag changed since. Kill, Unkill, Archive and Restore change only the status.
151
+ */
152
+ export interface FeatureFlagsService {
153
+ /** Lists the feature flags of an application, optionally only those in the given status. Use to see which flags exist before reading or changing one. */
154
+ List: FeatureFlagsService_List;
155
+ /** Returns one feature flag with its properties, rules and the version to send back with the next change. */
156
+ Get: FeatureFlagsService_Get;
157
+ /** Creates an active feature flag with its properties and ordered rules. Rule ids are generated by the server. Rule segments may hold only tag, geo, application and list conditions. */
158
+ Create: FeatureFlagsService_Create;
159
+ /** Replaces the name, description, properties and rules of a flag; the status is never changed here. Send the version from the last read; a changed flag is refused with VERSION_CONFLICT. Rules keep their rule_id; a rule without one is new. */
160
+ Update: FeatureFlagsService_Update;
161
+ /** Changes the rollout percentage of one rule. Users already in the rollout stay in it when the percentage grows. Send the version from the last read. */
162
+ SetRulePercent: FeatureFlagsService_SetRulePercent;
163
+ /** Kill switch: turns the flag off for every device, which then gets the default property values. Rules and properties are kept; unkill restores them. */
164
+ Kill: FeatureFlagsService_Kill;
165
+ /** Turns a killed flag back on with its rules as they were. */
166
+ Unkill: FeatureFlagsService_Unkill;
167
+ /** Archives a flag: devices stop receiving it and it no longer counts against the plan limit. The key stays reserved. */
168
+ Archive: FeatureFlagsService_Archive;
169
+ /** Brings an archived flag back as killed, so it never turns on by itself; unkill it to roll it out again. */
170
+ Restore: FeatureFlagsService_Restore;
171
+ /** Draws a new salt, so every user lands in a new bucket and the rollout picks a different sample. Requires confirm=true and the version from the last read. */
172
+ Reshuffle: FeatureFlagsService_Reshuffle;
173
+ }
174
+ export type FeatureFlagProperty = {
175
+ /** Property key, ^[A-Za-z0-9_]{1,64}$, unique within the flag. */
176
+ key: string;
177
+ /** One of string, number, boolean, json. Cannot change once the property exists. */
178
+ type: string;
179
+ };
180
+ export type FeatureFlagRule = {
181
+ /** Server-generated id (r_ followed by 8 hex digits), stable across updates. Leave empty for a new rule. */
182
+ ruleId: string;
183
+ name: string;
184
+ /** Segment code the device must match; empty means every device. */
185
+ filterCode: string;
186
+ /** Share of matching users the flag is on for, in basis points: 0..10000. */
187
+ percentBp: number;
188
+ /** Property values that replace the defaults for devices this rule turns on, keyed by property key. */
189
+ overrides: object;
190
+ };
191
+ export type FeatureFlag = {
192
+ applicationCode: string;
193
+ key: string;
194
+ name: string;
195
+ description: string;
196
+ /** One of active, killed, archived. */
197
+ status: string;
198
+ properties: FeatureFlagProperty[];
199
+ /** Value of every property for devices the flag is off for, keyed by property key. */
200
+ defaults: object;
201
+ rules: FeatureFlagRule[];
202
+ /** Send back with Update, SetRulePercent and Reshuffle. */
203
+ version: number;
204
+ created: Date;
205
+ updated: Date;
206
+ lastModifiedByUserId: number;
207
+ };
208
+ export type ListFeatureFlagsRequest = {
209
+ /** Application code (XXXXX-XXXXX). */
210
+ applicationCode?: string;
211
+ /** Keep only flags in this status: active, killed or archived. Empty lists all. */
212
+ status?: string;
213
+ };
214
+ export type ListFeatureFlagsResponse = {
215
+ flags: FeatureFlag[];
216
+ };
217
+ export type GetFeatureFlagRequest = {
218
+ /** Application code (XXXXX-XXXXX). */
219
+ applicationCode?: string;
220
+ key?: string;
221
+ };
222
+ export type GetFeatureFlagResponse = {
223
+ flag: FeatureFlag;
224
+ };
225
+ export type CreateFeatureFlagRequest = {
226
+ /** Application code (XXXXX-XXXXX). */
227
+ applicationCode?: string;
228
+ /** ^[A-Za-z0-9_.-]{1,58}$, unique in the application including archived flags. */
229
+ key?: string;
230
+ name?: string;
231
+ description?: string;
232
+ properties?: FeatureFlagProperty[];
233
+ /** Value of every property for devices the flag is off for, keyed by property key. Each value must match the property type. */
234
+ defaults?: object;
235
+ /** Ordered rules, at most 10. */
236
+ rules?: FeatureFlagRule[];
237
+ };
238
+ export type CreateFeatureFlagResponse = {
239
+ flag: FeatureFlag;
240
+ };
241
+ export type UpdateFeatureFlagRequest = {
242
+ /** Application code (XXXXX-XXXXX). */
243
+ applicationCode?: string;
244
+ key?: string;
245
+ /** Version from the last read of the flag. */
246
+ version?: number;
247
+ name?: string;
248
+ description?: string;
249
+ properties?: FeatureFlagProperty[];
250
+ /** Value of every property for devices the flag is off for, keyed by property key. */
251
+ defaults?: object;
252
+ rules?: FeatureFlagRule[];
253
+ };
254
+ export type UpdateFeatureFlagResponse = {
255
+ flag: FeatureFlag;
256
+ };
257
+ export type SetFeatureFlagRulePercentRequest = {
258
+ /** Application code (XXXXX-XXXXX). */
259
+ applicationCode?: string;
260
+ key?: string;
261
+ ruleId?: string;
262
+ /** 0..10000 basis points. */
263
+ percentBp?: number;
264
+ /** Version from the last read of the flag. */
265
+ version?: number;
266
+ };
267
+ export type SetFeatureFlagRulePercentResponse = {
268
+ flag: FeatureFlag;
269
+ };
270
+ export type KillFeatureFlagRequest = {
271
+ /** Application code (XXXXX-XXXXX). */
272
+ applicationCode?: string;
273
+ key?: string;
274
+ };
275
+ export type KillFeatureFlagResponse = {
276
+ flag: FeatureFlag;
277
+ };
278
+ export type UnkillFeatureFlagRequest = {
279
+ /** Application code (XXXXX-XXXXX). */
280
+ applicationCode?: string;
281
+ key?: string;
282
+ };
283
+ export type UnkillFeatureFlagResponse = {
284
+ flag: FeatureFlag;
285
+ };
286
+ export type ArchiveFeatureFlagRequest = {
287
+ /** Application code (XXXXX-XXXXX). */
288
+ applicationCode?: string;
289
+ key?: string;
290
+ };
291
+ export type ArchiveFeatureFlagResponse = {
292
+ flag: FeatureFlag;
293
+ };
294
+ export type RestoreFeatureFlagRequest = {
295
+ /** Application code (XXXXX-XXXXX). */
296
+ applicationCode?: string;
297
+ key?: string;
298
+ };
299
+ export type RestoreFeatureFlagResponse = {
300
+ flag: FeatureFlag;
301
+ };
302
+ export type ReshuffleFeatureFlagRequest = {
303
+ /** Application code (XXXXX-XXXXX). */
304
+ applicationCode?: string;
305
+ key?: string;
306
+ /** Must be true: a reshuffle moves users between the on and off groups. */
307
+ confirm?: boolean;
308
+ /** Version from the last read of the flag. */
309
+ version?: number;
310
+ };
311
+ export type ReshuffleFeatureFlagResponse = {
312
+ flag: FeatureFlag;
313
+ };
@@ -0,0 +1,3 @@
1
+ /* eslint-disable */
2
+ /* Autogenerated code */
3
+ export {};
package/index.d.ts CHANGED
@@ -36,6 +36,7 @@ import { EmailsConfigurationsService as pushwoosh_rpc_v2_emails_configurations_E
36
36
  import { EventsService as pushwoosh_rpc_v2_events_EventsService } from './events';
37
37
  import { ExportStatisticsService as pushwoosh_rpc_v2_export_messages_ExportStatisticsService } from './export_messages';
38
38
  import { ExternalSegmentsService as pushwoosh_rpc_external_segments_v3_ExternalSegmentsService } from './pushwoosh_rpc_external_segments_v3';
39
+ import { FeatureFlagsService as pushwoosh_rpc_v2_feature_flags_FeatureFlagsService } from './feature_flags';
39
40
  import { FiltersService as pushwoosh_rpc_v2_filters_FiltersService } from './filters';
40
41
  import { FrequencyCappingService as pushwoosh_rpc_v2_frequency_capping_FrequencyCappingService } from './frequency_capping';
41
42
  import { FrequencyCappingDisabledUsersService as pushwoosh_rpc_frequency_capping_disabled_users_v3_FrequencyCappingDisabledUsersService } from './pushwoosh_rpc_frequency_capping_disabled_users_v3';
@@ -114,6 +115,7 @@ export type API = {
114
115
  events: pushwoosh_rpc_v2_events_EventsService;
115
116
  exportStatistics: pushwoosh_rpc_v2_export_messages_ExportStatisticsService;
116
117
  externalSegments: pushwoosh_rpc_external_segments_v3_ExternalSegmentsService;
118
+ featureFlags: pushwoosh_rpc_v2_feature_flags_FeatureFlagsService;
117
119
  filters: pushwoosh_rpc_v2_filters_FiltersService;
118
120
  frequencyCapping: pushwoosh_rpc_v2_frequency_capping_FrequencyCappingService;
119
121
  frequencyCappingDisabledUsers: pushwoosh_rpc_frequency_capping_disabled_users_v3_FrequencyCappingDisabledUsersService;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pushwoosh/rpc-v2-http-api-data",
3
- "version": "0.2.376",
3
+ "version": "0.2.378",
4
4
  "description": "RPC V2 HTTP API Types and Data",
5
5
  "main": "index.js",
6
6
  "module": "index.js",
@@ -82,6 +82,10 @@ export type SegmentsService_Create_FieldViolations = {
82
82
  reason: 'FILTER_EXPRESSION_EXTERNAL_SEGMENT_NOT_ALLOWED';
83
83
  field: string;
84
84
  description: string;
85
+ } | {
86
+ reason: 'FILTER_EXPRESSION_FEATURE_FLAG_NOT_ALLOWED';
87
+ field: string;
88
+ description: string;
85
89
  };
86
90
  export type SegmentsService_Delete_FailedPreconditions = {
87
91
  type: 'FP_DELETE_UNSPECIFIED';