@stndrds/cli 1.0.0-alpha.294 → 1.0.0-alpha.295

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 (4) hide show
  1. package/LICENSE +111 -0
  2. package/README.md +4 -0
  3. package/dist/bin.mjs +31 -103
  4. package/package.json +7 -4
package/LICENSE ADDED
@@ -0,0 +1,111 @@
1
+ STANDARDS SDK LICENSE
2
+ Version 1.0, September 2026
3
+
4
+ Copyright (c) 2025-2026 AND YOU CREATE SAS. All rights reserved.
5
+
6
+ AND YOU CREATE, a French société par actions simplifiée with a share capital
7
+ of EUR 500, registered with the Paris Trade and Companies Register under
8
+ number 940 190 614, having its registered office at 60 rue François Ier,
9
+ 75008 Paris, France (VAT FR34940190614) ("AYC", "we"), is the sole owner of
10
+ the software distributed under this license (the "SDK"): the source code,
11
+ compiled code, type declarations, documentation and any accompanying files
12
+ published in this package.
13
+
14
+ This is not an open source license. The SDK is made available so that you
15
+ can build software that communicates with the Standards platform operated by
16
+ AYC ("Standards"). Reading the source is permitted; everything else is
17
+ governed by the terms below. By installing, copying or using the SDK you
18
+ ("you", the "Licensee") accept them. If you do not accept them, do not use
19
+ the SDK.
20
+
21
+ 1. LICENSE GRANT
22
+ AYC grants you a limited, non-exclusive, non-transferable, non-sublicensable,
23
+ revocable license to:
24
+ (a) install and use the SDK, in unmodified form, solely to develop, test
25
+ and run applications that communicate with a Standards tenant, workspace
26
+ or API that you are authorised to access under a valid agreement with
27
+ AYC or with an AYC customer; and
28
+ (b) make the copies of the SDK reasonably necessary for that purpose,
29
+ including copies produced by your build tooling and bundlers.
30
+
31
+ 2. RESTRICTIONS
32
+ Except as expressly permitted in Section 1, you shall not, and shall not
33
+ permit any third party to:
34
+ (a) modify, translate, adapt or create derivative works of the SDK;
35
+ (b) reverse engineer, decompile or disassemble the SDK, or otherwise attempt
36
+ to derive its design or internal structure, except to the extent that
37
+ applicable law expressly permits it despite this restriction (Articles
38
+ L.122-6-1 III and IV of the French Intellectual Property Code), in which
39
+ case you shall first request the information from AYC;
40
+ (c) distribute, sell, rent, lease, lend, sublicense, publish or otherwise
41
+ make the SDK, or any part of it, available to any third party, other
42
+ than as bundled inside an application described in Section 1(a);
43
+ (d) use the SDK, or any knowledge of its interfaces, formats, protocols or
44
+ schemas obtained through it, to build, train or improve a product or
45
+ service that competes with Standards, or to access Standards other than
46
+ through the interfaces AYC documents;
47
+ (e) use the SDK to interact with any Standards instance, tenant or API that
48
+ you are not authorised to access, or to circumvent any authentication,
49
+ authorisation, rate limit, licence key or other technical measure;
50
+ (f) remove, alter or obscure any copyright, trademark, licence or other
51
+ proprietary notice in the SDK; or
52
+ (g) use AYC's or Standards' names, logos or trademarks except to state
53
+ truthfully that your application uses the Standards SDK.
54
+
55
+ 3. OWNERSHIP
56
+ The SDK is licensed, not sold. AYC and its licensors retain all right, title
57
+ and interest in and to the SDK, including all intellectual property rights.
58
+ No right is granted by implication, estoppel or otherwise. Any feedback or
59
+ suggestion you provide about the SDK may be used by AYC without restriction
60
+ or obligation.
61
+
62
+ 4. THIRD-PARTY COMPONENTS
63
+ The SDK may include or depend on third-party open source components. Those
64
+ components are governed by their own licences, which are identified in the
65
+ package metadata and prevail over this license for those components only.
66
+
67
+ 5. UPDATES
68
+ AYC may publish new versions of the SDK at any time. This license applies to
69
+ each version you obtain unless that version is accompanied by a different
70
+ licence. AYC has no obligation to maintain, support or update the SDK.
71
+
72
+ 6. TERM AND TERMINATION
73
+ This license is effective until terminated. It terminates automatically,
74
+ without notice, if you breach any of its terms. AYC may also terminate it on
75
+ written notice if your agreement with AYC or with the AYC customer whose
76
+ tenant you access ends. Upon termination you shall stop using the SDK and
77
+ destroy every copy in your possession or control. Sections 2, 3, 7, 8 and 9
78
+ survive termination.
79
+
80
+ 7. NO WARRANTY
81
+ THE SDK IS PROVIDED "AS IS" AND "AS AVAILABLE", WITHOUT WARRANTY OF ANY KIND,
82
+ EXPRESS OR IMPLIED, INCLUDING ANY WARRANTY OF MERCHANTABILITY, FITNESS FOR A
83
+ PARTICULAR PURPOSE, TITLE OR NON-INFRINGEMENT, TO THE FULLEST EXTENT
84
+ PERMITTED BY APPLICABLE LAW. AYC does not warrant that the SDK will be
85
+ error-free or uninterrupted.
86
+
87
+ 8. LIMITATION OF LIABILITY
88
+ TO THE FULLEST EXTENT PERMITTED BY APPLICABLE LAW, AYC SHALL NOT BE LIABLE
89
+ FOR ANY INDIRECT, INCIDENTAL, SPECIAL, CONSEQUENTIAL OR PUNITIVE DAMAGES, OR
90
+ FOR ANY LOSS OF PROFITS, REVENUE, DATA OR GOODWILL, ARISING OUT OF OR IN
91
+ CONNECTION WITH THE SDK OR THIS LICENSE. AYC'S TOTAL AGGREGATE LIABILITY
92
+ UNDER THIS LICENSE SHALL NOT EXCEED ONE HUNDRED EUROS (EUR 100). Nothing in
93
+ this license excludes or limits liability that cannot be excluded or limited
94
+ under applicable law, including liability for gross negligence, wilful
95
+ misconduct or death or personal injury caused by negligence.
96
+
97
+ 9. GOVERNING LAW AND JURISDICTION
98
+ This license is governed by the laws of France. Any dispute arising out of or
99
+ in connection with it shall be submitted to the exclusive jurisdiction of the
100
+ courts of Paris, France, subject to any mandatory rule granting jurisdiction
101
+ to another court.
102
+
103
+ 10. GENERAL
104
+ If any provision of this license is held unenforceable, the remaining
105
+ provisions remain in force. AYC's failure to enforce a provision is not a
106
+ waiver of it. This license is the entire agreement between you and AYC about
107
+ the SDK and supersedes any prior understanding about it, without prejudice to
108
+ any separate agreement governing your access to Standards.
109
+
110
+ To obtain a different licence, or for any question about this one, contact
111
+ AND YOU CREATE SAS, 60 rue François Ier, 75008 Paris, France.
package/README.md CHANGED
@@ -32,3 +32,7 @@ claude -p "Summarize the failing tests"
32
32
 
