@somewhere-cloud/cli 0.38.181 → 0.38.182

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.
@@ -12,15 +12,20 @@ type StreamResponse = Pick<Response, 'status' | 'ok' | 'headers' | 'body' | 'jso
12
12
  };
13
13
  type StreamBody = string | AsyncIterable<Uint8Array>;
14
14
  export declare class ApiClient {
15
+ private readonly linkedProjectId?;
15
16
  /** Mutable: the refresh-on-401 path swaps in a fresh access key in place so
16
17
  * the retry (and every later call on this instance) uses the new token. */
17
18
  /** null: an unauthenticated client (no Authorization header, never a
18
19
  * stored-login refresh), for the public anonymous-deploy routes. */
19
20
  private token;
20
21
  private readonly temporaryConfig;
21
- constructor(token: string | null);
22
+ constructor(token: string | null, linkedProjectId?: string | undefined);
22
23
  private checkTemporaryExpiry;
23
24
  private authHeader;
25
+ /** A refusal for a target selected from .somewhere.json may identify only
26
+ * the caller. Its status and code cannot distinguish a missing project
27
+ * from one the caller cannot access. Explicit project refs omit this context. */
28
+ private linkedProjectError;
24
29
  /** Run a one-off script against the project's live DEV bindings via the
25
30
  * dedicated runner worker. Same auth + `{ ok, data }` envelope as call(), but
26
31
  * rooted at RUNNER_BASE_URL instead of the /v1 API (see that constant for the
@@ -44,7 +44,7 @@ export declare function productionControl(client: ApiClient, target: TestTarget,
44
44
  liveInboxOnly?: boolean;
45
45
  }): TestControl;
46
46
  /** The production control the runner and fixtures always used: your sign-in, the live release. */
47
- export declare function openProductionControl(projectId: string, target?: TestTarget): Promise<TestControl>;
47
+ export declare function openProductionControl(projectId: string, target?: TestTarget, fromProjectFile?: boolean): Promise<TestControl>;
48
48
  export declare const PREVIEW_CLOSED_MESSAGE = "The preview is closed, promoted or expired, or its credential was revoked. Open or continue one with `somewhere preview`, then run the tests again.";
49
49
  type ToolClient = ReturnType<typeof previewToolClient>;
50
50
  /** A failure of the preview itself (closed, saved again): the run fails as a preview run. */
@@ -45,7 +45,9 @@ export type DataRequest = {
45
45
  } | {
46
46
  operation: 'create';
47
47
  values: Record<string, unknown>;
48
- } | {
48
+ }
49
+ /** Send the updated fields in values. */
50
+ | {
49
51
  operation: 'update';
50
52
  id: string | number;
51
53
  values: Record<string, unknown>;
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@somewhere-cloud/cli",
3
- "version": "0.38.181",
3
+ "version": "0.38.182",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@somewhere-cloud/cli",
9
- "version": "0.38.181",
9
+ "version": "0.38.182",
10
10
  "license": "MIT",
11
11
  "bin": {
12
12
  "somewhere": "bin/somewhere.js",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@somewhere-cloud/cli",
3
- "version": "0.38.181",
3
+ "version": "0.38.182",
4
4
  "description": "CLI for somewhere.cloud — auth, projects, deploy, pull, promote, db, logs, env, MCP bridge.",
5
5
  "keywords": [
6
6
  "somewhere",
@@ -67,5 +67,5 @@
67
67
  },
68
68
  "bundleDependencies": [],
69
69
  "bundledDependencies": [],
70
- "gitHead": "66da9855920e084a5383106dc8217ebc027c56f1"
70
+ "gitHead": "8a9bbfe268d329d058c969fa3ced53aba97cfed8"
71
71
  }
@@ -1,5 +1,5 @@
1
1
  {
2
- "source_commit": "208660ebd7cb416162390454cbc9b191e5df4cdc",
2
+ "source_commit": "daba5e317ccbcd1f3ab441b114230568454be39a",
3
3
  "esbuild": "0.24.0",
4
4
  "source_files": {
5
5
  "shared/app-model-catalog.ts": "6896adf310f9cfe74bedc17c8ee7f9ed12695d5c397868041ffdb9a50ce5b658",
@@ -11,12 +11,12 @@
11
11
  "shared/transient-read.ts": "c8887ae98ea241e7c8f53103f47c9ec4abe6c64ba4ce524289496a69beb7ae98",
12
12
  "shared/types/placeholder-identity.ts": "089a46e2474a21193d3611eddd9c94b6bbe62441b3039ed80fc8499bada447ca",
13
13
  "worker/containers/compile/checker-contract.cjs": "5ee58cd4e7d00e01fcbd0fc53f6999ed03cb0081ca92e89810946ddb2f13e86f",
14
- "worker/containers/compile/consumer-contract.cjs": "c96b059acb56f416498dd1fc0cac5a0a4b10f4357ea57abcfbb5994c4aa909e0",
14
+ "worker/containers/compile/consumer-contract.cjs": "84f77b2129f29553f2b91e60f1ff7aa3d9f9ec5117a12568c70472f49cd16779",
15
15
  "worker/containers/compile/declared-data-contract.cjs": "ebdc7dbc12283a7218c28e0e912e736ac27a8e9d513b82c097ebff6df3c1dd91",
16
16
  "worker/containers/compile/generated-declarations-render.cjs": "7ffdb34645cc9eccac6eba39dc86b646a41c4de8a1a038d2b5b46f42df9f1157",
17
17
  "worker/containers/compile/generated-declarations.cjs": "6e9902e054c5c784fd9b3c3fafc1869e79954100a45014e1132247cd82833ec4",
18
18
  "worker/containers/compile/groups-types.cjs": "7681d2adf0c7761a4971d7ba8287b238e464fd2768c878477e32794538675b33",
19
- "worker/containers/compile/runtime-types.cjs": "b096727086e82b8fe2004244b9dfa6777d6e8605bc7d1831ae14224d87cb0cc3",
19
+ "worker/containers/compile/runtime-types.cjs": "0820e62fe8848a6a0ba3e06ca86776a0d90fd56e1d8eb740a18e9692199aea68",
20
20
  "worker/containers/compile/schema-types.cjs": "806147ad7224356734020c62441123db16b50ef6456db974c573b226d517e6cc",
21
21
  "worker/containers/compile/typed-data.cjs": "1c8bec853fbee4ffd34c651076a4e1f4d8b18c0c2be5e99e31df7c9283207627",
22
22
  "worker/containers/compile/typed-files.cjs": "f2568567a53994575ede91f9a0839965e64f94eb92ae11315650189b6de0f79c",
@@ -61,14 +61,14 @@
61
61
  "worker/src/utils/db-schema-deploy/schema-ownership.ts": "e6c811a87bc657707be3518dfe547c6d97718ac073108b126eb7f791c9c08202",
62
62
  "worker/src/utils/dev-health-class.ts": "fd430f31b9c8469f3d90e118fd8c75d1836ebcf705c1f9e93915ffa53a4cb066",
63
63
  "worker/src/utils/errors.ts": "f57505fc7cb515abb2e2e62fc8211f359200df1183689dc621dec10c8c7f03e3",
64
- "worker/src/utils/event-log.ts": "07b6d7e0c6ade047378fe596eb65ec994c887d2a4de90321ddcee28795b0520d",
65
- "worker/src/utils/feed-kinds.ts": "38c01ad7789eea0ceb4a43f539ff354c81debbb7bd38bb6effecb2fe7cba18c6",
64
+ "worker/src/utils/event-log.ts": "6224ef4e42e409f7cd9b96e02442d2c3e64cceacb21a2979d77431771eda9eff",
65
+ "worker/src/utils/feed-kinds.ts": "1c79299ba9dd895e945fd57eda206e261ce90140719c4f99be22f3566d4d96ff",
66
66
  "worker/src/utils/journey-segment.ts": "623837dec9b24c211b1f3be4908f6780bb4cdba175f2dfa5f34ccccfe5a1a5fc",
67
67
  "worker/src/utils/json-exact-integers.ts": "e2eb8d3b2e17da363eb14fb46d876208579e2e92bfac173fb27527e6c4fb575e",
68
68
  "worker/src/utils/log-sanitize.ts": "f4591089c16a34e4cbc271ec22b48566b970a62e30d3e9856b7dcd9c479fb0e8",
69
69
  "worker/src/utils/managed-groups/errors.ts": "18d952edd7f46bb7e459d4e6678226f4bd6e040ab40073ee5a8d0802be2f3721",
70
70
  "worker/src/utils/managed-groups/policy.ts": "2c5b48479a2925bea9a820022c63ca5fa827e2ff5531fe1ab6c0b058b7212b39",
71
- "worker/src/utils/operator-alert-format.ts": "08d936778c64e6e33534f3263f8674fd85ecbd3a4c7396666e25ce9fe1cc9784",
71
+ "worker/src/utils/operator-alert-format.ts": "1ceff0a5ca555c6f441b2d98cec9a5853e2fdd4b8d31eacd27356f7bef8a7dfc",
72
72
  "worker/src/utils/platform-compile-failure.ts": "dd0a8edaf9958d6b29f44ece498470ee910a6ec866e9978ff1e6d46c000c872f",
73
73
  "worker/src/utils/project-custom-hosts.ts": "f3bf13e78d4a23e41bf100cd38432456ce97058a8ac29c80abaf62b049371e3d",
74
74
  "worker/src/utils/project-deletion-commit.ts": "aefb86dbd45def3813af200bee8732e4b4bdf20a781cf8dfe36516855cf87620",
@@ -78,5 +78,5 @@
78
78
  "worker/src/utils/telegram.ts": "9aaaa2597c366da1eeee9e2252e9b73e611ea97ed9558f7e07e694d9b393f053",
79
79
  "worker/src/utils/workers-ai-comparison.ts": "18b5d5ea96f817387a5ef49733ba611c99cbb14987143c28118b1c90f3b637d4"
80
80
  },
81
- "sha256": "b28721a26d1904b5da2e6eec397c37fcf18b8ec6c27506241a6b43fa05a548c3"
81
+ "sha256": "7041ea0b38dbd582504df6764f53573c00c4d7d378ab27627362cf5e9eccfb41"
82
82
  }
@@ -1,3 +1,3 @@
1
1
  {
2
- "sha256": "b8367748f10c4e230725210c07c091ab5e2d6efb1d6dcfa5f42c0be0b1f7361d"
2
+ "sha256": "eb7bbedbd7d85576b8c875c6ec7424fb2e22579628d525339f8a7301d6de7834"
3
3
  }
@@ -1143,7 +1143,7 @@ type SomewhereDbReadOptionsFor<T extends string, C extends readonly string[], I>
1143
1143
  columns?: C | null;
1144
1144
  include?: I | null;
1145
1145
  } & NoInfer<string extends C[number] ? unknown
1146
- : Exclude<C[number], SomewhereDbColumn<T>> extends never ? unknown : { columns: never }>;
1146
+ : { [K in Exclude<C[number], SomewhereDbColumn<T>> as \`Unknown column \${K} on \${T}\`]: never }>;
1147
1147
  type SomewhereDbIncrementFor<T extends string> = T extends keyof SomewhereDeclaredTables
1148
1148
  ? { readonly [K in __SomewhereDeclared<T, 'numeric', never>]?: number }
1149
1149
  : SomewhereDbIncrement;
@@ -1206,9 +1206,11 @@ interface SomewhereServerDb {
1206
1206
  tx(intents: readonly SomewhereDbWriteIntent[]): Promise<SomewhereDbWriteReceipt[]>;
1207
1207
  }
1208
1208
  interface SomewhereCallerDb extends Omit<SomewhereServerDb, 'from' | 'count' | 'insert' | 'update' | 'tx'> {
1209
+ // Insert returns the inserted rows in data. Read data[0] for a single row.
1209
1210
  // The platform composes row identity from the verified user.
1210
1211
  insert<T extends SomewhereDbTable>(table: T, values: __SomewhereDeclared<T, 'insert', SomewhereDbValues>, options?: SomewhereDbCallerInsertOptions<T> | null): Promise<SomewhereDbInsertResult<SomewhereDbRow<T>>>;
1211
1212
  update<T extends SomewhereDbTable>(table: T, spec: SomewhereDbUpdateFor<T, 'set'>): Promise<SomewhereDbResult<SomewhereDbRow<T>>>;
1213
+ /** For an array declared separately, use satisfies readonly SomewhereDbCallerWriteIntent[]. */
1212
1214
  tx(intents: readonly SomewhereDbCallerWriteIntent[]): Promise<SomewhereDbWriteReceipt[]>;
1213
1215
  // can: true (signed-in callers only; never with asServer): each row also carries the row hints.
1214
1216
  from<T extends SomewhereDbTable, const C extends readonly string[] = readonly SomewhereDbColumn<T>[], const I extends readonly SomewhereDbRelationName<T>[] = []>(
@@ -4581,8 +4583,8 @@ var require_consumer_contract = __commonJS({
4581
4583
  "worker/containers/compile/consumer-contract.cjs"(exports2, module2) {
4582
4584
  "use strict";
4583
4585
  var CONSUMER_CONTRACT2 = Object.freeze({
4584
- version: 52,
4585
- digest: "105a0ce3ded44ed90e1403c6b6651586deed0e5411686ba7198b32f37a8ffd9c"
4586
+ version: 53,
4587
+ digest: "ca888b2463a0886d9784a801dd33fb8d0af53b32bf0c027f06e57c3aa957a145"
4586
4588
  });
4587
4589
  var MEMBERSHIPS = "memberships: table({ id: id(), team_id: text(), member_id: text() }, { scope: owner(), client: { read: true } }),";
4588
4590
  var SHARES = "shares: table({ id: id(), grantee_id: text() }, { scope: owner(), client: { read: true, create: ['grantee_id'], delete: true }, unique: [['user_id', 'grantee_id']] }),";