@usecontextlayer/ctxe 0.5.6 → 0.5.8

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/cli.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="507e416d-f409-5878-9327-a3aaeaedfd78")}catch(e){}}();
3
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="540c1501-14bb-5ba6-8d79-8c00f903a9ee")}catch(e){}}();
4
4
  import { createRequire } from "node:module";
5
5
  import * as Sentry from "@sentry/node";
6
6
  import { mkdir, readFile, readdir, rename, rm, stat, writeFile } from "node:fs/promises";
@@ -59,7 +59,7 @@ var __require = /* @__PURE__ */ createRequire(import.meta.url);
59
59
 
60
60
  //#endregion
61
61
  //#region package.json
62
- var version$2 = "0.5.6";
62
+ var version$2 = "0.5.8";
63
63
 
64
64
  //#endregion
65
65
  //#region sentry.ts
@@ -4149,17 +4149,36 @@ function superRefine$1(fn, params) {
4149
4149
  elements: {
4150
4150
  body: {
4151
4151
  props: { text: { $item: "body" } },
4152
- type: "Text"
4152
+ type: "Markdown",
4153
+ visible: { $item: "body" }
4153
4154
  },
4154
4155
  card: {
4155
- children: ["body"],
4156
- props: { title: { $item: "title" } },
4156
+ children: [
4157
+ "meta",
4158
+ "laneline",
4159
+ "needsline",
4160
+ "body"
4161
+ ],
4162
+ props: { title: { $item: "proposed_title" } },
4157
4163
  type: "Card"
4158
4164
  },
4165
+ day: {
4166
+ props: {
4167
+ text: { $concat: ["Activity ", {
4168
+ $format: "date",
4169
+ locale: "en-US",
4170
+ options: { timeZone: "UTC" },
4171
+ value: { $item: "occurred_on" }
4172
+ }] },
4173
+ variant: "outline"
4174
+ },
4175
+ type: "Badge",
4176
+ visible: { $item: "occurred_on" }
4177
+ },
4159
4178
  detail: {
4160
4179
  children: ["card"],
4161
4180
  props: {
4162
- className: "mx-auto max-w-md p-8",
4181
+ className: "mx-auto max-w-2xl p-8",
4163
4182
  direction: "vertical",
4164
4183
  gap: "md"
4165
4184
  },
@@ -4168,39 +4187,122 @@ function superRefine$1(fn, params) {
4168
4187
  statePath: "/items"
4169
4188
  },
4170
4189
  type: "Stack"
4190
+ },
4191
+ kind: {
4192
+ props: {
4193
+ text: { $item: "kind" },
4194
+ variant: "secondary"
4195
+ },
4196
+ type: "Badge"
4197
+ },
4198
+ laneline: {
4199
+ props: {
4200
+ text: { $concat: ["Lane · ", { $item: "lane" }] },
4201
+ variant: "muted"
4202
+ },
4203
+ type: "Text",
4204
+ visible: { $item: "lane" }
4205
+ },
4206
+ meta: {
4207
+ children: ["kind", "day"],
4208
+ props: {
4209
+ align: "center",
4210
+ direction: "horizontal",
4211
+ gap: "sm"
4212
+ },
4213
+ type: "Stack"
4214
+ },
4215
+ needsline: {
4216
+ props: {
4217
+ text: "Needs a lane",
4218
+ variant: "warning"
4219
+ },
4220
+ type: "Badge",
4221
+ visible: { $item: "needs_lane" }
4171
4222
  }
4172
4223
  },
4173
4224
  root: "detail"
4174
4225
  } }, null, " ")}`, `${JSON.stringify({ render: {
4175
4226
  elements: {
4176
- card: {
4177
- props: { title: { $item: "title" } },
4178
- type: "Card"
4227
+ freshness: {
4228
+ props: {
4229
+ text: { $concat: ["Updated ", { $relativeDate: {
4230
+ now: { $state: "/now" },
4231
+ value: { $maxBy: {
4232
+ field: "last_updated",
4233
+ items: { $state: "/items" }
4234
+ } }
4235
+ } }] },
4236
+ variant: "muted"
4237
+ },
4238
+ type: "Text",
4239
+ visible: { $state: "/items/0" }
4179
4240
  },
4180
- list: {
4181
- children: ["row"],
4241
+ page: {
4242
+ children: ["freshness", "table"],
4182
4243
  props: {
4183
- className: "mx-auto max-w-md p-8",
4244
+ align: "stretch",
4245
+ className: "p-8",
4184
4246
  direction: "vertical",
4185
4247
  gap: "md"
4186
4248
  },
4187
- repeat: {
4188
- key: "path",
4189
- statePath: "/items"
4190
- },
4191
4249
  type: "Stack"
4192
4250
  },
4193
- row: {
4194
- children: ["card"],
4195
- on: { press: {
4196
- action: "navigate",
4197
- params: { path: { $template: "${path}" } }
4198
- } },
4199
- props: { className: null },
4200
- type: "Pressable"
4251
+ table: {
4252
+ props: {
4253
+ columns: [
4254
+ {
4255
+ key: "client",
4256
+ label: "Client",
4257
+ variant: "strong"
4258
+ },
4259
+ {
4260
+ key: "title",
4261
+ label: "Update",
4262
+ width: "wide"
4263
+ },
4264
+ {
4265
+ component: "badge",
4266
+ key: "kind",
4267
+ label: "Kind",
4268
+ variantOverride: {
4269
+ call: "outline",
4270
+ followup: "warning",
4271
+ release: "success"
4272
+ }
4273
+ },
4274
+ {
4275
+ component: "badge",
4276
+ key: "lane",
4277
+ label: "Lane",
4278
+ variantOverride: { "Needs a lane": "warning" }
4279
+ },
4280
+ {
4281
+ key: "occurred_on",
4282
+ label: "Activity",
4283
+ type: "date",
4284
+ variant: "muted",
4285
+ width: "narrow"
4286
+ }
4287
+ ],
4288
+ emptyText: "No updates match",
4289
+ filterable: ["kind", "client"],
4290
+ groupable: [
4291
+ "lane",
4292
+ "client",
4293
+ "kind"
4294
+ ],
4295
+ initialSort: {
4296
+ desc: true,
4297
+ key: "occurred_on"
4298
+ },
4299
+ rowLink: "path",
4300
+ rows: { $state: "/items" }
4301
+ },
4302
+ type: "Table"
4201
4303
  }
4202
4304
  },
4203
- root: "list"
4305
+ root: "page"
4204
4306
  } }, null, " ")}`;
4205
4307
  const segmentSchema = string$4().min(1, "a repoId segment must be non-empty").refine((s) => s !== "." && s !== ".." && !s.includes("/"), { message: "a repoId segment must not be '.'/'..' or contain '/'" });
4206
4308
  const sessionMetaSchema = object$3({
@@ -30828,6 +30930,8 @@ async function cleanAllUntracked(repo) {
30828
30930
  async function createCommit(repo, message) {
30829
30931
  await runGit(repo, ["add", "-A"]);
30830
30932
  await runGit(repo, [
30933
+ "-c",
30934
+ "commit.gpgsign=false",
30831
30935
  "commit",
30832
30936
  "--author",
30833
30937
  `${COMMIT_AUTHOR_NAME} <${COMMIT_AUTHOR_EMAIL}>`,
@@ -34551,7 +34655,14 @@ const CreateBindingInput = object$1({
34551
34655
  models: BindingModels.optionalNullable(),
34552
34656
  pluginId: property$1("plugin_id", string$1())
34553
34657
  });
34658
+ const UpdateBindingInput = object$1({
34659
+ auth: BindingAuthInput.optional(),
34660
+ config: record(string$1(), unknown$1()).optional(),
34661
+ enabled: boolean().optional(),
34662
+ models: BindingModels.optionalNullable()
34663
+ });
34554
34664
  const Binding = object$1({
34665
+ auth: BindingAuthInput,
34555
34666
  authType: property$1("auth_type", string$1()),
34556
34667
  baseId: property$1("base_id", string$1()),
34557
34668
  bindingId: property$1("binding_id", string$1()),
@@ -35043,6 +35154,83 @@ var BindingsClient = class {
35043
35154
  }
35044
35155
  return handleNonStatusCodeError$1(_response.error, _response.rawResponse, "POST", "/base/bases/{base_id}/bindings");
35045
35156
  }
35157
+ /**
35158
+ * @param {BaseAPI.UpdateBindingInput} request
35159
+ * @param {BindingsClient.RequestOptions} requestOptions - Request-specific configuration.
35160
+ *
35161
+ * @throws {@link BaseAPI.BadRequestError}
35162
+ * @throws {@link BaseAPI.ForbiddenError}
35163
+ * @throws {@link BaseAPI.NotFoundError}
35164
+ *
35165
+ * @example
35166
+ * await client.bindings.updateBinding({
35167
+ * baseId: "base_id",
35168
+ * bindingId: "binding_id"
35169
+ * })
35170
+ */
35171
+ updateBinding(request, requestOptions) {
35172
+ return HttpResponsePromise$1.fromPromise(this.__updateBinding(request, requestOptions));
35173
+ }
35174
+ async __updateBinding(request, requestOptions) {
35175
+ const { baseId, bindingId, ..._body } = request;
35176
+ const _headers = mergeHeaders$1(this._options?.headers, requestOptions?.headers);
35177
+ const _response = await fetcher$1({
35178
+ url: join$1(await Supplier$1.get(this._options.baseUrl) ?? await Supplier$1.get(this._options.environment), `base/bases/${encodePathParam$1(baseId)}/bindings/${encodePathParam$1(bindingId)}`),
35179
+ method: "PATCH",
35180
+ headers: _headers,
35181
+ contentType: "application/json",
35182
+ queryString: queryBuilder$1().mergeAdditional(requestOptions?.queryParams).build(),
35183
+ requestType: "json",
35184
+ body: UpdateBindingInput.jsonOrThrow(_body, {
35185
+ unrecognizedObjectKeys: "strip",
35186
+ omitUndefined: true
35187
+ }),
35188
+ timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
35189
+ maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
35190
+ abortSignal: requestOptions?.abortSignal,
35191
+ fetchFn: this._options?.fetch,
35192
+ logging: this._options.logging
35193
+ });
35194
+ if (_response.ok) return {
35195
+ data: Binding.parseOrThrow(_response.body, {
35196
+ unrecognizedObjectKeys: "passthrough",
35197
+ allowUnrecognizedUnionMembers: true,
35198
+ allowUnrecognizedEnumValues: true,
35199
+ skipValidation: true,
35200
+ breadcrumbsPrefix: ["response"]
35201
+ }),
35202
+ rawResponse: _response.rawResponse
35203
+ };
35204
+ if (_response.error.reason === "status-code") switch (_response.error.statusCode) {
35205
+ case 400: throw new BadRequestError$1(Error_$1.parseOrThrow(_response.error.body, {
35206
+ unrecognizedObjectKeys: "passthrough",
35207
+ allowUnrecognizedUnionMembers: true,
35208
+ allowUnrecognizedEnumValues: true,
35209
+ skipValidation: true,
35210
+ breadcrumbsPrefix: ["response"]
35211
+ }), _response.rawResponse);
35212
+ case 403: throw new ForbiddenError$1(Error_$1.parseOrThrow(_response.error.body, {
35213
+ unrecognizedObjectKeys: "passthrough",
35214
+ allowUnrecognizedUnionMembers: true,
35215
+ allowUnrecognizedEnumValues: true,
35216
+ skipValidation: true,
35217
+ breadcrumbsPrefix: ["response"]
35218
+ }), _response.rawResponse);
35219
+ case 404: throw new NotFoundError$1(Error_$1.parseOrThrow(_response.error.body, {
35220
+ unrecognizedObjectKeys: "passthrough",
35221
+ allowUnrecognizedUnionMembers: true,
35222
+ allowUnrecognizedEnumValues: true,
35223
+ skipValidation: true,
35224
+ breadcrumbsPrefix: ["response"]
35225
+ }), _response.rawResponse);
35226
+ default: throw new BaseAPIError({
35227
+ statusCode: _response.error.statusCode,
35228
+ body: _response.error.body,
35229
+ rawResponse: _response.rawResponse
35230
+ });
35231
+ }
35232
+ return handleNonStatusCodeError$1(_response.error, _response.rawResponse, "PATCH", "/base/bases/{base_id}/bindings/{binding_id}");
35233
+ }
35046
35234
  };
35047
35235
  var DsnClient = class {
35048
35236
  _options;
@@ -38934,4 +39122,4 @@ runCli().catch((error) => {
38934
39122
  //#endregion
38935
39123
  export { createProgram, resolveRepoContext, resolveRuntimePaths, runCli };
38936
39124
  //# sourceMappingURL=cli.mjs.map
38937
- //# debugId=507e416d-f409-5878-9327-a3aaeaedfd78
39125
+ //# debugId=540c1501-14bb-5ba6-8d79-8c00f903a9ee