33
33
  Every agent command targeting a device requires explicit user approval. Calls to `exec_command`
34
34
  without a `deviceId` continue to use the agent sandbox.
35
+
36
+ ## License
37
+
38
+ Licensed under the Standards SDK License 1.0 — see `LICENSE`. This package is not open source: it is provided to build applications that communicate with Standards.
package/dist/bin.mjs CHANGED
@@ -1,112 +1,19 @@
1
1
  #!/usr/bin/env node
2
+ /*! © 2025-2026 AND YOU CREATE SAS (RCS Paris 940 190 614). Proprietary — see LICENSE (Standards SDK License 1.0). */
2
3
 
3
4
  // src/program.ts
4
5
  import chalk10 from "chalk";
5
6
  import { Command } from "commander";
6
7
 
7
8
  // src/client.ts
8
- var ApiClientError = class extends Error {
9
- constructor(statusCode, message) {
10
- super(message);
11
- this.statusCode = statusCode;
12
- this.name = "ApiClientError";
13
- }
14
- };
15
- function buildUrl(base, path, params) {
16
- const normalizedBase = base.endsWith("/") ? base : `${base}/`;
17
- const normalizedPath = path.replace(/^\/+/, "");
18
- const url = new URL(normalizedPath, normalizedBase);
19
- if (params) {
20
- for (const [key, value] of Object.entries(params)) {
21
- if (value !== void 0 && value !== null) {
22
- url.searchParams.set(key, String(value));
23
- }
24
- }
25
- }
26
- return url.toString();
27
- }
9
+ import { StandardsRequestError, createTransport } from "@stndrds/client";
10
+ var ApiClientError = StandardsRequestError;
28
11
  function createClient(config) {
29
- const { apiUrl, apiKey, tenantId } = config;
30
- const headers = {
31
- Authorization: `Bearer ${apiKey}`,
32
- "Content-Type": "application/json",
33
- ...tenantId ? { "X-Tenant-ID": tenantId } : {}
34
- };
35
- async function sendRequest(url, init) {
36
- let response;
37
- try {
38
- response = await fetch(url, { ...init, signal: AbortSignal.timeout(3e4) });
39
- } catch (error) {
40
- if (error instanceof TypeError || error instanceof DOMException && error.name === "TimeoutError") {
41
- throw new ApiClientError(0, `Could not connect to ${apiUrl}. Is the server running?`);
42
- }
43
- throw error;
44
- }
45
- if (response.status === 204) {
46
- return null;
47
- }
48
- const data = await response.json();
49
- if (!response.ok) {
50
- const message = data.message ?? `Request failed with status ${response.status}`;
51
- throw new ApiClientError(response.status, message);
52
- }
53
- return data;
54
- }
55
- function request(method, path, options) {
56
- const url = buildUrl(apiUrl, path, options?.params);
57
- return sendRequest(url, {
58
- method,
59
- headers,
60
- body: options?.body ? JSON.stringify(options.body) : void 0
61
- });
62
- }
63
- async function getText(path, params) {
64
- const url = buildUrl(apiUrl, path, params);
65
- let response;
66
- try {
67
- response = await fetch(url, { method: "GET", headers, signal: AbortSignal.timeout(3e4) });
68
- } catch (error) {
69
- if (error instanceof TypeError || error instanceof DOMException && error.name === "TimeoutError") {
70
- throw new ApiClientError(0, `Could not connect to ${apiUrl}. Is the server running?`);
71
- }
72
- throw error;
73
- }
74
- const text = await response.text();
75
- if (!response.ok) {
76
- let message = `Request failed with status ${response.status}`;
77
- try {
78
- message = JSON.parse(text).message ?? message;
79
- } catch {
80
- if (text) message = text;
81
- }
82
- throw new ApiClientError(response.status, message);
83
- }
84
- return text;
85
- }
86
- function postMultipart(path, form) {
87
- const url = buildUrl(apiUrl, path);
88
- const { "Content-Type": _ct, ...multipartHeaders } = headers;
89
- return sendRequest(url, { method: "POST", headers: multipartHeaders, body: form });
90
- }
91
- return {
92
- get(path, params) {
93
- return request("GET", path, { params });
94
- },
95
- post(path, body) {
96
- return request("POST", path, { body });
97
- },
98
- patch(path, body) {
99
- return request("PATCH", path, { body });
100
- },
101
- put(path, body) {
102
- return request("PUT", path, { body });
103
- },
104
- delete(path) {
105
- return request("DELETE", path);
106
- },
107
- getText,
108
- postMultipart
109
- };
12
+ return createTransport({
13
+ baseUrl: config.apiUrl,
14
+ apiKey: config.apiKey,
15
+ tenantId: config.tenantId
16
+ });
110
17
  }
