@squidcloud/cli 1.0.435 → 1.0.437
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/index.js
CHANGED
|
@@ -2156,6 +2156,7 @@ exports.KOTLIN_CONTROLLERS = [
|
|
|
2156
2156
|
'integration',
|
|
2157
2157
|
'internal-storage',
|
|
2158
2158
|
'internalCodeExecutor',
|
|
2159
|
+
'management-secret',
|
|
2159
2160
|
'mutation',
|
|
2160
2161
|
'native-query',
|
|
2161
2162
|
'observability',
|
|
@@ -11632,7 +11633,7 @@ exports.CONNECTOR_IDS = [
|
|
|
11632
11633
|
'linear',
|
|
11633
11634
|
'mail',
|
|
11634
11635
|
'salesforce',
|
|
11635
|
-
'
|
|
11636
|
+
'servicenow_csm',
|
|
11636
11637
|
'slack',
|
|
11637
11638
|
'teams',
|
|
11638
11639
|
'zendesk',
|
|
@@ -22085,12 +22086,8 @@ if (hasToStringTag && gOPD && getProto) {
|
|
|
22085
22086
|
// @ts-expect-error TS won't narrow inside a closure
|
|
22086
22087
|
descriptor = gOPD(superProto, Symbol.toStringTag);
|
|
22087
22088
|
}
|
|
22088
|
-
|
|
22089
|
-
|
|
22090
|
-
cache[
|
|
22091
|
-
/** @type {`$${import('.').TypedArrayName}`} */ ('$' + typedArray)
|
|
22092
|
-
] = bound;
|
|
22093
|
-
}
|
|
22089
|
+
// @ts-expect-error TODO: fix
|
|
22090
|
+
cache['$' + typedArray] = callBind(descriptor.get);
|
|
22094
22091
|
}
|
|
22095
22092
|
});
|
|
22096
22093
|
} else {
|
|
@@ -22098,13 +22095,12 @@ if (hasToStringTag && gOPD && getProto) {
|
|
|
22098
22095
|
var arr = new g[typedArray]();
|
|
22099
22096
|
var fn = arr.slice || arr.set;
|
|
22100
22097
|
if (fn) {
|
|
22101
|
-
|
|
22098
|
+
cache[
|
|
22099
|
+
/** @type {`$${import('.').TypedArrayName}`} */ ('$' + typedArray)
|
|
22100
|
+
] = /** @type {import('./types').BoundSlice | import('./types').BoundSet} */ (
|
|
22102
22101
|
// @ts-expect-error TODO FIXME
|
|
22103
22102
|
callBind(fn)
|
|
22104
22103
|
);
|
|
22105
|
-
cache[
|
|
22106
|
-
/** @type {`$${import('.').TypedArrayName}`} */ ('$' + typedArray)
|
|
22107
|
-
] = bound;
|
|
22108
22104
|
}
|
|
22109
22105
|
});
|
|
22110
22106
|
}
|
|
@@ -23700,11 +23696,11 @@ exports.INTEGRATION_TYPES = [
|
|
|
23700
23696
|
'salesforce_crm',
|
|
23701
23697
|
'sap_hana',
|
|
23702
23698
|
'sentry',
|
|
23703
|
-
'servicenow',
|
|
23704
23699
|
'snowflake',
|
|
23705
23700
|
'spanner',
|
|
23706
23701
|
'xata',
|
|
23707
23702
|
'zendesk',
|
|
23703
|
+
'servicenow_csm',
|
|
23708
23704
|
'freshdesk',
|
|
23709
23705
|
'mail',
|
|
23710
23706
|
'slack',
|
|
@@ -30670,7 +30666,7 @@ function exitWithError(...messages) {
|
|
|
30670
30666
|
(module) {
|
|
30671
30667
|
|
|
30672
30668
|
"use strict";
|
|
30673
|
-
module.exports = /*#__PURE__*/JSON.parse('{"name":"@squidcloud/cli","version":"1.0.
|
|
30669
|
+
module.exports = /*#__PURE__*/JSON.parse('{"name":"@squidcloud/cli","version":"1.0.437","description":"The Squid CLI","main":"dist/index.js","scripts":{"start":"node dist/index.js","start-ts":"ts-node -r tsconfig-paths/register src/index.ts","prebuild":"rimraf dist","build":"webpack --mode=production","build:dev":"webpack --mode=development","lint":"eslint","link":"npm run build && chmod 755 dist/index.js && npm link","watch":"webpack --watch","deploy":"npm run build && npm pack --silent | xargs -I {} mv {} package.tgz && npm install -g package.tgz && rm -rf package.tgz","publish:public":"npm run build && npm publish --access public"},"files":["dist/**/*"],"bin":{"squid":"dist/index.js"},"keywords":[],"author":"","license":"ISC","engines":{"node":">=18.0.0"},"dependencies":{"@squidcloud/local-backend":"^1.0.437","adm-zip":"^0.5.16","copy-webpack-plugin":"^12.0.2","decompress":"^4.2.1","nodemon":"^3.1.9","terser-webpack-plugin":"^5.3.10","ts-loader":"^9.5.1","ts-node":"^10.9.2","tsconfig-paths":"^4.2.0","tsconfig-paths-webpack-plugin":"^4.1.0","webpack":"^5.101.3","zip-webpack-plugin":"^4.0.1"},"devDependencies":{"@types/adm-zip":"^0.5.7","@types/decompress":"^4.2.7","@types/node":"^20.19.9","terminal-link":"^3.0.0"}}');
|
|
30674
30670
|
|
|
30675
30671
|
/***/ },
|
|
30676
30672
|
|
|
@@ -195,54 +195,136 @@ await integrations.upsertIntegration({
|
|
|
195
195
|
});
|
|
196
196
|
```
|
|
197
197
|
|
|
198
|
-
**Key point:** The Console provides a visual interface for management,
|
|
198
|
+
**Key point:** The Console provides a visual interface for management, and everything can be automated through the SDK for more flexibility and control. For organization and application management, use the **ManagementClient** (see below).
|
|
199
|
+
|
|
200
|
+
### 4. ManagementClient (Programmatic Org/App Management)
|
|
201
|
+
|
|
202
|
+
**What it is:** A specialized client for programmatically managing Squid organizations and applications using management API keys.
|
|
203
|
+
|
|
204
|
+
**How it works:**
|
|
205
|
+
- Uses management API keys (created in Console Profile Settings)
|
|
206
|
+
- Provides methods to create organizations and applications
|
|
207
|
+
- Works independently of the main Squid client
|
|
208
|
+
- Authenticated via management API key (starts with `squid_mgmt_`)
|
|
209
|
+
|
|
210
|
+
**Creating Management API Keys:**
|
|
211
|
+
1. Go to Squid Console → Profile Settings → API Keys
|
|
212
|
+
2. Click "Create API Key"
|
|
213
|
+
3. Copy the key value (shown only once)
|
|
214
|
+
4. Key format: `squid_mgmt_<uuid>`
|
|
215
|
+
|
|
216
|
+
**Usage:**
|
|
217
|
+
|
|
218
|
+
```typescript
|
|
219
|
+
import { ManagementClient } from '@squidcloud/client';
|
|
220
|
+
|
|
221
|
+
// Initialize with management API key
|
|
222
|
+
const client = new ManagementClient({
|
|
223
|
+
apiKey: 'squid_mgmt_xxx...', // From Console Profile Settings
|
|
224
|
+
region: 'us-east-1.aws' // Your Squid region
|
|
225
|
+
});
|
|
226
|
+
|
|
227
|
+
// Create an organization
|
|
228
|
+
const { organizationId } = await client.createOrganization({
|
|
229
|
+
name: 'My Organization' // 2-50 characters
|
|
230
|
+
});
|
|
231
|
+
console.log('Created org:', organizationId);
|
|
232
|
+
|
|
233
|
+
// Create an application in the organization
|
|
234
|
+
const { appId } = await client.createApplication({
|
|
235
|
+
organizationId,
|
|
236
|
+
name: 'My Application',
|
|
237
|
+
cloudId: 'aws', // 'aws' | 'gcp' | 'azure'
|
|
238
|
+
region: 'us-east-1' // Cloud region (e.g., 'us-east-1', 'us-central1')
|
|
239
|
+
});
|
|
240
|
+
console.log('Created app:', appId);
|
|
241
|
+
|
|
242
|
+
// Delete an application
|
|
243
|
+
await client.deleteApplication({ appId });
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
**Available Methods:**
|
|
247
|
+
|
|
248
|
+
| Method | Description |
|
|
249
|
+
|--------|-------------|
|
|
250
|
+
| `createOrganization({ name })` | Creates a new organization. User becomes admin. |
|
|
251
|
+
| `createApplication({ organizationId, name, cloudId, region })` | Creates an application in an organization. |
|
|
252
|
+
| `deleteApplication({ appId })` | Deletes an application. Requires admin role. |
|
|
253
|
+
|
|
254
|
+
**TypeScript Types:**
|
|
255
|
+
|
|
256
|
+
```typescript
|
|
257
|
+
import {
|
|
258
|
+
ManagementClient,
|
|
259
|
+
ManagementClientOptions,
|
|
260
|
+
ManagementCloudId, // 'aws' | 'gcp' | 'azure'
|
|
261
|
+
ManagementCreateOrganizationRequest,
|
|
262
|
+
ManagementCreateOrganizationResponse,
|
|
263
|
+
ManagementCreateApplicationRequest,
|
|
264
|
+
ManagementCreateApplicationResponse,
|
|
265
|
+
ManagementDeleteApplicationRequest
|
|
266
|
+
} from '@squidcloud/client';
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
**Key Points:**
|
|
270
|
+
- Management API keys are tied to a user account
|
|
271
|
+
- The user associated with the key becomes the organization admin
|
|
272
|
+
- Keys can be suspended/reactivated/deleted in Console Profile Settings
|
|
273
|
+
- Different from app API keys (which bypass security rules)
|
|
274
|
+
- Use for CI/CD pipelines, automation scripts, and programmatic management
|
|
275
|
+
|
|
276
|
+
**Use Cases:**
|
|
277
|
+
- Automated tenant provisioning (multi-tenant SaaS)
|
|
278
|
+
- CI/CD pipeline integration
|
|
279
|
+
- Infrastructure-as-code workflows
|
|
280
|
+
- Programmatic organization management
|
|
281
|
+
- Automated testing environments
|
|
199
282
|
|
|
200
283
|
### How They Work Together
|
|
201
284
|
|
|
202
285
|
```
|
|
203
|
-
┌─────────────────────┐
|
|
204
|
-
│ CLIENT (Web/ │
|
|
205
|
-
│ Mobile/Server) │
|
|
206
|
-
│ │
|
|
207
|
-
│ - Squid SDK init │
|
|
208
|
-
│ - User auth │
|
|
209
|
-
│ - Limited access │
|
|
210
|
-
└──────────┬──────────┘
|
|
211
|
-
│
|
|
212
|
-
│
|
|
213
|
-
│
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
│
|
|
218
|
-
│
|
|
219
|
-
│
|
|
220
|
-
│ - Decorators
|
|
221
|
-
│ - Full permissions │
|
|
222
|
-
│ -
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
│
|
|
231
|
-
│
|
|
232
|
-
│
|
|
233
|
-
│ -
|
|
234
|
-
│ -
|
|
235
|
-
|
|
236
|
-
│ - Monitoring │
|
|
237
|
-
└─────────────────────┘
|
|
286
|
+
┌─────────────────────┐ ┌─────────────────────┐
|
|
287
|
+
│ CLIENT (Web/ │ │ MANAGEMENT CLIENT │
|
|
288
|
+
│ Mobile/Server) │ │ (Automation) │
|
|
289
|
+
│ │ │ │
|
|
290
|
+
│ - Squid SDK init │ │ - ManagementClient │
|
|
291
|
+
│ - User auth │ │ - Management API │
|
|
292
|
+
│ - Limited access │ │ key auth │
|
|
293
|
+
└──────────┬──────────┘ │ - Create orgs/apps │
|
|
294
|
+
│ └──────────┬──────────┘
|
|
295
|
+
│ │
|
|
296
|
+
│ HTTP/WebSocket │ HTTP
|
|
297
|
+
│ │
|
|
298
|
+
▼ ▼
|
|
299
|
+
┌─────────────────────────────────────────────────┐
|
|
300
|
+
│ SQUID BACKEND │
|
|
301
|
+
│ (Your Code) │
|
|
302
|
+
│ │
|
|
303
|
+
│ - SquidService - Decorators │
|
|
304
|
+
│ - Full permissions - Business logic │
|
|
305
|
+
│ - Security rules - Webhooks │
|
|
306
|
+
└──────────────────────────┬──────────────────────┘
|
|
307
|
+
│
|
|
308
|
+
│ Deployed via CLI
|
|
309
|
+
│ or managed via
|
|
310
|
+
▼
|
|
311
|
+
┌─────────────────────────────────────────────────┐
|
|
312
|
+
│ SQUID CONSOLE │
|
|
313
|
+
│ (Web UI) │
|
|
314
|
+
│ │
|
|
315
|
+
│ - Manage apps - AI Studio │
|
|
316
|
+
│ - Integrations - Monitoring │
|
|
317
|
+
│ - Management API Keys - Profile Settings │
|
|
318
|
+
└─────────────────────────────────────────────────┘
|
|
238
319
|
```
|
|
239
320
|
|
|
240
321
|
**Development workflow:**
|
|
241
|
-
1. Create application in **Squid Console**
|
|
322
|
+
1. Create application in **Squid Console** (or programmatically via **ManagementClient**)
|
|
242
323
|
2. Develop backend services in **Squid Backend** (local development with `squid start`)
|
|
243
324
|
3. Deploy backend to Squid infrastructure (`squid deploy`)
|
|
244
325
|
4. Build **Client** applications that use the Squid Client SDK
|
|
245
326
|
5. Use **Console** for monitoring and management, or use **SDK** for programmatic control
|
|
327
|
+
6. Use **ManagementClient** for automated org/app provisioning (CI/CD, multi-tenant SaaS)
|
|
246
328
|
|
|
247
329
|
## CLI Commands
|
|
248
330
|
|
|
@@ -1485,7 +1567,6 @@ const result = await squid.ai().executeAiQuery(
|
|
|
1485
1567
|
'Show me all active users who registered last month',
|
|
1486
1568
|
{
|
|
1487
1569
|
instructions: 'Only query the users collection',
|
|
1488
|
-
generateWalkthrough: true, // Get step-by-step explanation
|
|
1489
1570
|
enableRawResults: true, // Include raw query results
|
|
1490
1571
|
selectCollectionsOptions: {
|
|
1491
1572
|
collectionsToUse: ['users'] // Limit to specific collections
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@squidcloud/cli",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.437",
|
|
4
4
|
"description": "The Squid CLI",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"node": ">=18.0.0"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@squidcloud/local-backend": "^1.0.
|
|
31
|
+
"@squidcloud/local-backend": "^1.0.437",
|
|
32
32
|
"adm-zip": "^0.5.16",
|
|
33
33
|
"copy-webpack-plugin": "^12.0.2",
|
|
34
34
|
"decompress": "^4.2.1",
|