@sponson/adapters 0.4.0 → 0.6.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.
Files changed (129) hide show
  1. package/README.md +1 -1
  2. package/dist/algolia.d.ts +6 -0
  3. package/dist/algolia.js +151 -0
  4. package/dist/algolia.js.map +1 -0
  5. package/dist/clerk.js +1 -1
  6. package/dist/clerk.js.map +1 -1
  7. package/dist/cloud_run.d.ts +12 -0
  8. package/dist/cloud_run.js +469 -0
  9. package/dist/cloud_run.js.map +1 -0
  10. package/dist/cloudflare.d.ts +25 -0
  11. package/dist/cloudflare.js +310 -0
  12. package/dist/cloudflare.js.map +1 -0
  13. package/dist/common.d.ts +2 -6
  14. package/dist/common.js.map +1 -1
  15. package/dist/digest.d.ts +46 -0
  16. package/dist/digest.js +129 -0
  17. package/dist/digest.js.map +1 -0
  18. package/dist/digitalocean.d.ts +5 -0
  19. package/dist/digitalocean.js +243 -0
  20. package/dist/digitalocean.js.map +1 -0
  21. package/dist/http-adapter-action.d.ts +63 -0
  22. package/dist/http-adapter-action.js +369 -0
  23. package/dist/http-adapter-action.js.map +1 -0
  24. package/dist/http-adapter-auth.d.ts +94 -0
  25. package/dist/http-adapter-auth.js +440 -0
  26. package/dist/http-adapter-auth.js.map +1 -0
  27. package/dist/http-adapter-client.d.ts +57 -0
  28. package/dist/http-adapter-client.js +163 -0
  29. package/dist/http-adapter-client.js.map +1 -0
  30. package/dist/http-adapter-graphql.d.ts +39 -0
  31. package/dist/http-adapter-graphql.js +157 -0
  32. package/dist/http-adapter-graphql.js.map +1 -0
  33. package/dist/http-adapter-list.d.ts +33 -0
  34. package/dist/http-adapter-list.js +421 -0
  35. package/dist/http-adapter-list.js.map +1 -0
  36. package/dist/http-adapter-resource.d.ts +29 -0
  37. package/dist/http-adapter-resource.js +462 -0
  38. package/dist/http-adapter-resource.js.map +1 -0
  39. package/dist/http-adapter-spec.d.ts +216 -0
  40. package/dist/http-adapter-spec.js +660 -0
  41. package/dist/http-adapter-spec.js.map +1 -0
  42. package/dist/http-adapter.d.ts +16 -0
  43. package/dist/http-adapter.js +28 -0
  44. package/dist/http-adapter.js.map +1 -0
  45. package/dist/http.d.ts +61 -2
  46. package/dist/http.js +79 -18
  47. package/dist/http.js.map +1 -1
  48. package/dist/index.d.ts +13 -0
  49. package/dist/index.js +26 -2
  50. package/dist/index.js.map +1 -1
  51. package/dist/launchdarkly.d.ts +15 -0
  52. package/dist/launchdarkly.js +337 -0
  53. package/dist/launchdarkly.js.map +1 -0
  54. package/dist/manual.d.ts +13 -0
  55. package/dist/manual.js +201 -0
  56. package/dist/manual.js.map +1 -0
  57. package/dist/neon.js +1 -1
  58. package/dist/neon.js.map +1 -1
  59. package/dist/netlify.d.ts +18 -0
  60. package/dist/netlify.js +436 -0
  61. package/dist/netlify.js.map +1 -0
  62. package/dist/planetscale.d.ts +10 -0
  63. package/dist/planetscale.js +311 -0
  64. package/dist/planetscale.js.map +1 -0
  65. package/dist/providers.d.ts +28 -0
  66. package/dist/providers.js +41 -0
  67. package/dist/providers.js.map +1 -0
  68. package/dist/recipes.d.ts +167 -0
  69. package/dist/recipes.js +246 -0
  70. package/dist/recipes.js.map +1 -0
  71. package/dist/secrets.d.ts +44 -0
  72. package/dist/secrets.js +279 -0
  73. package/dist/secrets.js.map +1 -1
  74. package/dist/sigv4.d.ts +56 -0
  75. package/dist/sigv4.js +118 -0
  76. package/dist/sigv4.js.map +1 -0
  77. package/dist/supabase.d.ts +9 -0
  78. package/dist/supabase.js +385 -0
  79. package/dist/supabase.js.map +1 -0
  80. package/dist/vercel.js +1 -1
  81. package/dist/vercel.js.map +1 -1
  82. package/dist/xata.d.ts +8 -0
  83. package/dist/xata.js +142 -0
  84. package/dist/xata.js.map +1 -0
  85. package/dist/xml.d.ts +25 -0
  86. package/dist/xml.js +211 -0
  87. package/dist/xml.js.map +1 -0
  88. package/package.json +11 -4
  89. package/recipes/amplify.yaml +147 -0
  90. package/recipes/auth0.yaml +178 -0
  91. package/recipes/azure_swa.yaml +116 -0
  92. package/recipes/cloudflare.yaml +108 -0
  93. package/recipes/cockroachdb.yaml +132 -0
  94. package/recipes/configcat.yaml +123 -0
  95. package/recipes/datadog.yaml +136 -0
  96. package/recipes/firebase.yaml +84 -0
  97. package/recipes/flagsmith.yaml +98 -0
  98. package/recipes/fly.yaml +97 -0
  99. package/recipes/fly_machines.yaml +67 -0
  100. package/recipes/gcs.yaml +102 -0
  101. package/recipes/github.yaml +124 -0
  102. package/recipes/growthbook.yaml +124 -0
  103. package/recipes/heroku.yaml +98 -0
  104. package/recipes/honeycomb.yaml +89 -0
  105. package/recipes/inngest.yaml +97 -0
  106. package/recipes/kinde.yaml +120 -0
  107. package/recipes/mongodb_atlas.yaml +119 -0
  108. package/recipes/okta.yaml +177 -0
  109. package/recipes/posthog.yaml +127 -0
  110. package/recipes/postmark.yaml +105 -0
  111. package/recipes/postmark_server.yaml +93 -0
  112. package/recipes/prisma.yaml +150 -0
  113. package/recipes/qstash.yaml +134 -0
  114. package/recipes/railway.yaml +130 -0
  115. package/recipes/render.yaml +103 -0
  116. package/recipes/resend.yaml +130 -0
  117. package/recipes/s3.yaml +108 -0
  118. package/recipes/sendgrid.yaml +165 -0
  119. package/recipes/sentry.yaml +158 -0
  120. package/recipes/split.yaml +121 -0
  121. package/recipes/statsig.yaml +124 -0
  122. package/recipes/stripe.yaml +310 -0
  123. package/recipes/stytch.yaml +113 -0
  124. package/recipes/svix.yaml +109 -0
  125. package/recipes/turso.yaml +98 -0
  126. package/recipes/unleash.yaml +149 -0
  127. package/recipes/upstash.yaml +130 -0
  128. package/recipes/vercel.yaml +116 -0
  129. package/recipes/workos.yaml +70 -0
