@flagshark/core 1.0.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.
- package/dist/detection/config-adapter.d.ts +16 -0
- package/dist/detection/config-adapter.d.ts.map +1 -0
- package/dist/detection/config-adapter.js +60 -0
- package/dist/detection/config-adapter.js.map +1 -0
- package/dist/detection/detectors/cpp.d.ts +17 -0
- package/dist/detection/detectors/cpp.d.ts.map +1 -0
- package/dist/detection/detectors/cpp.js +113 -0
- package/dist/detection/detectors/cpp.js.map +1 -0
- package/dist/detection/detectors/csharp.d.ts +17 -0
- package/dist/detection/detectors/csharp.d.ts.map +1 -0
- package/dist/detection/detectors/csharp.js +258 -0
- package/dist/detection/detectors/csharp.js.map +1 -0
- package/dist/detection/detectors/go.d.ts +17 -0
- package/dist/detection/detectors/go.d.ts.map +1 -0
- package/dist/detection/detectors/go.js +319 -0
- package/dist/detection/detectors/go.js.map +1 -0
- package/dist/detection/detectors/index.d.ts +14 -0
- package/dist/detection/detectors/index.d.ts.map +1 -0
- package/dist/detection/detectors/index.js +14 -0
- package/dist/detection/detectors/index.js.map +1 -0
- package/dist/detection/detectors/java.d.ts +17 -0
- package/dist/detection/detectors/java.d.ts.map +1 -0
- package/dist/detection/detectors/java.js +264 -0
- package/dist/detection/detectors/java.js.map +1 -0
- package/dist/detection/detectors/javascript.d.ts +18 -0
- package/dist/detection/detectors/javascript.d.ts.map +1 -0
- package/dist/detection/detectors/javascript.js +32 -0
- package/dist/detection/detectors/javascript.js.map +1 -0
- package/dist/detection/detectors/kotlin.d.ts +17 -0
- package/dist/detection/detectors/kotlin.d.ts.map +1 -0
- package/dist/detection/detectors/kotlin.js +210 -0
- package/dist/detection/detectors/kotlin.js.map +1 -0
- package/dist/detection/detectors/objectivec.d.ts +17 -0
- package/dist/detection/detectors/objectivec.d.ts.map +1 -0
- package/dist/detection/detectors/objectivec.js +244 -0
- package/dist/detection/detectors/objectivec.js.map +1 -0
- package/dist/detection/detectors/php.d.ts +17 -0
- package/dist/detection/detectors/php.d.ts.map +1 -0
- package/dist/detection/detectors/php.js +210 -0
- package/dist/detection/detectors/php.js.map +1 -0
- package/dist/detection/detectors/python.d.ts +17 -0
- package/dist/detection/detectors/python.d.ts.map +1 -0
- package/dist/detection/detectors/python.js +284 -0
- package/dist/detection/detectors/python.js.map +1 -0
- package/dist/detection/detectors/ruby.d.ts +17 -0
- package/dist/detection/detectors/ruby.d.ts.map +1 -0
- package/dist/detection/detectors/ruby.js +259 -0
- package/dist/detection/detectors/ruby.js.map +1 -0
- package/dist/detection/detectors/rust.d.ts +17 -0
- package/dist/detection/detectors/rust.d.ts.map +1 -0
- package/dist/detection/detectors/rust.js +159 -0
- package/dist/detection/detectors/rust.js.map +1 -0
- package/dist/detection/detectors/swift.d.ts +17 -0
- package/dist/detection/detectors/swift.d.ts.map +1 -0
- package/dist/detection/detectors/swift.js +229 -0
- package/dist/detection/detectors/swift.js.map +1 -0
- package/dist/detection/detectors/typescript.d.ts +17 -0
- package/dist/detection/detectors/typescript.d.ts.map +1 -0
- package/dist/detection/detectors/typescript.js +350 -0
- package/dist/detection/detectors/typescript.js.map +1 -0
- package/dist/detection/feature-flag.d.ts +16 -0
- package/dist/detection/feature-flag.d.ts.map +1 -0
- package/dist/detection/feature-flag.js +2 -0
- package/dist/detection/feature-flag.js.map +1 -0
- package/dist/detection/helpers.d.ts +51 -0
- package/dist/detection/helpers.d.ts.map +1 -0
- package/dist/detection/helpers.js +266 -0
- package/dist/detection/helpers.js.map +1 -0
- package/dist/detection/index.d.ts +19 -0
- package/dist/detection/index.d.ts.map +1 -0
- package/dist/detection/index.js +53 -0
- package/dist/detection/index.js.map +1 -0
- package/dist/detection/interface.d.ts +76 -0
- package/dist/detection/interface.d.ts.map +1 -0
- package/dist/detection/interface.js +25 -0
- package/dist/detection/interface.js.map +1 -0
- package/dist/detection/polyglot-analyzer.d.ts +83 -0
- package/dist/detection/polyglot-analyzer.d.ts.map +1 -0
- package/dist/detection/polyglot-analyzer.js +245 -0
- package/dist/detection/polyglot-analyzer.js.map +1 -0
- package/dist/detection/registry.d.ts +31 -0
- package/dist/detection/registry.d.ts.map +1 -0
- package/dist/detection/registry.js +68 -0
- package/dist/detection/registry.js.map +1 -0
- package/dist/detection/yaml-config.d.ts +333 -0
- package/dist/detection/yaml-config.d.ts.map +1 -0
- package/dist/detection/yaml-config.js +215 -0
- package/dist/detection/yaml-config.js.map +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +9 -0
- package/dist/index.js.map +1 -0
- package/dist/scan-repo.d.ts +67 -0
- package/dist/scan-repo.d.ts.map +1 -0
- package/dist/scan-repo.js +55 -0
- package/dist/scan-repo.js.map +1 -0
- package/dist/scanner.d.ts +18 -0
- package/dist/scanner.d.ts.map +1 -0
- package/dist/scanner.js +108 -0
- package/dist/scanner.js.map +1 -0
- package/dist/staleness.d.ts +30 -0
- package/dist/staleness.d.ts.map +1 -0
- package/dist/staleness.js +217 -0
- package/dist/staleness.js.map +1 -0
- package/package.json +37 -0
|
@@ -0,0 +1,259 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Ruby language feature flag detector.
|
|
3
|
+
* Ported from Go: internal/languages/ruby/detector.go
|
|
4
|
+
*/
|
|
5
|
+
import { detectFlagsWithRegex } from '../helpers.js';
|
|
6
|
+
import { Languages } from '../interface.js';
|
|
7
|
+
export class RubyDetector {
|
|
8
|
+
providers;
|
|
9
|
+
constructor(providers) {
|
|
10
|
+
this.providers = providers ?? defaultRubyProviders();
|
|
11
|
+
}
|
|
12
|
+
language() {
|
|
13
|
+
return Languages.Ruby;
|
|
14
|
+
}
|
|
15
|
+
fileExtensions() {
|
|
16
|
+
return ['.rb', '.rake', '.gemspec'];
|
|
17
|
+
}
|
|
18
|
+
supportsFile(filename) {
|
|
19
|
+
const lower = filename.toLowerCase();
|
|
20
|
+
const ext = lower.split('.').pop();
|
|
21
|
+
if (['rb', 'rake', 'gemspec'].includes(ext ?? '')) {
|
|
22
|
+
return true;
|
|
23
|
+
}
|
|
24
|
+
// Also check for Rakefile, Gemfile, etc.
|
|
25
|
+
const baseName = lower.split('/').pop() ?? '';
|
|
26
|
+
return baseName === 'rakefile' || baseName === 'gemfile';
|
|
27
|
+
}
|
|
28
|
+
detectFlags(filename, content) {
|
|
29
|
+
return detectFlagsWithRegex(filename, content, this.language(), this.providers);
|
|
30
|
+
}
|
|
31
|
+
getProviders() {
|
|
32
|
+
return this.providers;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
export function defaultRubyProviders() {
|
|
36
|
+
return [
|
|
37
|
+
{
|
|
38
|
+
name: 'LaunchDarkly Ruby SDK',
|
|
39
|
+
importPattern: 'launchdarkly-server-sdk',
|
|
40
|
+
description: 'LaunchDarkly Ruby SDK',
|
|
41
|
+
enabled: true,
|
|
42
|
+
methods: [
|
|
43
|
+
{
|
|
44
|
+
name: 'variation',
|
|
45
|
+
flagKeyIndex: 0,
|
|
46
|
+
examples: ['client.variation("flag-key", context, default_value)'],
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
name: 'variation_detail',
|
|
50
|
+
flagKeyIndex: 0,
|
|
51
|
+
examples: ['client.variation_detail("flag-key", context, default_value)'],
|
|
52
|
+
},
|
|
53
|
+
],
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
name: 'Unleash Ruby SDK',
|
|
57
|
+
importPattern: 'unleash',
|
|
58
|
+
description: 'Unleash Ruby SDK',
|
|
59
|
+
enabled: true,
|
|
60
|
+
methods: [
|
|
61
|
+
{
|
|
62
|
+
name: 'is_enabled?',
|
|
63
|
+
flagKeyIndex: 0,
|
|
64
|
+
examples: ['UNLEASH.is_enabled?("feature-toggle")'],
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
name: 'enabled?',
|
|
68
|
+
flagKeyIndex: 0,
|
|
69
|
+
examples: ['UNLEASH.enabled?("feature-toggle", context)'],
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
name: 'get_variant',
|
|
73
|
+
flagKeyIndex: 0,
|
|
74
|
+
examples: ['UNLEASH.get_variant("feature-toggle", context)'],
|
|
75
|
+
},
|
|
76
|
+
],
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
name: 'Split.io Ruby SDK',
|
|
80
|
+
importPattern: 'splitclient-rb',
|
|
81
|
+
description: 'Split.io Ruby SDK',
|
|
82
|
+
enabled: true,
|
|
83
|
+
methods: [
|
|
84
|
+
{
|
|
85
|
+
name: 'get_treatment',
|
|
86
|
+
flagKeyIndex: 1,
|
|
87
|
+
examples: ['client.get_treatment(key, "split-name")'],
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
name: 'get_treatments',
|
|
91
|
+
flagKeyIndex: 1,
|
|
92
|
+
examples: ['client.get_treatments(key, ["split1", "split2"])'],
|
|
93
|
+
},
|
|
94
|
+
],
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
name: 'Flipper',
|
|
98
|
+
importPattern: 'flipper',
|
|
99
|
+
description: 'Flipper feature flags for Ruby',
|
|
100
|
+
enabled: true,
|
|
101
|
+
methods: [
|
|
102
|
+
{ name: 'enabled?', flagKeyIndex: 0, examples: ['Flipper.enabled?(:feature_name)'] },
|
|
103
|
+
{ name: 'disabled?', flagKeyIndex: 0, examples: ['Flipper.disabled?(:feature_name)'] },
|
|
104
|
+
],
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
name: 'Optimizely Ruby SDK',
|
|
108
|
+
importPattern: 'optimizely-sdk',
|
|
109
|
+
description: 'Optimizely Feature Experimentation Ruby SDK',
|
|
110
|
+
enabled: true,
|
|
111
|
+
methods: [
|
|
112
|
+
{ name: 'decide', flagKeyIndex: 0, examples: ['user.decide("flag-key")'] },
|
|
113
|
+
{
|
|
114
|
+
name: 'is_feature_enabled',
|
|
115
|
+
flagKeyIndex: 0,
|
|
116
|
+
examples: ['optimizely.is_feature_enabled("feature-key", user_id)'],
|
|
117
|
+
},
|
|
118
|
+
],
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
name: 'Flagsmith Ruby SDK',
|
|
122
|
+
importPattern: 'flagsmith',
|
|
123
|
+
description: 'Flagsmith Ruby SDK',
|
|
124
|
+
enabled: true,
|
|
125
|
+
methods: [
|
|
126
|
+
{
|
|
127
|
+
name: 'is_feature_enabled',
|
|
128
|
+
flagKeyIndex: 0,
|
|
129
|
+
examples: ['flags.is_feature_enabled("feature-name")'],
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
name: 'get_feature_value',
|
|
133
|
+
flagKeyIndex: 0,
|
|
134
|
+
examples: ['flags.get_feature_value("feature-name")'],
|
|
135
|
+
},
|
|
136
|
+
],
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
name: 'ConfigCat Ruby SDK',
|
|
140
|
+
importPattern: 'configcat',
|
|
141
|
+
description: 'ConfigCat Ruby SDK',
|
|
142
|
+
enabled: true,
|
|
143
|
+
methods: [
|
|
144
|
+
{
|
|
145
|
+
name: 'get_value',
|
|
146
|
+
flagKeyIndex: 0,
|
|
147
|
+
examples: ['client.get_value("flag-key", default_value)'],
|
|
148
|
+
},
|
|
149
|
+
],
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
name: 'Statsig Ruby SDK',
|
|
153
|
+
importPattern: 'statsig',
|
|
154
|
+
description: 'Statsig Ruby SDK',
|
|
155
|
+
enabled: true,
|
|
156
|
+
methods: [
|
|
157
|
+
{
|
|
158
|
+
name: 'check_gate',
|
|
159
|
+
flagKeyIndex: 1,
|
|
160
|
+
examples: ['Statsig.check_gate(user, "gate-name")'],
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
name: 'get_experiment',
|
|
164
|
+
flagKeyIndex: 1,
|
|
165
|
+
examples: ['Statsig.get_experiment(user, "experiment-name")'],
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
name: 'get_config',
|
|
169
|
+
flagKeyIndex: 1,
|
|
170
|
+
examples: ['Statsig.get_config(user, "config-name")'],
|
|
171
|
+
},
|
|
172
|
+
],
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
name: 'GrowthBook Ruby SDK',
|
|
176
|
+
importPattern: 'growthbook',
|
|
177
|
+
description: 'GrowthBook Ruby SDK',
|
|
178
|
+
enabled: true,
|
|
179
|
+
methods: [
|
|
180
|
+
{ name: 'on?', flagKeyIndex: 0, examples: ['gb.on?(:feature_key)'] },
|
|
181
|
+
{
|
|
182
|
+
name: 'feature_value',
|
|
183
|
+
flagKeyIndex: 0,
|
|
184
|
+
examples: ['gb.feature_value(:feature_key, fallback_value)'],
|
|
185
|
+
},
|
|
186
|
+
],
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
name: 'DevCycle Ruby SDK',
|
|
190
|
+
importPattern: 'devcycle-ruby-server-sdk',
|
|
191
|
+
description: 'DevCycle Ruby SDK',
|
|
192
|
+
enabled: true,
|
|
193
|
+
methods: [
|
|
194
|
+
{
|
|
195
|
+
name: 'variable_value',
|
|
196
|
+
flagKeyIndex: 1,
|
|
197
|
+
examples: ['client.variable_value(user, "variable-key", default_value)'],
|
|
198
|
+
},
|
|
199
|
+
{ name: 'variable', flagKeyIndex: 1, examples: ['client.variable(user, "variable-key")'] },
|
|
200
|
+
],
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
name: 'Eppo Ruby SDK',
|
|
204
|
+
importPattern: 'eppo_client',
|
|
205
|
+
description: 'Eppo Ruby SDK',
|
|
206
|
+
enabled: true,
|
|
207
|
+
methods: [
|
|
208
|
+
{
|
|
209
|
+
name: 'get_boolean_assignment',
|
|
210
|
+
flagKeyIndex: 0,
|
|
211
|
+
examples: ['eppo_client.get_boolean_assignment("flag-key", subject_key, default_value)'],
|
|
212
|
+
},
|
|
213
|
+
{
|
|
214
|
+
name: 'get_string_assignment',
|
|
215
|
+
flagKeyIndex: 0,
|
|
216
|
+
examples: ['eppo_client.get_string_assignment("flag-key", subject_key, default_value)'],
|
|
217
|
+
},
|
|
218
|
+
],
|
|
219
|
+
},
|
|
220
|
+
{
|
|
221
|
+
name: 'PostHog Ruby SDK',
|
|
222
|
+
importPattern: 'posthog-ruby',
|
|
223
|
+
description: 'PostHog Ruby SDK',
|
|
224
|
+
enabled: true,
|
|
225
|
+
methods: [
|
|
226
|
+
{
|
|
227
|
+
name: 'is_feature_enabled',
|
|
228
|
+
flagKeyIndex: 0,
|
|
229
|
+
examples: ['posthog.is_feature_enabled("flag-key", distinct_id)'],
|
|
230
|
+
},
|
|
231
|
+
{
|
|
232
|
+
name: 'get_feature_flag',
|
|
233
|
+
flagKeyIndex: 0,
|
|
234
|
+
examples: ['posthog.get_feature_flag("flag-key", distinct_id)'],
|
|
235
|
+
},
|
|
236
|
+
{
|
|
237
|
+
name: 'get_feature_flag_payload',
|
|
238
|
+
flagKeyIndex: 0,
|
|
239
|
+
examples: ['posthog.get_feature_flag_payload("flag-key", distinct_id)'],
|
|
240
|
+
},
|
|
241
|
+
],
|
|
242
|
+
},
|
|
243
|
+
{
|
|
244
|
+
name: 'Custom Feature Flags',
|
|
245
|
+
description: 'Common custom Ruby feature flag patterns',
|
|
246
|
+
enabled: true,
|
|
247
|
+
methods: [
|
|
248
|
+
{
|
|
249
|
+
name: 'feature_enabled?',
|
|
250
|
+
flagKeyIndex: 0,
|
|
251
|
+
examples: ['feature_enabled?("feature-name")'],
|
|
252
|
+
},
|
|
253
|
+
{ name: 'enabled?', flagKeyIndex: 0, examples: ['enabled?("feature-name")'] },
|
|
254
|
+
{ name: 'has_feature?', flagKeyIndex: 0, examples: ['has_feature?("feature-name")'] },
|
|
255
|
+
],
|
|
256
|
+
},
|
|
257
|
+
];
|
|
258
|
+
}
|
|
259
|
+
//# sourceMappingURL=ruby.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ruby.js","sourceRoot":"","sources":["../../../src/detection/detectors/ruby.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,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AAQ,EAAE,CAAC,2EAA2E,CAAC;iBACxF;aACF;SACF;QACD;YACE,IAAI,EAAE,kBAAkB;YACxB,aAAa,EAAE,cAAc;YAC7B,WAAW,EAAE,kBAAkB;YAC/B,OAAO,EAAE,IAAI;YACb,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,oBAAoB;oBAC1B,YAAY,EAAE,CAAC;oBACf,QAAQ,EAAE,CAAC,qDAAqD,CAAC;iBAClE;gBACD;oBACE,IAAI,EAAE,kBAAkB;oBACxB,YAAY,EAAE,CAAC;oBACf,QAAQ,EAAE,CAAC,mDAAmD,CAAC;iBAChE;gBACD;oBACE,IAAI,EAAE,0BAA0B;oBAChC,YAAY,EAAE,CAAC;oBACf,QAAQ,EAAE,CAAC,2DAA2D,CAAC;iBACxE;aACF;SACF;QACD;YACE,IAAI,EAAE,sBAAsB;YAC5B,WAAW,EAAE,0CAA0C;YACvD,OAAO,EAAE,IAAI;YACb,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,kBAAkB;oBACxB,YAAY,EAAE,CAAC;oBACf,QAAQ,EAAE,CAAC,kCAAkC,CAAC;iBAC/C;gBACD,EAAE,IAAI,EAAE,UAAU,EAAE,YAAY,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,0BAA0B,CAAC,EAAE;gBAC7E,EAAE,IAAI,EAAE,cAAc,EAAE,YAAY,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,8BAA8B,CAAC,EAAE;aACtF;SACF;KACF,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Rust language feature flag detector.
|
|
3
|
+
* Ported from Go: internal/languages/rust/detector.go
|
|
4
|
+
*/
|
|
5
|
+
import type { FeatureFlag } from '../feature-flag.js';
|
|
6
|
+
import type { FeatureFlagProvider, Language, LanguageDetector } from '../interface.js';
|
|
7
|
+
export declare class RustDetector implements LanguageDetector {
|
|
8
|
+
private readonly providers;
|
|
9
|
+
constructor(providers?: FeatureFlagProvider[]);
|
|
10
|
+
language(): Language;
|
|
11
|
+
fileExtensions(): string[];
|
|
12
|
+
supportsFile(filename: string): boolean;
|
|
13
|
+
detectFlags(filename: string, content: string): FeatureFlag[];
|
|
14
|
+
getProviders(): FeatureFlagProvider[];
|
|
15
|
+
}
|
|
16
|
+
export declare function defaultRustProviders(): FeatureFlagProvider[];
|
|
17
|
+
//# sourceMappingURL=rust.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rust.d.ts","sourceRoot":"","sources":["../../../src/detection/detectors/rust.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AACrD,OAAO,KAAK,EAAE,mBAAmB,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AAEtF,qBAAa,YAAa,YAAW,gBAAgB;IACnD,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAuB;gBAErC,SAAS,CAAC,EAAE,mBAAmB,EAAE;IAI7C,QAAQ,IAAI,QAAQ;IAIpB,cAAc,IAAI,MAAM,EAAE;IAI1B,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO;IAIvC,WAAW,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,WAAW,EAAE;IAI7D,YAAY,IAAI,mBAAmB,EAAE;CAGtC;AAED,wBAAgB,oBAAoB,IAAI,mBAAmB,EAAE,CAkI5D"}
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Rust language feature flag detector.
|
|
3
|
+
* Ported from Go: internal/languages/rust/detector.go
|
|
4
|
+
*/
|
|
5
|
+
import { detectFlagsWithRegex } from '../helpers.js';
|
|
6
|
+
import { Languages } from '../interface.js';
|
|
7
|
+
export class RustDetector {
|
|
8
|
+
providers;
|
|
9
|
+
constructor(providers) {
|
|
10
|
+
this.providers = providers ?? defaultRustProviders();
|
|
11
|
+
}
|
|
12
|
+
language() {
|
|
13
|
+
return Languages.Rust;
|
|
14
|
+
}
|
|
15
|
+
fileExtensions() {
|
|
16
|
+
return ['.rs'];
|
|
17
|
+
}
|
|
18
|
+
supportsFile(filename) {
|
|
19
|
+
return filename.toLowerCase().endsWith('.rs');
|
|
20
|
+
}
|
|
21
|
+
detectFlags(filename, content) {
|
|
22
|
+
return detectFlagsWithRegex(filename, content, this.language(), this.providers);
|
|
23
|
+
}
|
|
24
|
+
getProviders() {
|
|
25
|
+
return this.providers;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
export function defaultRustProviders() {
|
|
29
|
+
return [
|
|
30
|
+
{
|
|
31
|
+
name: 'LaunchDarkly Rust SDK',
|
|
32
|
+
importPattern: 'launchdarkly_server_sdk',
|
|
33
|
+
description: 'LaunchDarkly Rust Server SDK',
|
|
34
|
+
enabled: true,
|
|
35
|
+
methods: [
|
|
36
|
+
{
|
|
37
|
+
name: 'bool_variation',
|
|
38
|
+
flagKeyIndex: 1,
|
|
39
|
+
examples: ['client.bool_variation(&context, "flag-key", false)'],
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
name: 'string_variation',
|
|
43
|
+
flagKeyIndex: 1,
|
|
44
|
+
examples: ['client.string_variation(&context, "flag-key", "default".to_string())'],
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
name: 'int_variation',
|
|
48
|
+
flagKeyIndex: 1,
|
|
49
|
+
examples: ['client.int_variation(&context, "flag-key", 0)'],
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
name: 'float_variation',
|
|
53
|
+
flagKeyIndex: 1,
|
|
54
|
+
examples: ['client.float_variation(&context, "flag-key", 0.0)'],
|
|
55
|
+
},
|
|
56
|
+
],
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
name: 'Unleash Rust SDK',
|
|
60
|
+
importPattern: 'unleash_api_client',
|
|
61
|
+
description: 'Unleash Rust SDK',
|
|
62
|
+
enabled: true,
|
|
63
|
+
methods: [
|
|
64
|
+
{
|
|
65
|
+
name: 'is_enabled',
|
|
66
|
+
flagKeyIndex: 0,
|
|
67
|
+
examples: ['client.is_enabled("feature-toggle", None, false)'],
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
name: 'get_variant',
|
|
71
|
+
flagKeyIndex: 0,
|
|
72
|
+
examples: ['client.get_variant("feature-toggle", None)'],
|
|
73
|
+
},
|
|
74
|
+
],
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
name: 'Flagsmith Rust SDK',
|
|
78
|
+
importPattern: 'flagsmith',
|
|
79
|
+
description: 'Flagsmith Rust SDK',
|
|
80
|
+
enabled: true,
|
|
81
|
+
methods: [
|
|
82
|
+
{
|
|
83
|
+
name: 'is_feature_enabled',
|
|
84
|
+
flagKeyIndex: 0,
|
|
85
|
+
examples: ['flags.is_feature_enabled("feature-name")'],
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
name: 'get_feature_value',
|
|
89
|
+
flagKeyIndex: 0,
|
|
90
|
+
examples: ['flags.get_feature_value("feature-name")'],
|
|
91
|
+
},
|
|
92
|
+
],
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
name: 'ConfigCat Rust SDK',
|
|
96
|
+
importPattern: 'configcat',
|
|
97
|
+
description: 'ConfigCat Rust SDK',
|
|
98
|
+
enabled: true,
|
|
99
|
+
methods: [
|
|
100
|
+
{
|
|
101
|
+
name: 'get_value',
|
|
102
|
+
flagKeyIndex: 0,
|
|
103
|
+
examples: ['client.get_value("flag-key", false, None).await'],
|
|
104
|
+
},
|
|
105
|
+
],
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
name: 'GrowthBook Rust SDK',
|
|
109
|
+
importPattern: 'growthbook',
|
|
110
|
+
description: 'GrowthBook Rust SDK',
|
|
111
|
+
enabled: true,
|
|
112
|
+
methods: [
|
|
113
|
+
{ name: 'is_on', flagKeyIndex: 0, examples: ['gb.is_on("feature-key")'] },
|
|
114
|
+
{
|
|
115
|
+
name: 'get_feature_value',
|
|
116
|
+
flagKeyIndex: 0,
|
|
117
|
+
examples: ['gb.get_feature_value("feature-key", fallback_value)'],
|
|
118
|
+
},
|
|
119
|
+
],
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
name: 'Eppo Rust SDK',
|
|
123
|
+
importPattern: 'eppo',
|
|
124
|
+
description: 'Eppo Rust SDK',
|
|
125
|
+
enabled: true,
|
|
126
|
+
methods: [
|
|
127
|
+
{
|
|
128
|
+
name: 'get_boolean_assignment',
|
|
129
|
+
flagKeyIndex: 0,
|
|
130
|
+
examples: [
|
|
131
|
+
'eppo_client.get_boolean_assignment("flag-key", &subject_key, &subject_attributes, default_value)',
|
|
132
|
+
],
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
name: 'get_string_assignment',
|
|
136
|
+
flagKeyIndex: 0,
|
|
137
|
+
examples: [
|
|
138
|
+
'eppo_client.get_string_assignment("flag-key", &subject_key, &subject_attributes, default_value)',
|
|
139
|
+
],
|
|
140
|
+
},
|
|
141
|
+
],
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
name: 'Custom Feature Flags',
|
|
145
|
+
description: 'Common custom Rust feature flag patterns',
|
|
146
|
+
enabled: true,
|
|
147
|
+
methods: [
|
|
148
|
+
{
|
|
149
|
+
name: 'is_feature_enabled',
|
|
150
|
+
flagKeyIndex: 0,
|
|
151
|
+
examples: ['is_feature_enabled("feature-name")'],
|
|
152
|
+
},
|
|
153
|
+
{ name: 'feature_enabled', flagKeyIndex: 0, examples: ['feature_enabled("feature-name")'] },
|
|
154
|
+
{ name: 'has_feature', flagKeyIndex: 0, examples: ['has_feature("feature-name")'] },
|
|
155
|
+
],
|
|
156
|
+
},
|
|
157
|
+
];
|
|
158
|
+
}
|
|
159
|
+
//# sourceMappingURL=rust.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rust.js","sourceRoot":"","sources":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yBAAyB,CAAC,EAAE;gBACzE;oBACE,IAAI,EAAE,mBAAmB;oBACzB,YAAY,EAAE,CAAC;oBACf,QAAQ,EAAE,CAAC,qDAAqD,CAAC;iBAClE;aACF;SACF;QACD;YACE,IAAI,EAAE,eAAe;YACrB,aAAa,EAAE,MAAM;YACrB,WAAW,EAAE,eAAe;YAC5B,OAAO,EAAE,IAAI;YACb,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,wBAAwB;oBAC9B,YAAY,EAAE,CAAC;oBACf,QAAQ,EAAE;wBACR,kGAAkG;qBACnG;iBACF;gBACD;oBACE,IAAI,EAAE,uBAAuB;oBAC7B,YAAY,EAAE,CAAC;oBACf,QAAQ,EAAE;wBACR,iGAAiG;qBAClG;iBACF;aACF;SACF;QACD;YACE,IAAI,EAAE,sBAAsB;YAC5B,WAAW,EAAE,0CAA0C;YACvD,OAAO,EAAE,IAAI;YACb,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,oBAAoB;oBAC1B,YAAY,EAAE,CAAC;oBACf,QAAQ,EAAE,CAAC,oCAAoC,CAAC;iBACjD;gBACD,EAAE,IAAI,EAAE,iBAAiB,EAAE,YAAY,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,iCAAiC,CAAC,EAAE;gBAC3F,EAAE,IAAI,EAAE,aAAa,EAAE,YAAY,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,6BAA6B,CAAC,EAAE;aACpF;SACF;KACF,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Swift language feature flag detector.
|
|
3
|
+
* Ported from Go: internal/languages/swift/detector.go
|
|
4
|
+
*/
|
|
5
|
+
import type { FeatureFlag } from '../feature-flag.js';
|
|
6
|
+
import type { FeatureFlagProvider, Language, LanguageDetector } from '../interface.js';
|
|
7
|
+
export declare class SwiftDetector implements LanguageDetector {
|
|
8
|
+
private readonly providers;
|
|
9
|
+
constructor(providers?: FeatureFlagProvider[]);
|
|
10
|
+
language(): Language;
|
|
11
|
+
fileExtensions(): string[];
|
|
12
|
+
supportsFile(filename: string): boolean;
|
|
13
|
+
detectFlags(filename: string, content: string): FeatureFlag[];
|
|
14
|
+
getProviders(): FeatureFlagProvider[];
|
|
15
|
+
}
|
|
16
|
+
export declare function defaultSwiftProviders(): FeatureFlagProvider[];
|
|
17
|
+
//# sourceMappingURL=swift.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"swift.d.ts","sourceRoot":"","sources":["../../../src/detection/detectors/swift.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AACrD,OAAO,KAAK,EAAE,mBAAmB,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AAEtF,qBAAa,aAAc,YAAW,gBAAgB;IACpD,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAuB;gBAErC,SAAS,CAAC,EAAE,mBAAmB,EAAE;IAI7C,QAAQ,IAAI,QAAQ;IAIpB,cAAc,IAAI,MAAM,EAAE;IAI1B,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO;IAIvC,WAAW,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,WAAW,EAAE;IAI7D,YAAY,IAAI,mBAAmB,EAAE;CAGtC;AAED,wBAAgB,qBAAqB,IAAI,mBAAmB,EAAE,CAwM7D"}
|