@sylphx/sdk 0.28.0 → 0.31.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 (104) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +42 -114
  3. package/dist/access.d.ts +670 -0
  4. package/dist/access.js +640 -0
  5. package/dist/access.js.map +1 -0
  6. package/dist/ai.d.ts +176 -0
  7. package/dist/ai.js +112 -0
  8. package/dist/ai.js.map +1 -0
  9. package/dist/artifacts.d.ts +165 -0
  10. package/dist/artifacts.js +129 -0
  11. package/dist/artifacts.js.map +1 -0
  12. package/dist/auth/verify.d.ts +57 -0
  13. package/dist/auth/verify.js +157 -0
  14. package/dist/auth/verify.js.map +1 -0
  15. package/dist/auth.d.ts +896 -0
  16. package/dist/auth.js +828 -0
  17. package/dist/auth.js.map +1 -0
  18. package/dist/billing.d.ts +854 -0
  19. package/dist/billing.js +593 -0
  20. package/dist/billing.js.map +1 -0
  21. package/dist/broker.d.ts +226 -0
  22. package/dist/broker.js +187 -0
  23. package/dist/broker.js.map +1 -0
  24. package/dist/build.d.ts +313 -0
  25. package/dist/build.js +271 -0
  26. package/dist/build.js.map +1 -0
  27. package/dist/common.d.ts +162 -0
  28. package/dist/common.js +41 -0
  29. package/dist/common.js.map +1 -0
  30. package/dist/config.d.ts +198 -0
  31. package/dist/config.js +168 -0
  32. package/dist/config.js.map +1 -0
  33. package/dist/connections.d.ts +354 -0
  34. package/dist/connections.js +313 -0
  35. package/dist/connections.js.map +1 -0
  36. package/dist/data.d.ts +1141 -0
  37. package/dist/data.js +1082 -0
  38. package/dist/data.js.map +1 -0
  39. package/dist/entitlement.d.ts +179 -0
  40. package/dist/entitlement.js +117 -0
  41. package/dist/entitlement.js.map +1 -0
  42. package/dist/events.d.ts +1324 -0
  43. package/dist/events.js +1227 -0
  44. package/dist/events.js.map +1 -0
  45. package/dist/hosting.d.ts +709 -0
  46. package/dist/hosting.js +611 -0
  47. package/dist/hosting.js.map +1 -0
  48. package/dist/index.d.ts +79 -33656
  49. package/dist/index.js +113 -0
  50. package/dist/index.js.map +1 -0
  51. package/dist/keys.d.ts +438 -0
  52. package/dist/keys.js +406 -0
  53. package/dist/keys.js.map +1 -0
  54. package/dist/methods.d.ts +2 -0
  55. package/dist/methods.js +4200 -0
  56. package/dist/methods.js.map +1 -0
  57. package/dist/network.d.ts +733 -0
  58. package/dist/network.js +711 -0
  59. package/dist/network.js.map +1 -0
  60. package/dist/notify.d.ts +1753 -0
  61. package/dist/notify.js +1551 -0
  62. package/dist/notify.js.map +1 -0
  63. package/dist/observability.d.ts +509 -0
  64. package/dist/observability.js +437 -0
  65. package/dist/observability.js.map +1 -0
  66. package/dist/release.d.ts +303 -0
  67. package/dist/release.js +214 -0
  68. package/dist/release.js.map +1 -0
  69. package/dist/runners.d.ts +262 -0
  70. package/dist/runners.js +238 -0
  71. package/dist/runners.js.map +1 -0
  72. package/dist/runtime.d.ts +121 -0
  73. package/dist/runtime.js +305 -0
  74. package/dist/runtime.js.map +1 -0
  75. package/dist/sandboxes.d.ts +1705 -0
  76. package/dist/sandboxes.js +1226 -0
  77. package/dist/sandboxes.js.map +1 -0
  78. package/dist/secrets.d.ts +508 -0
  79. package/dist/secrets.js +474 -0
  80. package/dist/secrets.js.map +1 -0
  81. package/dist/workflows.d.ts +678 -0
  82. package/dist/workflows.js +595 -0
  83. package/dist/workflows.js.map +1 -0
  84. package/package.json +33 -112
  85. package/dist/connect.d.ts +0 -2838
  86. package/dist/connect.mjs +0 -220
  87. package/dist/connect.mjs.map +0 -1
  88. package/dist/health/index.d.ts +0 -1394
  89. package/dist/health/index.mjs +0 -1394
  90. package/dist/health/index.mjs.map +0 -1
  91. package/dist/index.mjs +0 -38429
  92. package/dist/index.mjs.map +0 -1
  93. package/dist/nextjs/index.d.ts +0 -724
  94. package/dist/nextjs/index.mjs +0 -3332
  95. package/dist/nextjs/index.mjs.map +0 -1
  96. package/dist/react/index.d.ts +0 -13066
  97. package/dist/react/index.mjs +0 -35329
  98. package/dist/react/index.mjs.map +0 -1
  99. package/dist/server/index.d.ts +0 -2000
  100. package/dist/server/index.mjs +0 -3446
  101. package/dist/server/index.mjs.map +0 -1
  102. package/dist/web-analytics.d.ts +0 -90
  103. package/dist/web-analytics.mjs +0 -225
  104. package/dist/web-analytics.mjs.map +0 -1