111
18
 
112
19
  // src/commands/auth.ts
@@ -1867,6 +1774,26 @@ function registerSearchCommand(program) {
1867
1774
  });
1868
1775
  }
1869
1776
 
1777
+ // src/commands/sources.ts
1778
+ function registerSourcesCommand(program) {
1779
+ const sources = program.command("sources").description("Inspect and remove remote schema sources on the current tenant");
1780
+ sources.command("list").description("List remote schema sources: id, hash, last apply, object names").action(async (_opts, cmd) => {
1781
+ const client = getClientFromCommand(cmd);
1782
+ const result = await client.get("/schema/sources");
1783
+ formatOutput(result, getFormat(cmd));
1784
+ });
1785
+ sources.command("remove").description(
1786
+ "Remove a remote schema source: its objects are demoted to custom, records are kept"
1787
+ ).argument("<sourceId>", "source id declared in code").option("--yes", "remove without confirmation").action(async (sourceId, opts, cmd) => {
1788
+ if (!opts.yes) {
1789
+ throw new Error('Removing a schema source is explicit. Re-run with "--yes" to confirm.');
1790
+ }
1791
+ const client = getClientFromCommand(cmd);
1792
+ await client.delete(`/schema/sources/${sourceId}`);
1793
+ formatOutput({ removed: sourceId }, getFormat(cmd));
1794
+ });
1795
+ }
1796
+
1870
1797
  // src/program.ts