@@ -0,0 +1,158 @@
1
+ # yaml-language-server: $schema=../../../schema/recipe.schema.json
2
+ # Sentry Web API recipes. Format and checklist: docs/adr/0020-recipes.md, CONTRIBUTING.md "Adding a recipe".
3
+ provider: sentry
4
+ title: Sentry
5
+ category: observability
6
+ verified_on: "2026-10-11"
7
+ docs:
8
+ - title: Create a New Release for an Organization
9
+ url: https://docs.sentry.io/api/releases/create-a-new-release-for-an-organization/
10
+ - title: Retrieve an Organization's Release
11
+ url: https://docs.sentry.io/api/releases/retrieve-an-organizations-release/
12
+ - title: Update an Organization's Release
13
+ url: https://docs.sentry.io/api/releases/update-an-organizations-release/
14
+ - title: Delete an Organization's Release
15
+ url: https://docs.sentry.io/api/releases/delete-an-organizations-release/
16
+ - title: Create a Deploy
17
+ url: https://docs.sentry.io/api/releases/create-a-deploy/
18
+ - title: List a Release's Deploys
19
+ url: https://docs.sentry.io/api/releases/list-a-releases-deploys/
20
+ - title: Release Management (sentry-cli)
21
+ url: https://docs.sentry.io/cli/releases/
22
+ api:
23
+ base_url: https://sentry.io/api/0
24
+ base_url_env: SENTRY_API_URL
25
+ auth: { bearer_env: SENTRY_AUTH_TOKEN }
26
+ detect:
27
+ deps: ["@sentry/"]
28
+ env: ["SENTRY_*"]
29
+ files: [sentry.client.config.ts, sentry.client.config.js, sentry.server.config.ts, sentry.server.config.js, sentry.properties, .sentryclirc]
30
+ starter:
31
+ - op: release
32
+ values: { version: "app@${ctx.git.sha}" }
33
+ where:
34
+ organization: "Sentry → Settings → Organization Settings → Organization Slug"
35
+ project: "Sentry → Settings → Projects: the project's slug"
36
+ assumptions:
37
+ - id: SE1
38
+ verified: true
39
+ text: "`POST /api/0/organizations/{organization_id_or_slug}/releases/` creates a release from `version` and `projects` (both required), `ref`, `url`, `dateReleased` and commit data, with a bearer token holding `project:releases`, `project:write`, `project:admin` or `org:ci`; it answers 201 (or 208)."
40
+ source: https://docs.sentry.io/api/releases/create-a-new-release-for-an-organization/
41
+ - id: SE2
42
+ verified: true
43
+ text: "A version is one release across the organization's projects, and `GET /api/0/organizations/{org}/releases/{version}/` answers it (404 when there is none), so the version names the release."
44
+ source: https://docs.sentry.io/api/releases/retrieve-an-organizations-release/
45
+ - id: SE3
46
+ verified: true
47
+ text: "`PUT /api/0/organizations/{org}/releases/{version}/` updates `ref`, `url`, `dateReleased` and commit data (the documentation says an omitted `dateReleased` is the current time), and answers the release."
48
+ source: https://docs.sentry.io/api/releases/update-an-organizations-release/
49
+ - id: SE4
50
+ verified: true
51
+ text: "`DELETE /api/0/organizations/{org}/releases/{version}/` permanently removes a release and its files (`project:releases` or `project:admin`). The recipe keeps releases on destroy: one version is shared by every environment it is deployed to."
52
+ source: https://docs.sentry.io/api/releases/delete-an-organizations-release/
53
+ - id: SE5
54
+ verified: true
55
+ text: "`POST /api/0/organizations/{org}/releases/{version}/deploys/` records a deploy of the release from `environment` (required), `name`, `url`, `dateStarted`, `dateFinished` (default now) and `projects` (default: all of the release's)."
56
+ source: https://docs.sentry.io/api/releases/create-a-deploy/
57
+ - id: SE6
58
+ verified: true
59
+ text: "`GET /api/0/organizations/{org}/releases/{version}/deploys/` lists the release's deploys; deploys cannot be deleted, so the deploy op never deletes (`destroy: never`)."
60
+ source: https://docs.sentry.io/cli/releases/
61
+ - id: SE7
62
+ verified: true
63
+ text: "The release's `dateReleased` defaults to the current time on create, so a release this recipe creates is finalized at once."
64
+ source: https://docs.sentry.io/api/releases/create-a-new-release-for-an-organization/
65
+ - id: SE8
66
+ verified: false
67
+ text: "A create for a version that exists answers 208 with the existing release (not an error), so a release another tool made (sentry-cli in the build) is taken over without a second write; the recipe keeps it on destroy either way."
68
+ - id: SE9
69
+ verified: false
70
+ text: "The deploy list answers a bare array of `{ id, environment, name, url, dateStarted, dateFinished }` with string ids, all of a release's deploys on the first page; `environment` and `name` together identify the deploy this recipe recorded."
71
+ - id: SE10
72
+ verified: false
73
+ text: "Release `url` is answered as sent (null when unset); organizations hosted in another region (`de.sentry.io`) or self-hosted Sentry set `base_url` in the provider block."
74
+ ops:
75
+ release:
76
+ kind: resource
77
+ title: Release
78
+ summary: "A release for the commit, such as `app@${ctx.git.sha}`, in the given projects, finalized when created (SE7). Named by its version; a console edit of its URL is drift. Kept on destroy (shared history: preview and production deploy the same version); `destroy: delete` on the line removes it."
79
+ covers: [sentry-release]
80
+ destroy: keep
81
+ params:
82
+ organization:
83
+ type: string
84
+ required: true
85
+ description: The organization's slug or id.
86
+ example: acme
87
+ version:
88
+ type: string
89
+ required: true
90
+ pattern: "^[^/\\s]+$"
91
+ description: The release's version (no slashes or whitespace), such as `app@<sha>`.
92
+ example: "app@${ctx.git.sha}"
93
+ project:
94
+ type: string
95
+ required: true
96
+ description: The slug of the project the release belongs to (a release of several projects is a hand-written `http` line).
97
+ example: web
98
+ url:
99
+ type: string
100
+ description: A link for the release (its commit or build).
101
+ example: "https://github.com/acme/app/commit/${ctx.git.sha}"
102
+ ref:
103
+ type: string
104
+ description: A commit reference, sent on create.
105
+ http:
106
+ read: { path: "/organizations/{organization}/releases/{version}/" }
107
+ create:
108
+ path: "/organizations/{organization}/releases/"
109
+ body: { version: { param: version }, projects: [{ param: project }], ref: { param: ref } }
110
+ update: { method: PUT }
111
+ id_path: /version
112
+ fields:
113
+ url: { param: url }
114
+ sim:
115
+ id_from: version
116
+ live:
117
+ params: { organization: SPONSON_LIVE_SENTRY_ORG, project: SPONSON_LIVE_SENTRY_PROJECT }
118
+ deploy:
119
+ kind: resource
120
+ title: Deploy of a release to an environment
121
+ summary: "The record that a release was deployed to an environment (`preview`, named for the scope), which Sentry shows on the release and uses for deploy notifications. Located by environment and name among the release's deploys. Sentry has no way to change or delete a deploy, so nothing is compared for drift and destroy leaves it (`destroy: never`)."
122
+ covers: [sentry-release]
123
+ destroy: never
124
+ params:
125
+ organization:
126
+ type: string
127
+ required: true
128
+ description: The organization's slug or id.
129
+ example: acme
130
+ version:
131
+ type: string
132
+ required: true
133
+ pattern: "^[^/\\s]+$"
134
+ description: "The deployed release's version; the release must exist (`{ from: <release line>.id }` orders the lines)."
135
+ example: "app@${ctx.git.sha}"
136
+ environment:
137
+ type: string
138
+ required: true
139
+ description: The environment deployed to.
140
+ example: "${ctx.env}"
141
+ name:
142
+ type: string
143
+ required: true
144
+ description: The deploy's name, which with the environment identifies it among the release's deploys.
145
+ example: "sponson-${ctx.scope}"
146
+ url:
147
+ type: string
148
+ description: A link to the deployment (the preview URL), sent on create.
149
+ http:
150
+ find:
151
+ path: "/organizations/{organization}/releases/{version}/deploys/"
152
+ match: { environment: { param: environment }, name: { param: name } }
153
+ create:
154
+ path: "/organizations/{organization}/releases/{version}/deploys/"
155
+ body: { url: { param: url } }
156
+ delete: { path: "/organizations/{organization}/releases/{version}/deploys/{id}/" }
157
+ live:
158
+ params: { organization: SPONSON_LIVE_SENTRY_ORG, version: SPONSON_LIVE_SENTRY_VERSION }
@@ -0,0 +1,121 @@
1
+ # yaml-language-server: $schema=../../../schema/recipe.schema.json
2
+ # Split (Harness FME) Admin API recipes. Format and checklist: docs/adr/0020-recipes.md, CONTRIBUTING.md "Adding a recipe".
3
+ provider: split
4
+ title: Split (Harness FME)
5
+ category: flags
6
+ verified_on: "2026-10-11"
7
+ docs:
8
+ - title: Authentication
9
+ url: https://docs.split.io/reference/authentication
10
+ - title: Get feature flag definition in environment
11
+ url: https://docs.split.io/reference/get-feature-flag-definition-in-environment
12
+ - title: Full update feature flag definition in environment
13
+ url: https://docs.split.io/reference/full-update-feature-flag-definition-in-environment
14
+ - title: Feature flag definition, rule, condition, matcher
15
+ url: https://docs.split.io/reference/feature-flag-definition
16
+ - title: Matcher types
17
+ url: https://docs.split.io/reference/matcher-type
18
+ - title: API for Split admins after the move to Harness
19
+ url: https://developer.harness.io/docs/feature-management-experimentation/split-to-harness/api-for-split-admins/
20
+ api:
21
+ base_url: https://api.split.io/internal/api/v2
22
+ base_url_env: SPLIT_API_URL
23
+ auth: { bearer_env: SPLIT_ADMIN_API_KEY }
24
+ detect:
25
+ deps: ["@splitsoftware/"]
26
+ env: ["SPLIT_*"]
27
+ starter:
28
+ - op: targeting_rule
29
+ values: { match: "${ctx.scope}" }
30
+ where:
31
+ workspace_id: "Split → Admin settings → Projects: the project's id"
32
+ assumptions:
33
+ - id: SP1
34
+ verified: true
35
+ text: "The Admin API is at `https://api.split.io/internal/api/v2`, authenticated as `Authorization: Bearer` with a Split Admin API key (or a Harness PAT/SAT, accepted as Bearer on the non-deprecated endpoints). Host and paths are unchanged by the move to Harness; the workspace id is still Split's `wsId`."
36
+ source: https://developer.harness.io/docs/feature-management-experimentation/split-to-harness/api-for-split-admins/
37
+ - id: SP2
38
+ verified: true
39
+ text: "`GET /splits/ws/{wsId}/{featureFlagName}/environments/{environmentIdOrName}` answers the flag's definition in the environment bare: `treatments`, `defaultTreatment`, `baselineTreatment`, `trafficAllocation`, `rules`, `defaultRule` and read-only fields (`name`, `environment`, `trafficType`, times)."
40
+ source: https://docs.split.io/reference/get-feature-flag-definition-in-environment
41
+ - id: SP3
42
+ verified: true
43
+ text: "`PUT` on the same path replaces the definition with `treatments`, `defaultTreatment`, `baselineTreatment`, `trafficAllocation`, `rules` and `defaultRule` (the first three of the required fields). Those are sent as read, with the rule list changed (`parent.send`); whether PUT takes the read-only fields back is not documented, so they are not sent."
44
+ source: https://docs.split.io/reference/full-update-feature-flag-definition-in-environment
45
+ - id: SP4
46
+ verified: true
47
+ text: "A rule is `{ condition: { combiner: AND, matchers: [...] }, buckets: [{ treatment, size }] }` (bucket sizes sum to 100); rules have no id and are evaluated in order. `IN_LIST_STRING` with `attribute` and `strings` matches an attribute in a list."
48
+ source: https://docs.split.io/reference/matcher-type
49
+ - id: SP5
50
+ verified: false
51
+ text: "A rule is read back with its matcher exactly as written (no added `negate: false` or null members); otherwise every plan shows the rule as changed."
52
+ - id: SP6
53
+ verified: false
54
+ text: "A full update leaves the flag's killed state alone (`killed` is not a documented PUT field)."
55
+ - id: SP7
56
+ verified: true
57
+ text: "In a project that requires a title and comment on changes, they are query parameters of the update; this recipe does not send them, so such a project refuses the write and the apply fails."
58
+ source: https://developer.harness.io/docs/feature-management-experimentation/api/feature-flags/
59
+ ops:
60
+ targeting_rule:
61
+ kind: list_item
62
+ title: Feature flag targeting rule
63
+ summary: "A targeting rule on a feature flag's definition in one environment that serves a treatment to the preview, such as `if preview is in list [pr-42] serve on`. Added after the flag's other rules (evaluated in order: an earlier matching rule wins); the treatments, default rule and traffic allocation are written back as read. Identified by the matched value; a console edit of its matcher or treatment is drift. Destroy removes the rule."
64
+ covers: [split-rule]
65
+ params:
66
+ workspace_id:
67
+ type: string
68
+ required: true
69
+ description: The workspace (project) id, Split's `wsId`.
70
+ example: a3b6f5d0-0e8f-11ee-9b0f-0242ac120002
71
+ flag:
72
+ type: string
73
+ required: true
74
+ description: The feature flag's name.
75
+ example: new_checkout
76
+ environment:
77
+ type: string
78
+ required: true
79
+ description: The environment's id or name; the flag must have a definition there.
80
+ example: Staging
81
+ attribute:
82
+ type: string
83
+ required: true
84
+ description: The attribute the rule tests (passed with the evaluation).
85
+ example: preview
86
+ match:
87
+ type: string
88
+ required: true
89
+ description: The attribute value that is the preview; it identifies the rule.
90
+ example: "${ctx.scope}"
91
+ treatment:
92
+ type: string
93
+ required: true
94
+ description: The treatment served to the preview; one of the flag's treatments.
95
+ example: "on"
96
+ http:
97
+ parent:
98
+ path: "/splits/ws/{workspace_id}/{flag}/environments/{environment}"
99
+ method: PUT
100
+ send: [treatments, defaultTreatment, baselineTreatment, trafficAllocation, defaultRule]
101
+ list_path: /rules
102
+ key_field: /condition/matchers/0/strings/0
103
+ item:
104
+ condition:
105
+ combiner: AND
106
+ matchers:
107
+ - type: IN_LIST_STRING
108
+ attribute: { param: attribute }
109
+ strings: [{ param: match }]
110
+ buckets: [{ treatment: { param: treatment }, size: 100 }]
111
+ sim:
112
+ objects:
113
+ "/splits/ws/{workspace_id}/{flag}/environments/{environment}":
114
+ treatments: [{ name: "on" }, { name: "off" }]
115
+ defaultTreatment: "off"
116
+ baselineTreatment: "off"
117
+ trafficAllocation: 100
118
+ rules: []
119
+ defaultRule: [{ treatment: "off", size: 100 }]
120
+ live:
121
+ params: { workspace_id: SPONSON_LIVE_SPLIT_WORKSPACE_ID, flag: SPONSON_LIVE_SPLIT_FLAG, environment: SPONSON_LIVE_SPLIT_ENVIRONMENT }
@@ -0,0 +1,124 @@
1
+ # yaml-language-server: $schema=../../../schema/recipe.schema.json
2
+ # Statsig Console API recipes. Format and checklist: docs/adr/0020-recipes.md, CONTRIBUTING.md "Adding a recipe".
3
+ provider: statsig
4
+ title: Statsig
5
+ category: flags
6
+ verified_on: "2026-10-11"
7
+ docs:
8
+ - title: Console API introduction (base URL, STATSIG-API-KEY, STATSIG-API-VERSION)
9
+ url: https://docs.statsig.com/console-api/introduction
10
+ - title: Add gate rule
11
+ url: https://docs.statsig.com/api-reference/gates/add-gate-rule
12
+ - title: Read gate rules
13
+ url: https://docs.statsig.com/api-reference/gates/read-gate-rules
14
+ - title: Update gate rules (one rule)
15
+ url: https://docs.statsig.com/api-reference/gates/update-gate-rules
16
+ - title: Delete gate rule
17
+ url: https://docs.statsig.com/api-reference/gates/delete-gate-rule
18
+ - title: Console API OpenAPI spec (20240601)
19
+ url: https://api.statsig.com/openapi/20240601.json
20
+ api:
21
+ base_url: https://statsigapi.net/console/v1
22
+ base_url_env: STATSIG_API_URL
23
+ auth: { header: STATSIG-API-KEY, value_env: STATSIG_CONSOLE_API_KEY }
24
+ headers: { STATSIG-API-VERSION: "20240601" }
25
+ detect:
26
+ deps: [statsig-js, statsig-node, statsig-react, "@statsig/"]
27
+ env: ["STATSIG_*"]
28
+ starter:
29
+ - op: gate_rule
30
+ values: { name: "preview ${ctx.scope}", values: ["${ctx.scope}"] }
31
+ where:
32
+ gate_id: "Statsig console → Feature Gates → your gate: its name in the URL"
33
+ assumptions:
34
+ - id: SG1
35
+ verified: true
36
+ text: "The Console API is at `https://statsigapi.net/console/v1`, authenticated with a Console API key in the `STATSIG-API-KEY` header; `STATSIG-API-VERSION: 20240601` (the only version) is optional today and announced as required later, so it is always sent."
37
+ source: https://docs.statsig.com/console-api/introduction
38
+ - id: SG2
39
+ verified: true
40
+ text: "`POST /gates/{id}/rule` (singular) adds one rule (`name`, `passPercentage`, `conditions`, `environments`) and answers `{ message, data: <the whole gate> }`, not the rule: the new rule is located by name afterwards (`create.locate`)."
41
+ source: https://docs.statsig.com/api-reference/gates/add-gate-rule
42
+ - id: SG3
43
+ verified: false
44
+ text: "`GET /gates/{id}/rules` answers the rules under `data.rules` (the documented example); the spec's schema says `data` is a list of `{ rules }` objects instead. If the API follows the schema, every read fails with PROVIDER_RESPONSE naming `find.list_path` (it does not create duplicates). The rules of one gate fit on the first page."
45
+ source: https://docs.statsig.com/api-reference/gates/read-gate-rules
46
+ - id: SG4
47
+ verified: true
48
+ text: "`PATCH /gates/{id}/rules/{ruleID}` updates the given fields of one rule; `DELETE` on the same path removes it. Rules carry a server-assigned `id`."
49
+ source: https://docs.statsig.com/api-reference/gates/update-gate-rules
50
+ - id: SG5
51
+ verified: false
52
+ text: "Rule names are unique within a gate (not documented): the rule is identified by its name, and two rules with that name are PARAM_INVALID rather than a guess."
53
+ - id: SG6
54
+ verified: false
55
+ text: "A rule is read back with `conditions` exactly as written (`type`, `operator`, `targetValue`, and `field` when sent). If Statsig adds keys such as `field: null` to a condition, every plan shows the rule as changed."
56
+ - id: SG7
57
+ verified: false
58
+ text: "DELETE of a rule that is already gone answers 404 (the spec lists only 200); any other answer fails the destroy rather than passing silently."
59
+ - id: SG8
60
+ verified: false
61
+ text: "On a gate that requires reviews, what a Console API rule write does (apply, fail, or open a pending review) is not documented; a write that does not take effect is seen on the next read as missing or changed, never as done."
62
+ source: https://docs.statsig.com/guides/setting-up-reviews
63
+ ops:
64
+ gate_rule:
65
+ kind: resource
66
+ title: Feature gate rule
67
+ summary: "A rule on an existing feature gate that passes the preview, such as `custom_field preview any [pr-42]`. Located by its name in the gate's rules; a console edit of its pass percentage, conditions or environments is drift. Destroy deletes the rule."
68
+ covers: [statsig-gate-rule]
69
+ params:
70
+ gate_id:
71
+ type: string
72
+ required: true
73
+ description: The gate's id (its name in the console URL).
74
+ example: new_checkout
75
+ name:
76
+ type: string
77
+ required: true
78
+ description: The rule's name, unique within the gate; it identifies the rule.
79
+ example: "preview ${ctx.scope}"
80
+ condition_type:
81
+ type: string
82
+ default: custom_field
83
+ enum: [custom_field, url, environment_tier, user_id, email]
84
+ description: "The condition's type: `custom_field` (with `field`), `url`, `environment_tier`, `user_id` or `email`."
85
+ field:
86
+ type: string
87
+ description: The custom field's name, for `condition_type` `custom_field`.
88
+ example: preview
89
+ operator:
90
+ type: string
91
+ default: any
92
+ description: "The condition's operator: `any`, `none`, `str_contains_any`, … (see the Statsig rule docs)."
93
+ values:
94
+ type: list
95
+ required: true
96
+ description: The values the condition matches (its `targetValue`).
97
+ example: ["${ctx.scope}"]
98
+ pass_percentage:
99
+ type: number
100
+ default: 100
101
+ description: The share of matching users that pass (0–100).
102
+ environment_names:
103
+ type: list
104
+ description: The environments the rule applies in (for example `[development, staging]`); all when left out.
105
+ http:
106
+ find:
107
+ path: "/gates/{gate_id}/rules"
108
+ list_path: /data/rules
109
+ match: { name: { param: name } }
110
+ create: { path: "/gates/{gate_id}/rule", locate: true }
111
+ update: { method: PATCH, path: "/gates/{gate_id}/rules/{id}" }
112
+ delete: { path: "/gates/{gate_id}/rules/{id}" }
113
+ fields:
114
+ passPercentage: { param: pass_percentage }
115
+ conditions:
116
+ - type: { param: condition_type }
117
+ field: { param: field }
118
+ operator: { param: operator }
119
+ targetValue: { param: values }
120
+ environments: { param: environment_names }
121
+ sim:
122
+ collection: "/gates/{gate_id}/rules"
123
+ live:
124
+ params: { gate_id: SPONSON_LIVE_STATSIG_GATE_ID }