@@ -0,0 +1,162 @@
1
+ /**
2
+ * Condition is one observation a controller makes about a Resource
3
+ * (kstatus: `Ready`, `Reconciling`, `Stalled`). A Resource is settled when
4
+ * `status.observed_generation == meta.generation` and `Reconciling` is not
5
+ * TRUE; it is healthy when settled and `Ready` is TRUE.
6
+ */
7
+ export interface Condition {
8
+ /** The condition type, for example `Ready`. */
9
+ type?: string;
10
+ /** Whether the condition holds. */
11
+ status?: ConditionStatus;
12
+ /** The generation this observation was made against. */
13
+ observedGeneration?: string;
14
+ /** A machine-readable UpperCamelCase reason. */
15
+ reason?: string;
16
+ /** A customer-safe human-readable message. */
17
+ message?: string;
18
+ /** How severe a FALSE condition is. */
19
+ severity?: Severity;
20
+ /** When `status` last changed. */
21
+ transitionTime?: string;
22
+ }
23
+ /**
24
+ * EntitlementDenial is the detail of `PLAN_LIMIT_REACHED` and
25
+ * `SPEND_LIMIT_REACHED` (metering.md §9.3).
26
+ */
27
+ export interface EntitlementDenial {
28
+ /** The meter that hit its limit. */
29
+ meter?: string;
30
+ /** The limit in the meter's unit. */
31
+ limit?: string;
32
+ /** The org's plan. */
33
+ plan?: string;
34
+ /** Where the org can raise the limit. */
35
+ upgradeUrl?: string;
36
+ }
37
+ /**
38
+ * Operation is the wire shape of a long-running operation
39
+ * (resource-api-and-clients.md §3.9, AIP-151).
40
+ *
41
+ * In the schema, a long-running method returns `google.longrunning.Operation`
42
+ * with `google.longrunning.operation_info`, so the AIP linter can check it;
43
+ * on the wire, and in every generated client, that return type is this
44
+ * message. An Operation of a reconciled Resource is a view, not a second
45
+ * state machine: it is `done` when the target's `observed_generation` reaches
46
+ * `target_generation` and `Reconciling` is not TRUE.
47
+ */
48
+ export interface Operation {
49
+ /** `{parent-of-target}/operations/{operation}`. */
50
+ name?: string;
51
+ /** The name of the Resource being changed. */
52
+ target?: string;
53
+ /** The generation this Operation waits for. */
54
+ targetGeneration?: string;
55
+ /** What the Operation does. */
56
+ verb?: OperationVerb;
57
+ /** The custom method verb when `verb` is CUSTOM, for example `revoke`. */
58
+ customVerb?: string;
59
+ /** Whether the Operation has finished. */
60
+ done?: boolean;
61
+ /** When the Operation started. */
62
+ createTime?: string;
63
+ /** When the Operation finished. */
64
+ endTime?: string;
65
+ /** The settled Resource (or Empty for a delete). */
66
+ response?: Record<string, unknown>;
67
+ /** The failure, as the one error body. */
68
+ error?: ProblemDetails;
69
+ /** Progress while not `done`. */
70
+ progress?: OperationProgress;
71
+ }
72
+ /**
73
+ * OperationProgress is the progress of an Operation that is not done. It is
74
+ * also the `metadata_type` of every long-running method.
75
+ */
76
+ export interface OperationProgress {
77
+ /** Percent complete, when the controller can tell. */
78
+ percent?: number;
79
+ /** A customer-safe progress message. */
80
+ message?: string;
81
+ /** The target's conditions when this progress was read. */
82
+ conditions?: Condition[];
83
+ }
84
+ /** PreconditionFailure is the detail of `ETAG_MISMATCH`. */
85
+ export interface PreconditionFailure {
86
+ /** The Resource's current etag, so the client can re-read and retry. */
87
+ currentEtag?: string;
88
+ }
89
+ /**
90
+ * ProblemDetails is the one error body of every method and service
91
+ * (resource-api-and-clients.md §3.8): RFC 9457 problem details served as
92
+ * `application/problem+json`.
93
+ */
94
+ export interface ProblemDetails {
95
+ /** `https://sylphx.com/docs/errors/<code in kebab-case>`. */
96
+ type?: string;
97
+ /** A short customer-safe summary of the problem class. */
98
+ title?: string;
99
+ /** The HTTP status, fixed by `grpc_status`. */
100
+ status?: number;
101
+ /**
102
+ * A customer-safe explanation of this occurrence. Never contains SQL, stack
103
+ * traces, internal hostnames, or another tenant's data.
104
+ */
105
+ detail?: string;
106
+ /** The request id (`Sylphx-Request-Id`). */
107
+ instance?: string;
108
+ /** The stable UPPER_SNAKE code, one of ErrorCode without its prefix. */
109
+ code?: string;
110
+ /** One of the 16 canonical gRPC status names, for example `ABORTED`. */
111
+ grpcStatus?: string;
112
+ /** Whether the same request may be retried. */
113
+ retryable?: boolean;
114
+ /** What the failed call committed. */
115
+ effect?: ErrorEffect;
116
+ /** How long to wait before retrying, when the server knows. */
117
+ retryAfterMs?: string;
118
+ /** Typed details such as PreconditionFailure or EntitlementDenial. */
119
+ details?: Record<string, unknown>[];
120
+ }
121
+ /** ResourceMeta is the metadata every Resource carries in field 3. */
122
+ export interface ResourceMeta {
123
+ /** Increases by one on every change to `spec`. */
124
+ readonly generation?: string;
125
+ /**
126
+ * Strong ETag (AIP-154): changes on any change to spec, status, or
127
+ * metadata. Send it back as `If-Match` or `etag` to make Update and Delete
128
+ * conditional; a mismatch fails with ABORTED / 409 `ETAG_MISMATCH`.
129
+ */
130
+ readonly etag?: string;
131
+ /** When the Resource was created. */
132
+ readonly createTime?: string;
133
+ /** When the Resource last changed. */
134
+ readonly updateTime?: string;
135
+ /** Set while the Resource is being deleted. */
136
+ readonly deleteTime?: string;
137
+ /** Caller-writable, indexed labels (AIP-122 label rules). */
138
+ labels?: Record<string, string>;
139
+ /** Caller-writable, unindexed annotations. */
140
+ annotations?: Record<string, string>;
141
+ /** Caller-writable human-readable name. */
142
+ displayName?: string;
143
+ /** The principal that created the Resource. */
144
+ readonly creator?: string;
145
+ }
146
+ /** ConditionStatus is the truth value of a Condition. */
147
+ export type ConditionStatus = 'true' | 'false' | 'unknown' | (string & {});
148
+ /**
149
+ * ErrorCode is the registry of error codes (§6.3 rule 5). A method lists the
150
+ * codes it may return in `(sylphx.common.v1.method).errors`, without the
151
+ * `ERROR_CODE_` prefix. Adding a code is additive; removing one is breaking.
152
+ */
153
+ export type ErrorCode = 'UNKNOWN_FIELD' | 'INVALID_FIELD' | 'PAGE_TOKEN_MISMATCH' | 'IDEMPOTENCY_KEY_REUSED' | 'IDEMPOTENCY_IN_PROGRESS' | 'ETAG_MISMATCH' | 'RESOURCE_NOT_FOUND' | 'RESOURCE_ALREADY_EXISTS' | 'UNAUTHENTICATED' | 'PERMISSION_DENIED' | 'DELETION_PROTECTED' | 'RECONCILE_FAILED' | 'PLAN_LIMIT_REACHED' | 'SPEND_LIMIT_REACHED' | 'RATE_LIMITED' | 'INVALID_STATE' | 'INTERNAL' | 'UNAVAILABLE' | 'UNIMPLEMENTED' | 'NOT_YET_PROPAGATED' | 'DEADLINE_EXCEEDED' | 'NOT_FOUND' | 'CONTRACT_SKEW' | 'NO_CAPACITY' | 'SHAPE_NOT_OFFERED' | 'STALE_GENERATION' | 'RESOURCE_IN_USE' | 'CONTROL_HELD' | 'CONTROL_HELD_BY_HUMAN' | (string & {});
154
+ /**
155
+ * ErrorEffect says what a failed call committed (standards/dx.md "retry and
156
+ * effect status").
157
+ */
158
+ export type ErrorEffect = 'none' | 'applied' | 'unknown' | (string & {});
159
+ /** OperationVerb is the kind of change an Operation carries. */
160
+ export type OperationVerb = 'create' | 'update' | 'delete' | 'custom' | (string & {});
161
+ /** Severity grades a Condition that does not hold. */
162
+ export type Severity = 'info' | 'warning' | 'error' | (string & {});
package/dist/common.js ADDED
@@ -0,0 +1,41 @@
1
+ // @generated by sylphx-gen 0.1.0 from contracts@446ceb843d4ff88057b0db68e2e54e4aea52d8143b72d66016122995b878de20. Do not edit.
2
+ // `sylphx.common.v1`.
3
+ import * as runtime from './runtime.js';
4
+ runtime.registerSchemas({
5
+ 'sylphx.common.v1.Condition': [
6
+ ['observedGeneration', 'observed_generation'],
7
+ ['transitionTime', 'transition_time'],
8
+ ],
9
+ 'sylphx.common.v1.EntitlementDenial': [
10
+ ['upgradeUrl', 'upgrade_url'],
11
+ ],
12
+ 'sylphx.common.v1.Operation': [
13
+ ['targetGeneration', 'target_generation'],
14
+ ['customVerb', 'custom_verb'],
15
+ ['createTime', 'create_time'],
16
+ ['endTime', 'end_time'],
17
+ ['response', 'response', undefined, 'json'],
18
+ ['error', 'error', 'sylphx.common.v1.ProblemDetails'],
19
+ ['progress', 'progress', 'sylphx.common.v1.OperationProgress'],
20
+ ],
21
+ 'sylphx.common.v1.OperationProgress': [
22
+ ['conditions', 'conditions', 'sylphx.common.v1.Condition'],
23
+ ],
24
+ 'sylphx.common.v1.PreconditionFailure': [
25
+ ['currentEtag', 'current_etag'],
26
+ ],
27
+ 'sylphx.common.v1.ProblemDetails': [
28
+ ['grpcStatus', 'grpc_status'],
29
+ ['retryAfterMs', 'retry_after_ms'],
30
+ ['details', 'details', undefined, 'json'],
31
+ ],
32
+ 'sylphx.common.v1.ResourceMeta': [
33
+ ['createTime', 'create_time'],
34
+ ['updateTime', 'update_time'],
35
+ ['deleteTime', 'delete_time'],
36
+ ['labels', 'labels', undefined, 'map'],
37
+ ['annotations', 'annotations', undefined, 'map'],
38
+ ['displayName', 'display_name'],
39
+ ],
40
+ });
41
+ //# sourceMappingURL=common.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"common.js","sourceRoot":"","sources":["../src/common.ts"],"names":[],"mappings":"AAAA,+HAA+H;AAC/H,sBAAsB;AAEtB,OAAO,KAAK,OAAO,MAAM,cAAc,CAAA;AAgLvC,OAAO,CAAC,eAAe,CAAC;IACvB,4BAA4B,EAAE;QAC7B,CAAC,oBAAoB,EAAE,qBAAqB,CAAC;QAC7C,CAAC,gBAAgB,EAAE,iBAAiB,CAAC;KACrC;IACD,oCAAoC,EAAE;QACrC,CAAC,YAAY,EAAE,aAAa,CAAC;KAC7B;IACD,4BAA4B,EAAE;QAC7B,CAAC,kBAAkB,EAAE,mBAAmB,CAAC;QACzC,CAAC,YAAY,EAAE,aAAa,CAAC;QAC7B,CAAC,YAAY,EAAE,aAAa,CAAC;QAC7B,CAAC,SAAS,EAAE,UAAU,CAAC;QACvB,CAAC,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,CAAC;QAC3C,CAAC,OAAO,EAAE,OAAO,EAAE,iCAAiC,CAAC;QACrD,CAAC,UAAU,EAAE,UAAU,EAAE,oCAAoC,CAAC;KAC9D;IACD,oCAAoC,EAAE;QACrC,CAAC,YAAY,EAAE,YAAY,EAAE,4BAA4B,CAAC;KAC1D;IACD,sCAAsC,EAAE;QACvC,CAAC,aAAa,EAAE,cAAc,CAAC;KAC/B;IACD,iCAAiC,EAAE;QAClC,CAAC,YAAY,EAAE,aAAa,CAAC;QAC7B,CAAC,cAAc,EAAE,gBAAgB,CAAC;QAClC,CAAC,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,CAAC;KACzC;IACD,+BAA+B,EAAE;QAChC,CAAC,YAAY,EAAE,aAAa,CAAC;QAC7B,CAAC,YAAY,EAAE,aAAa,CAAC;QAC7B,CAAC,YAAY,EAAE,aAAa,CAAC;QAC7B,CAAC,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,CAAC;QACtC,CAAC,aAAa,EAAE,aAAa,EAAE,SAAS,EAAE,KAAK,CAAC;QAChD,CAAC,aAAa,EAAE,cAAc,CAAC;KAC/B;CACD,CAAC,CAAA"}
@@ -0,0 +1,198 @@
1
+ import * as runtime from './runtime.js';
2
+ import './common.js';
3
+ import type * as common from './common.js';
4
+ /**
5
+ * A ConfigFlag is one typed configuration value or feature flag of an
6
+ * environment: a default, targeting rules, and percentage rollouts.
7
+ */
8
+ export interface ConfigFlag {
9
+ /**
10
+ * `orgs/{org}/projects/{project}/envs/{env}/config_flags/{config_flag}`;
11
+ * the id is the key evaluators ask for.
12
+ */
13
+ name?: string;
14
+ /** `cfg_<cell><ulid>`. */
15
+ readonly uid?: string;
16
+ /** Resource metadata. */
17
+ meta?: common.ResourceMeta;
18
+ /** Desired state. */
19
+ spec?: ConfigFlagSpec;
20
+ /** Observed state. */
21
+ readonly status?: ConfigFlagStatus;
22
+ }
23
+ /** ConfigFlagSpec is the caller-writable state of a ConfigFlag. */
24
+ export interface ConfigFlagSpec {
25
+ /** The type every value of the flag has. */
26
+ valueType?: ConfigValueType;
27
+ /** The value when no rule matches, or when the flag is disabled. */
28
+ defaultValue?: unknown;
29
+ /**
30
+ * When false, every evaluation returns `default_value` and the rules are
31
+ * skipped: a kill switch. Default true.
32
+ */
33
+ enabled?: boolean;
34
+ /** Targeting rules, first match wins. */
35
+ rules?: TargetingRule[];
36
+ /** What the flag is for. */
37
+ description?: string;
38
+ }
39
+ /** ConfigFlagStatus is the observed state of a ConfigFlag. */
40
+ export interface ConfigFlagStatus {
41
+ /** The generation this status was computed from. */
42
+ readonly observedGeneration?: string;
43
+ /**
44
+ * Ready, Reconciling, Stalled. Reconciling while a change rolls out in
45
+ * waves; Stalled when a wave's health gate fails and the change halts.
46
+ */
47
+ readonly conditions?: common.Condition[];
48
+ /** The wave the current change has reached, from 1. */
49
+ readonly wave?: number;
50
+ /** How many waves the change takes. */
51
+ readonly waveCount?: number;
52
+ /** How many Cells serve the current generation. */
53
+ readonly updatedCellCount?: number;
54
+ /** How many Cells the environment spans. */
55
+ readonly cellCount?: number;
56
+ }
57
+ /** The request of CreateConfigFlag. */
58
+ export interface CreateConfigFlagRequest {
59
+ /** The environment to create in. */
60
+ parent: string;
61
+ /** The config flag to create; only spec and caller-writable metadata are read. */
62
+ configFlag: ConfigFlag;
63
+ /**
64
+ * The id of the new config flag, the key evaluators ask for; the server assigns one when
65
+ * empty.
66
+ */
67
+ configFlagId?: string;
68
+ /** Validate and return the result without writing anything. */
69
+ validateOnly?: boolean;
70
+ }
71
+ /** The request of DeleteConfigFlag. */
72
+ export interface DeleteConfigFlagRequest {
73
+ /** The name of the config flag to delete. */
74
+ name: string;
75
+ /** Delete only if the current etag matches. */
76
+ etag?: string;
77
+ /** Validate without deleting anything. */
78
+ validateOnly?: boolean;
79
+ }
80
+ /** The request of GetConfigFlag. */
81
+ export interface GetConfigFlagRequest {
82
+ /** The name of the config flag to get. */
83
+ name: string;
84
+ }
85
+ /** The request of ListConfigFlags. */
86
+ export interface ListConfigFlagsRequest {
87
+ /** The environment to list in. */
88
+ parent: string;
89
+ /** At most this many; default 50, clamped to 1000. */
90
+ pageSize?: number;
91
+ /** `next_page_token` of the previous page. */
92
+ pageToken?: string;
93
+ /** AIP-160 filter over labels and filterable fields. */
94
+ filter?: string;
95
+ /** AIP-132 ordering over filterable fields. */
96
+ orderBy?: string;
97
+ }
98
+ /** The response of ListConfigFlags. */
99
+ export interface ListConfigFlagsResponse {
100
+ /** The page. */
101
+ configFlags?: ConfigFlag[];
102
+ /** The token of the next page; empty on the last page. */
103
+ nextPageToken?: string;
104
+ }
105
+ /**
106
+ * TargetingRule serves a value to evaluations that match a condition, to a
107
+ * stable percentage of them.
108
+ */
109
+ export interface TargetingRule {
110
+ /**
111
+ * A CEL expression over the evaluation context, for example
112
+ * `ctx.region == "hk" && ctx.plan == "pro"`.
113
+ */
114
+ condition?: string;
115
+ /** The value served when the rule matches; of the flag's type. */
116
+ value?: unknown;
117
+ /**
118
+ * The share of matching evaluations served `value`, from 0 to 100;
119
+ * default 100. The rest fall through to the next rule.
120
+ */
121
+ percentage?: number;
122
+ /**
123
+ * The context attribute hashed to pick the stable percentage, for example
124
+ * `user_id`; default the evaluation's subject.
125
+ */
126
+ bucketAttribute?: string;
127
+ /** What the rule is for. */
128
+ description?: string;
129
+ }
130
+ /** The request of UpdateConfigFlag. */
131
+ export interface UpdateConfigFlagRequest {
132
+ /** The config flag to update; `name` identifies it. */
133
+ configFlag: ConfigFlag;
134
+ /** The fields to write; unset writes every populated field. */
135
+ updateMask?: string;
136
+ /** Validate and return the result without writing anything. */
137
+ validateOnly?: boolean;
138
+ }
139
+ /** ConfigValueType is the type of a ConfigFlag's values. */
140
+ export type ConfigValueType = 'bool' | 'string' | 'int64' | 'double' | 'json' | (string & {});
141
+ /**
142
+ * ConfigService is Kernel Config: dynamic configuration and feature flags
143
+ * evaluated in the Cell from the Cell Snapshot.
144
+ *
145
+ * Namespace of Sylphx Config on `Sylphx`.
146
+ */
147
+ export declare class ConfigApi {
148
+ /** The `config_flags` collection. */
149
+ readonly configFlags: ConfigFlagsCollection;
150
+ constructor(client: runtime.Client);
151
+ }
152
+ /** `config_flags` of Sylphx Config: Resource type `config.sylphx.com/ConfigFlag`. */
153
+ export declare class ConfigFlagsCollection {
154
+ private readonly client;
155
+ constructor(client: runtime.Client);
156
+ /**
157
+ * Gets a config flag.
158
+ *
159
+ * `GET /v1/{name=orgs/*\/projects/*\/envs/*\/config_flags/*}` · permission `config:read` · effect `read`
160
+ *
161
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`.
162
+ */
163
+ get(request: GetConfigFlagRequest): Promise<ConfigFlag>;
164
+ /**
165
+ * Lists config flags in an environment.
166
+ *
167
+ * `GET /v1/{parent=orgs/*\/projects/*\/envs/*}/config_flags` · permission `config:read` · effect `read`
168
+ *
169
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `PAGE_TOKEN_MISMATCH`.
170
+ */
171
+ list(request: ListConfigFlagsRequest): Promise<ListConfigFlagsResponse>;
172
+ /** Every item of every page of `list`. */
173
+ listAll(request: ListConfigFlagsRequest): AsyncGenerator<ConfigFlag>;
174
+ /**
175
+ * Creates a config flag; the Operation is done when every Cell serves it.
176
+ *
177
+ * `POST /v1/{parent=orgs/*\/projects/*\/envs/*}/config_flags` · permission `config:write` · effect `write`
178
+ *
179
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `UNKNOWN_FIELD`, `INVALID_FIELD`, `RESOURCE_ALREADY_EXISTS`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`, `PLAN_LIMIT_REACHED`.
180
+ */
181
+ create(request: CreateConfigFlagRequest): Promise<runtime.Operation<ConfigFlag>>;
182
+ /**
183
+ * Updates a config flag; the change rolls out in waves and the Operation is done when every Cell serves it.
184
+ *
185
+ * `PATCH /v1/{config_flag.name=orgs/*\/projects/*\/envs/*\/config_flags/*}` · permission `config:write` · effect `write`
186
+ *
187
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `UNKNOWN_FIELD`, `INVALID_FIELD`, `ETAG_MISMATCH`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
188
+ */
189
+ update(request: UpdateConfigFlagRequest): Promise<runtime.Operation<ConfigFlag>>;
190
+ /**
191
+ * Deletes a config flag; evaluators then get their compiled-in fallback.
192
+ *
193
+ * `DELETE /v1/{name=orgs/*\/projects/*\/envs/*\/config_flags/*}` · permission `config:write` · effect `destructive`
194
+ *
195
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `ETAG_MISMATCH`, `INVALID_STATE`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
196
+ */
197
+ delete(request: DeleteConfigFlagRequest): Promise<runtime.Operation<Record<string, never>>>;
198
+ }
package/dist/config.js ADDED
@@ -0,0 +1,168 @@
1
+ // @generated by sylphx-gen 0.1.0 from contracts@446ceb843d4ff88057b0db68e2e54e4aea52d8143b72d66016122995b878de20. Do not edit.
2
+ // `sylphx.config.v1`.
3
+ import * as runtime from './runtime.js';
4
+ import './common.js';
5
+ runtime.registerSchemas({
6
+ 'sylphx.config.v1.ConfigFlag': [
7
+ ['meta', 'meta', 'sylphx.common.v1.ResourceMeta'],
8
+ ['spec', 'spec', 'sylphx.config.v1.ConfigFlagSpec'],
9
+ ['status', 'status', 'sylphx.config.v1.ConfigFlagStatus'],
10
+ ],
11
+ 'sylphx.config.v1.ConfigFlagSpec': [
12
+ ['valueType', 'value_type'],
13
+ ['defaultValue', 'default_value', undefined, 'json'],
14
+ ['rules', 'rules', 'sylphx.config.v1.TargetingRule'],
15
+ ],
16
+ 'sylphx.config.v1.ConfigFlagStatus': [
17
+ ['observedGeneration', 'observed_generation'],
18
+ ['conditions', 'conditions', 'sylphx.common.v1.Condition'],
19
+ ['waveCount', 'wave_count'],
20
+ ['updatedCellCount', 'updated_cell_count'],
21
+ ['cellCount', 'cell_count'],
22
+ ],
23
+ 'sylphx.config.v1.CreateConfigFlagRequest': [
24
+ ['configFlag', 'config_flag', 'sylphx.config.v1.ConfigFlag'],
25
+ ['configFlagId', 'config_flag_id'],
26
+ ['validateOnly', 'validate_only'],
27
+ ],
28
+ 'sylphx.config.v1.DeleteConfigFlagRequest': [
29
+ ['validateOnly', 'validate_only'],
30
+ ],
31
+ 'sylphx.config.v1.GetConfigFlagRequest': [],
32
+ 'sylphx.config.v1.ListConfigFlagsRequest': [
33
+ ['pageSize', 'page_size'],
34
+ ['pageToken', 'page_token'],
35
+ ['orderBy', 'order_by'],
36
+ ],
37
+ 'sylphx.config.v1.ListConfigFlagsResponse': [
38
+ ['configFlags', 'config_flags', 'sylphx.config.v1.ConfigFlag'],
39
+ ['nextPageToken', 'next_page_token'],
40
+ ],
41
+ 'sylphx.config.v1.TargetingRule': [
42
+ ['value', 'value', undefined, 'json'],
43
+ ['bucketAttribute', 'bucket_attribute'],
44
+ ],
45
+ 'sylphx.config.v1.UpdateConfigFlagRequest': [
46
+ ['configFlag', 'config_flag', 'sylphx.config.v1.ConfigFlag'],
47
+ ['updateMask', 'update_mask'],
48
+ ['validateOnly', 'validate_only'],
49
+ ],
50
+ });
51
+ /**
52
+ * ConfigService is Kernel Config: dynamic configuration and feature flags
53
+ * evaluated in the Cell from the Cell Snapshot.
54
+ *
55
+ * Namespace of Sylphx Config on `Sylphx`.
56
+ */
57
+ export class ConfigApi {
58
+ /** The `config_flags` collection. */
59
+ configFlags;
60
+ constructor(client) {
61
+ this.configFlags = new ConfigFlagsCollection(client);
62
+ }
63
+ }
64
+ /** `config_flags` of Sylphx Config: Resource type `config.sylphx.com/ConfigFlag`. */
65
+ export class ConfigFlagsCollection {
66
+ client;
67
+ constructor(client) {
68
+ this.client = client;
69
+ }
70
+ /**
71
+ * Gets a config flag.
72
+ *
73
+ * `GET /v1/{name=orgs/*\/projects/*\/envs/*\/config_flags/*}` · permission `config:read` · effect `read`
74
+ *
75
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`.
76
+ */
77
+ async get(request) {
78
+ return this.client.call({
79
+ method: 'GET',
80
+ path: `/v1/${runtime.pathParam(request.name, 'orgs/*/projects/*/envs/*/config_flags/*', 'name')}`,
81
+ responseType: 'sylphx.config.v1.ConfigFlag',
82
+ mutation: false,
83
+ });
84
+ }
85
+ /**
86
+ * Lists config flags in an environment.
87
+ *
88
+ * `GET /v1/{parent=orgs/*\/projects/*\/envs/*}/config_flags` · permission `config:read` · effect `read`
89
+ *
90
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `INVALID_FIELD`, `PAGE_TOKEN_MISMATCH`.
91
+ */
92
+ async list(request) {
93
+ return this.client.call({
94
+ method: 'GET',
95
+ path: `/v1/${runtime.pathParam(request.parent, 'orgs/*/projects/*/envs/*', 'parent')}/config_flags`,
96
+ query: { page_size: request.pageSize, page_token: request.pageToken, filter: request.filter, order_by: request.orderBy },
97
+ responseType: 'sylphx.config.v1.ListConfigFlagsResponse',
98
+ mutation: false,
99
+ });
100
+ }
101
+ /** Every item of every page of `list`. */
102
+ async *listAll(request) {
103
+ let next = request;
104
+ for (;;) {
105
+ const page = await this.list(next);
106
+ yield* page.configFlags ?? [];
107
+ if (page.nextPageToken === undefined || page.nextPageToken === '')
108
+ return;
109
+ next = { ...request, pageToken: page.nextPageToken };
110
+ }
111
+ }
112
+ /**
113
+ * Creates a config flag; the Operation is done when every Cell serves it.
114
+ *
115
+ * `POST /v1/{parent=orgs/*\/projects/*\/envs/*}/config_flags` · permission `config:write` · effect `write`
116
+ *
117
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `UNKNOWN_FIELD`, `INVALID_FIELD`, `RESOURCE_ALREADY_EXISTS`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`, `PLAN_LIMIT_REACHED`.
118
+ */
119
+ async create(request) {
120
+ const operation = await this.client.call({
121
+ method: 'POST',
122
+ path: `/v1/${runtime.pathParam(request.parent, 'orgs/*/projects/*/envs/*', 'parent')}/config_flags`,
123
+ query: { config_flag_id: request.configFlagId, validate_only: request.validateOnly },
124
+ body: request.configFlag ?? {},
125
+ bodyType: 'sylphx.config.v1.ConfigFlag',
126
+ responseType: 'sylphx.common.v1.Operation',
127
+ mutation: true,
128
+ });
129
+ return new runtime.Operation(this.client, operation, 'sylphx.config.v1.ConfigFlag');
130
+ }
131
+ /**
132
+ * Updates a config flag; the change rolls out in waves and the Operation is done when every Cell serves it.
133
+ *
134
+ * `PATCH /v1/{config_flag.name=orgs/*\/projects/*\/envs/*\/config_flags/*}` · permission `config:write` · effect `write`
135
+ *
136
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `UNKNOWN_FIELD`, `INVALID_FIELD`, `ETAG_MISMATCH`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
137
+ */
138
+ async update(request) {
139
+ const operation = await this.client.call({
140
+ method: 'PATCH',
141
+ path: `/v1/${runtime.pathParam(request.configFlag?.name, 'orgs/*/projects/*/envs/*/config_flags/*', 'config_flag.name')}`,
142
+ query: { update_mask: request.updateMask, validate_only: request.validateOnly },
143
+ body: request.configFlag ?? {},
144
+ bodyType: 'sylphx.config.v1.ConfigFlag',
145
+ responseType: 'sylphx.common.v1.Operation',
146
+ mutation: true,
147
+ });
148
+ return new runtime.Operation(this.client, operation, 'sylphx.config.v1.ConfigFlag');
149
+ }
150
+ /**
151
+ * Deletes a config flag; evaluators then get their compiled-in fallback.
152
+ *
153
+ * `DELETE /v1/{name=orgs/*\/projects/*\/envs/*\/config_flags/*}` · permission `config:write` · effect `destructive`
154
+ *
155
+ * Errors: `UNAUTHENTICATED`, `PERMISSION_DENIED`, `RESOURCE_NOT_FOUND`, `ETAG_MISMATCH`, `INVALID_STATE`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_IN_PROGRESS`.
156
+ */
157
+ async delete(request) {
158
+ const operation = await this.client.call({
159
+ method: 'DELETE',
160
+ path: `/v1/${runtime.pathParam(request.name, 'orgs/*/projects/*/envs/*/config_flags/*', 'name')}`,
161
+ query: { etag: request.etag, validate_only: request.validateOnly },
162
+ responseType: 'sylphx.common.v1.Operation',
163
+ mutation: true,
164
+ });
165
+ return new runtime.Operation(this.client, operation, undefined);
166
+ }
167
+ }
168
+ //# sourceMappingURL=config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,+HAA+H;AAC/H,sBAAsB;AAEtB,OAAO,KAAK,OAAO,MAAM,cAAc,CAAA;AACvC,OAAO,aAAa,CAAA;AAuJpB,OAAO,CAAC,eAAe,CAAC;IACvB,6BAA6B,EAAE;QAC9B,CAAC,MAAM,EAAE,MAAM,EAAE,+BAA+B,CAAC;QACjD,CAAC,MAAM,EAAE,MAAM,EAAE,iCAAiC,CAAC;QACnD,CAAC,QAAQ,EAAE,QAAQ,EAAE,mCAAmC,CAAC;KACzD;IACD,iCAAiC,EAAE;QAClC,CAAC,WAAW,EAAE,YAAY,CAAC;QAC3B,CAAC,cAAc,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,CAAC;QACpD,CAAC,OAAO,EAAE,OAAO,EAAE,gCAAgC,CAAC;KACpD;IACD,mCAAmC,EAAE;QACpC,CAAC,oBAAoB,EAAE,qBAAqB,CAAC;QAC7C,CAAC,YAAY,EAAE,YAAY,EAAE,4BAA4B,CAAC;QAC1D,CAAC,WAAW,EAAE,YAAY,CAAC;QAC3B,CAAC,kBAAkB,EAAE,oBAAoB,CAAC;QAC1C,CAAC,WAAW,EAAE,YAAY,CAAC;KAC3B;IACD,0CAA0C,EAAE;QAC3C,CAAC,YAAY,EAAE,aAAa,EAAE,6BAA6B,CAAC;QAC5D,CAAC,cAAc,EAAE,gBAAgB,CAAC;QAClC,CAAC,cAAc,EAAE,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