1871
1798
  var PUBLIC_COMMANDS = /* @__PURE__ */ new Set(["login", "use", "instances", "current", "logout", "help"]);
1872
1799
  function isPublicCommand(actionCommand) {
@@ -1886,6 +1813,7 @@ function createProgram() {
1886
1813
  registerKeysCommand(program);
1887
1814
  registerAuthCommand(program);
1888
1815
  registerBundlesCommand(program);
1816
+ registerSourcesCommand(program);
1889
1817
  registerConnectorsCommand(program);
1890
1818
  registerMcpCommand(program);
1891
1819
  registerMeetingsCommand(program);
@@ -1917,8 +1845,8 @@ async function runProgram(argv = process.argv) {
1917
1845
  const program = createProgram();
1918
1846
  await program.parseAsync(argv).catch((error) => {
1919
1847
  if (error instanceof ApiClientError) {
1920
- if (error.statusCode > 0) {
1921
- console.error(chalk10.red(`\u2717 Error (${error.statusCode}): ${error.message}`));
1848
+ if (error.status > 0) {
1849
+ console.error(chalk10.red(`\u2717 Error (${error.status}): ${error.message}`));
1922
1850
  } else {
1923
1851
  console.error(chalk10.red(`\u2717 Error: ${error.message}`));
1924
1852
  }
package/package.json CHANGED
@@ -1,19 +1,22 @@
1
1
  {
2
2
  "name": "@stndrds/cli",
3
- "version": "1.0.0-alpha.294",
3
+ "version": "1.0.0-alpha.295",
4
4
  "description": "CLI tool to interact with Standards API",
5
5
  "type": "module",
6
6
  "bin": {
7
7
  "standards": "./dist/bin.mjs"
8
8
  },
9
9
  "files": [
10
- "dist"
10
+ "dist",
11
+ "LICENSE",
12
+ "README.md"
11
13
  ],
12
14
  "dependencies": {
13
15
  "chalk": "^5.4.1",
14
16
  "cli-table3": "^0.6.5",
15
17
  "commander": "^13.1.0",
16
- "@stndrds/schema": "1.0.0-alpha.294"
18
+ "@stndrds/client": "1.0.0-alpha.295",
19
+ "@stndrds/schema": "1.0.0-alpha.295"
17
20
  },
18
21
  "devDependencies": {
19
22
  "@types/node": "^25.6.0",
@@ -30,7 +33,7 @@
30
33
  "url": "https://github.com/andyoucreate/standards.git",
31
34
  "directory": "packages/cli"
32
35
  },
33
- "license": "MIT",
36
+ "license": "SEE LICENSE IN LICENSE",
34
37
  "author": "AndYouCreate",
35
38
  "bugs": {
36
39
  "url": "https://github.com/andyoucreate/standards/issues"