@airstore/sdk 0.1.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 (134) hide show
  1. package/README.md +341 -0
  2. package/dist/cjs/airstore.js +127 -0
  3. package/dist/cjs/airstore.js.map +1 -0
  4. package/dist/cjs/client.js +214 -0
  5. package/dist/cjs/client.js.map +1 -0
  6. package/dist/cjs/errors.js +129 -0
  7. package/dist/cjs/errors.js.map +1 -0
  8. package/dist/cjs/index.js +40 -0
  9. package/dist/cjs/index.js.map +1 -0
  10. package/dist/cjs/resources/connections.js +74 -0
  11. package/dist/cjs/resources/connections.js.map +1 -0
  12. package/dist/cjs/resources/filesystem.js +101 -0
  13. package/dist/cjs/resources/filesystem.js.map +1 -0
  14. package/dist/cjs/resources/index.js +18 -0
  15. package/dist/cjs/resources/index.js.map +1 -0
  16. package/dist/cjs/resources/members.js +63 -0
  17. package/dist/cjs/resources/members.js.map +1 -0
  18. package/dist/cjs/resources/oauth.js +85 -0
  19. package/dist/cjs/resources/oauth.js.map +1 -0
  20. package/dist/cjs/resources/smart-folders.js +102 -0
  21. package/dist/cjs/resources/smart-folders.js.map +1 -0
  22. package/dist/cjs/resources/tokens.js +73 -0
  23. package/dist/cjs/resources/tokens.js.map +1 -0
  24. package/dist/cjs/resources/workspaces.js +75 -0
  25. package/dist/cjs/resources/workspaces.js.map +1 -0
  26. package/dist/cjs/types/connections.js +3 -0
  27. package/dist/cjs/types/connections.js.map +1 -0
  28. package/dist/cjs/types/filesystem.js +3 -0
  29. package/dist/cjs/types/filesystem.js.map +1 -0
  30. package/dist/cjs/types/index.js +25 -0
  31. package/dist/cjs/types/index.js.map +1 -0
  32. package/dist/cjs/types/members.js +3 -0
  33. package/dist/cjs/types/members.js.map +1 -0
  34. package/dist/cjs/types/oauth.js +3 -0
  35. package/dist/cjs/types/oauth.js.map +1 -0
  36. package/dist/cjs/types/shared.js +3 -0
  37. package/dist/cjs/types/shared.js.map +1 -0
  38. package/dist/cjs/types/smart-folders.js +3 -0
  39. package/dist/cjs/types/smart-folders.js.map +1 -0
  40. package/dist/cjs/types/tokens.js +3 -0
  41. package/dist/cjs/types/tokens.js.map +1 -0
  42. package/dist/cjs/types/workspaces.js +3 -0
  43. package/dist/cjs/types/workspaces.js.map +1 -0
  44. package/dist/cjs/version.js +6 -0
  45. package/dist/cjs/version.js.map +1 -0
  46. package/dist/esm/airstore.js +123 -0
  47. package/dist/esm/airstore.js.map +1 -0
  48. package/dist/esm/client.js +209 -0
  49. package/dist/esm/client.js.map +1 -0
  50. package/dist/esm/errors.js +115 -0
  51. package/dist/esm/errors.js.map +1 -0
  52. package/dist/esm/index.js +16 -0
  53. package/dist/esm/index.js.map +1 -0
  54. package/dist/esm/resources/connections.js +70 -0
  55. package/dist/esm/resources/connections.js.map +1 -0
  56. package/dist/esm/resources/filesystem.js +97 -0
  57. package/dist/esm/resources/filesystem.js.map +1 -0
  58. package/dist/esm/resources/index.js +8 -0
  59. package/dist/esm/resources/index.js.map +1 -0
  60. package/dist/esm/resources/members.js +59 -0
  61. package/dist/esm/resources/members.js.map +1 -0
  62. package/dist/esm/resources/oauth.js +81 -0
  63. package/dist/esm/resources/oauth.js.map +1 -0
  64. package/dist/esm/resources/smart-folders.js +98 -0
  65. package/dist/esm/resources/smart-folders.js.map +1 -0
  66. package/dist/esm/resources/tokens.js +69 -0
  67. package/dist/esm/resources/tokens.js.map +1 -0
  68. package/dist/esm/resources/workspaces.js +71 -0
  69. package/dist/esm/resources/workspaces.js.map +1 -0
  70. package/dist/esm/types/connections.js +2 -0
  71. package/dist/esm/types/connections.js.map +1 -0
  72. package/dist/esm/types/filesystem.js +2 -0
  73. package/dist/esm/types/filesystem.js.map +1 -0
  74. package/dist/esm/types/index.js +9 -0
  75. package/dist/esm/types/index.js.map +1 -0
  76. package/dist/esm/types/members.js +2 -0
  77. package/dist/esm/types/members.js.map +1 -0
  78. package/dist/esm/types/oauth.js +2 -0
  79. package/dist/esm/types/oauth.js.map +1 -0
  80. package/dist/esm/types/shared.js +2 -0
  81. package/dist/esm/types/shared.js.map +1 -0
  82. package/dist/esm/types/smart-folders.js +2 -0
  83. package/dist/esm/types/smart-folders.js.map +1 -0
  84. package/dist/esm/types/tokens.js +2 -0
  85. package/dist/esm/types/tokens.js.map +1 -0
  86. package/dist/esm/types/workspaces.js +2 -0
  87. package/dist/esm/types/workspaces.js.map +1 -0
  88. package/dist/esm/version.js +3 -0
  89. package/dist/esm/version.js.map +1 -0
  90. package/dist/types/airstore.d.ts +114 -0
  91. package/dist/types/airstore.d.ts.map +1 -0
  92. package/dist/types/client.d.ts +86 -0
  93. package/dist/types/client.d.ts.map +1 -0
  94. package/dist/types/errors.d.ts +61 -0
  95. package/dist/types/errors.d.ts.map +1 -0
  96. package/dist/types/index.d.ts +21 -0
  97. package/dist/types/index.d.ts.map +1 -0
  98. package/dist/types/resources/connections.d.ts +50 -0
  99. package/dist/types/resources/connections.d.ts.map +1 -0
  100. package/dist/types/resources/filesystem.d.ts +81 -0
  101. package/dist/types/resources/filesystem.d.ts.map +1 -0
  102. package/dist/types/resources/index.d.ts +8 -0
  103. package/dist/types/resources/index.d.ts.map +1 -0
  104. package/dist/types/resources/members.d.ts +49 -0
  105. package/dist/types/resources/members.d.ts.map +1 -0
  106. package/dist/types/resources/oauth.d.ts +57 -0
  107. package/dist/types/resources/oauth.d.ts.map +1 -0
  108. package/dist/types/resources/smart-folders.d.ts +70 -0
  109. package/dist/types/resources/smart-folders.d.ts.map +1 -0
  110. package/dist/types/resources/tokens.d.ts +54 -0
  111. package/dist/types/resources/tokens.d.ts.map +1 -0
  112. package/dist/types/resources/workspaces.d.ts +63 -0
  113. package/dist/types/resources/workspaces.d.ts.map +1 -0
  114. package/dist/types/types/connections.d.ts +41 -0
  115. package/dist/types/types/connections.d.ts.map +1 -0
  116. package/dist/types/types/filesystem.d.ts +39 -0
  117. package/dist/types/types/filesystem.d.ts.map +1 -0
  118. package/dist/types/types/index.d.ts +9 -0
  119. package/dist/types/types/index.d.ts.map +1 -0
  120. package/dist/types/types/members.d.ts +30 -0
  121. package/dist/types/types/members.d.ts.map +1 -0
  122. package/dist/types/types/oauth.d.ts +40 -0
  123. package/dist/types/types/oauth.d.ts.map +1 -0
  124. package/dist/types/types/shared.d.ts +27 -0
  125. package/dist/types/types/shared.d.ts.map +1 -0
  126. package/dist/types/types/smart-folders.d.ts +45 -0
  127. package/dist/types/types/smart-folders.d.ts.map +1 -0
  128. package/dist/types/types/tokens.d.ts +40 -0
  129. package/dist/types/types/tokens.d.ts.map +1 -0
  130. package/dist/types/types/workspaces.d.ts +26 -0
  131. package/dist/types/types/workspaces.d.ts.map +1 -0
  132. package/dist/types/version.d.ts +3 -0
  133. package/dist/types/version.d.ts.map +1 -0
  134. package/package.json +45 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tokens.js","sourceRoot":"","sources":["../../../src/resources/tokens.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;GAcG;AACH,MAAM,OAAO,MAAM;IACY;IAA7B,YAA6B,MAAkB;QAAlB,WAAM,GAAN,MAAM,CAAY;IAAG,CAAC;IAEnD;;;;;;;;;;OAUG;IACH,KAAK,CAAC,MAAM,CACV,WAAmB,EACnB,MAAyB,EACzB,OAAwB;QAExB,MAAM,IAAI,GAA4B,EAAE,CAAC;QACzC,IAAI,MAAM,CAAC,QAAQ,KAAK,SAAS;YAAE,IAAI,CAAC,WAAW,CAAC,GAAG,MAAM,CAAC,QAAQ,CAAC;QACvE,IAAI,MAAM,CAAC,KAAK,KAAK,SAAS;YAAE,IAAI,CAAC,OAAO,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC;QAC7D,IAAI,MAAM,CAAC,IAAI,KAAK,SAAS;YAAE,IAAI,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC,IAAI,CAAC;QAC1D,IAAI,MAAM,CAAC,SAAS,KAAK,SAAS;YAAE,IAAI,CAAC,YAAY,CAAC,GAAG,MAAM,CAAC,SAAS,CAAC;QAE1E,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CACxB,MAAM,EACN,eAAe,WAAW,SAAS,EACnC,IAAI,EACJ,SAAS,EACT,OAAO,CACR,CAAC;IACJ,CAAC;IAED;;;;;;;;OAQG;IACH,KAAK,CAAC,IAAI,CAAC,WAAmB,EAAE,OAAwB;QACtD,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CACxB,KAAK,EACL,eAAe,WAAW,SAAS,EACnC,SAAS,EACT,SAAS,EACT,OAAO,CACR,CAAC;IACJ,CAAC;IAED;;;;;;;;OAQG;IACH,KAAK,CAAC,MAAM,CACV,WAAmB,EACnB,OAAe,EACf,OAAwB;QAExB,MAAM,IAAI,CAAC,MAAM,CAAC,OAAO,CACvB,QAAQ,EACR,eAAe,WAAW,WAAW,OAAO,EAAE,EAC9C,SAAS,EACT,SAAS,EACT,OAAO,CACR,CAAC;IACJ,CAAC;CACF"}
@@ -0,0 +1,71 @@
1
+ /**
2
+ * Manage workspaces.
3
+ *
4
+ * Workspaces are the top-level container for connections, smart folders,
5
+ * members, and the virtual filesystem. When using an organization token,
6
+ * workspaces are automatically scoped to the token's tenant.
7
+ *
8
+ * @example
9
+ * ```ts
10
+ * const ws = await airstore.workspaces.create({ name: "user-123" });
11
+ * console.log(ws.external_id);
12
+ * ```
13
+ */
14
+ export class Workspaces {
15
+ client;
16
+ constructor(client) {
17
+ this.client = client;
18
+ }
19
+ /**
20
+ * Create a new workspace.
21
+ *
22
+ * When called with an organization token, the workspace is automatically
23
+ * tagged with the token's `tenant_id`.
24
+ *
25
+ * @param params - Workspace creation parameters.
26
+ * @param options - Per-request overrides.
27
+ * @returns The newly created workspace.
28
+ *
29
+ * @throws {AuthenticationError} If the API key is invalid or missing.
30
+ * @throws {PermissionDeniedError} If the token lacks workspace creation rights.
31
+ */
32
+ async create(params, options) {
33
+ return this.client.request('POST', '/workspaces', params, undefined, options);
34
+ }
35
+ /**
36
+ * List all workspaces accessible to the authenticated token.
37
+ *
38
+ * Organization tokens only see workspaces belonging to their tenant.
39
+ * Cluster admin tokens see all workspaces.
40
+ *
41
+ * @param options - Per-request overrides.
42
+ * @returns Array of workspaces.
43
+ */
44
+ async list(options) {
45
+ return this.client.request('GET', '/workspaces', undefined, undefined, options);
46
+ }
47
+ /**
48
+ * Retrieve a workspace by its external ID.
49
+ *
50
+ * @param id - Workspace external ID (UUID).
51
+ * @param options - Per-request overrides.
52
+ * @returns The workspace.
53
+ *
54
+ * @throws {NotFoundError} If the workspace doesn't exist.
55
+ */
56
+ async retrieve(id, options) {
57
+ return this.client.request('GET', `/workspaces/${id}`, undefined, undefined, options);
58
+ }
59
+ /**
60
+ * Delete a workspace and all associated data.
61
+ *
62
+ * @param id - Workspace external ID (UUID).
63
+ * @param options - Per-request overrides.
64
+ *
65
+ * @throws {NotFoundError} If the workspace doesn't exist.
66
+ */
67
+ async del(id, options) {
68
+ await this.client.request('DELETE', `/workspaces/${id}`, undefined, undefined, options);
69
+ }
70
+ }
71
+ //# sourceMappingURL=workspaces.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workspaces.js","sourceRoot":"","sources":["../../../src/resources/workspaces.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;GAYG;AACH,MAAM,OAAO,UAAU;IACQ;IAA7B,YAA6B,MAAkB;QAAlB,WAAM,GAAN,MAAM,CAAY;IAAG,CAAC;IAEnD;;;;;;;;;;;;OAYG;IACH,KAAK,CAAC,MAAM,CACV,MAA6B,EAC7B,OAAwB;QAExB,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CACxB,MAAM,EACN,aAAa,EACb,MAAM,EACN,SAAS,EACT,OAAO,CACR,CAAC;IACJ,CAAC;IAED;;;;;;;;OAQG;IACH,KAAK,CAAC,IAAI,CAAC,OAAwB;QACjC,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CACxB,KAAK,EACL,aAAa,EACb,SAAS,EACT,SAAS,EACT,OAAO,CACR,CAAC;IACJ,CAAC;IAED;;;;;;;;OAQG;IACH,KAAK,CAAC,QAAQ,CAAC,EAAU,EAAE,OAAwB;QACjD,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CACxB,KAAK,EACL,eAAe,EAAE,EAAE,EACnB,SAAS,EACT,SAAS,EACT,OAAO,CACR,CAAC;IACJ,CAAC;IAED;;;;;;;OAOG;IACH,KAAK,CAAC,GAAG,CAAC,EAAU,EAAE,OAAwB;QAC5C,MAAM,IAAI,CAAC,MAAM,CAAC,OAAO,CACvB,QAAQ,EACR,eAAe,EAAE,EAAE,EACnB,SAAS,EACT,SAAS,EACT,OAAO,CACR,CAAC;IACJ,CAAC;CACF"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=connections.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"connections.js","sourceRoot":"","sources":["../../../src/types/connections.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=filesystem.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"filesystem.js","sourceRoot":"","sources":["../../../src/types/filesystem.ts"],"names":[],"mappings":""}
@@ -0,0 +1,9 @@
1
+ export * from './shared.js';
2
+ export * from './workspaces.js';
3
+ export * from './connections.js';
4
+ export * from './smart-folders.js';
5
+ export * from './tokens.js';
6
+ export * from './members.js';
7
+ export * from './oauth.js';
8
+ export * from './filesystem.js';
9
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=members.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"members.js","sourceRoot":"","sources":["../../../src/types/members.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=oauth.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"oauth.js","sourceRoot":"","sources":["../../../src/types/oauth.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=shared.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shared.js","sourceRoot":"","sources":["../../../src/types/shared.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=smart-folders.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"smart-folders.js","sourceRoot":"","sources":["../../../src/types/smart-folders.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=tokens.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tokens.js","sourceRoot":"","sources":["../../../src/types/tokens.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=workspaces.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workspaces.js","sourceRoot":"","sources":["../../../src/types/workspaces.ts"],"names":[],"mappings":""}
@@ -0,0 +1,3 @@
1
+ /** SDK version. Injected during build. */
2
+ export const VERSION = '0.1.0';
3
+ //# sourceMappingURL=version.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA,0CAA0C;AAC1C,MAAM,CAAC,MAAM,OAAO,GAAG,OAAO,CAAC"}
@@ -0,0 +1,114 @@
1
+ import { CoreClient, type ClientOptions } from './client.js';
2
+ import { Workspaces } from './resources/workspaces.js';
3
+ import { Connections } from './resources/connections.js';
4
+ import { SmartFolders } from './resources/smart-folders.js';
5
+ import { Tokens } from './resources/tokens.js';
6
+ import { Members } from './resources/members.js';
7
+ import { OAuth } from './resources/oauth.js';
8
+ import { Filesystem } from './resources/filesystem.js';
9
+ /**
10
+ * The Airstore SDK client.
11
+ *
12
+ * Create an instance with your API key to interact with workspaces,
13
+ * connections, smart folders, tokens, members, the virtual filesystem,
14
+ * and OAuth sessions.
15
+ *
16
+ * @example Basic provisioning flow
17
+ * ```ts
18
+ * import Airstore from '@airstore/sdk';
19
+ *
20
+ * const airstore = new Airstore({ apiKey: 'org_...' });
21
+ *
22
+ * // 1. Create a workspace for a new user
23
+ * const ws = await airstore.workspaces.create({ name: 'user-123' });
24
+ *
25
+ * // 2. Connect their Gmail with existing OAuth tokens
26
+ * await airstore.connections.create(ws.external_id, {
27
+ * integrationType: 'gmail',
28
+ * accessToken: existingAccessToken,
29
+ * refreshToken: existingRefreshToken,
30
+ * });
31
+ *
32
+ * // 3. Set up a smart folder
33
+ * await airstore.smartFolders.create(ws.external_id, {
34
+ * integration: 'gmail',
35
+ * name: 'Recent Emails',
36
+ * guidance: 'Last 7 days of emails from the inbox',
37
+ * });
38
+ *
39
+ * // 4. Generate a mount token for the user's VM
40
+ * const token = await airstore.tokens.create(ws.external_id, {
41
+ * email: 'agent@internal',
42
+ * name: 'vm-mount',
43
+ * });
44
+ * // Pass token.token to: airstore start --token <token>
45
+ * ```
46
+ *
47
+ * @example Per-request options
48
+ * ```ts
49
+ * const ws = await airstore.workspaces.list({
50
+ * timeout: 10_000,
51
+ * maxRetries: 5,
52
+ * });
53
+ * ```
54
+ */
55
+ export declare class Airstore extends CoreClient {
56
+ /**
57
+ * Manage workspaces.
58
+ *
59
+ * Workspaces are the top-level container for connections, smart folders,
60
+ * members, and the virtual filesystem.
61
+ */
62
+ readonly workspaces: Workspaces;
63
+ /**
64
+ * Manage connections (integrations) within a workspace.
65
+ *
66
+ * Pass existing OAuth tokens or API keys to connect external services
67
+ * like Gmail, GitHub, Notion, etc.
68
+ */
69
+ readonly connections: Connections;
70
+ /**
71
+ * Manage smart folders (filesystem queries).
72
+ *
73
+ * Smart folders use LLM inference to automatically organize and filter
74
+ * data from connected integrations into virtual folders or files.
75
+ */
76
+ readonly smartFolders: SmartFolders;
77
+ /**
78
+ * Manage workspace-scoped authentication tokens.
79
+ *
80
+ * Tokens are used for CLI mounting and per-workspace programmatic access.
81
+ */
82
+ readonly tokens: Tokens;
83
+ /**
84
+ * Manage workspace members.
85
+ *
86
+ * Members are users with roles (admin, member, viewer) in a workspace.
87
+ */
88
+ readonly members: Members;
89
+ /**
90
+ * OAuth session management for interactive connection setup.
91
+ *
92
+ * Use this for browser-redirect flows where users authorize
93
+ * integrations themselves.
94
+ */
95
+ readonly oauth: OAuth;
96
+ /**
97
+ * Read-only access to the workspace virtual filesystem.
98
+ *
99
+ * Browse directories, read files, and inspect metadata across
100
+ * all connected integrations.
101
+ */
102
+ readonly fs: Filesystem;
103
+ /**
104
+ * Create a new Airstore SDK client.
105
+ *
106
+ * @param opts - Client configuration. At minimum, provide an `apiKey`
107
+ * or set the `AIRSTORE_API_KEY` environment variable.
108
+ *
109
+ * @throws {AirstoreError} If no API key is provided.
110
+ */
111
+ constructor(opts?: ClientOptions);
112
+ }
113
+ export default Airstore;
114
+ //# sourceMappingURL=airstore.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"airstore.d.ts","sourceRoot":"","sources":["../../src/airstore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,KAAK,aAAa,EAAE,MAAM,aAAa,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC/C,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAEvD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AACH,qBAAa,QAAS,SAAQ,UAAU;IACtC;;;;;OAKG;IACH,QAAQ,CAAC,UAAU,EAAE,UAAU,CAAC;IAEhC;;;;;OAKG;IACH,QAAQ,CAAC,WAAW,EAAE,WAAW,CAAC;IAElC;;;;;OAKG;IACH,QAAQ,CAAC,YAAY,EAAE,YAAY,CAAC;IAEpC;;;;OAIG;IACH,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IAExB;;;;OAIG;IACH,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAE1B;;;;;OAKG;IACH,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC;IAEtB;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,EAAE,UAAU,CAAC;IAExB;;;;;;;OAOG;gBACS,IAAI,CAAC,EAAE,aAAa;CAUjC;AAED,eAAe,QAAQ,CAAC"}
@@ -0,0 +1,86 @@
1
+ /** Per-request overrides. Every resource method accepts this as the last argument. */
2
+ export interface RequestOptions {
3
+ /** Override the client-level timeout (ms). */
4
+ timeout?: number;
5
+ /** Override the client-level maxRetries. */
6
+ maxRetries?: number;
7
+ /** Abort signal for cancellation. */
8
+ signal?: AbortSignal;
9
+ /** Extra headers merged with client-level headers. */
10
+ headers?: Record<string, string>;
11
+ }
12
+ /** Configuration for the Airstore client. */
13
+ export interface ClientOptions {
14
+ /**
15
+ * API key for authentication. Defaults to `process.env.AIRSTORE_API_KEY`.
16
+ * Organization tokens start with `org_`, workspace tokens with `tok_`.
17
+ */
18
+ apiKey?: string;
19
+ /**
20
+ * Base URL for the Airstore REST API.
21
+ * @default "https://api.airstore.ai/api/v1" or AIRSTORE_BASE_URL env
22
+ */
23
+ baseURL?: string;
24
+ /**
25
+ * Request timeout in milliseconds.
26
+ * @default 60000
27
+ */
28
+ timeout?: number;
29
+ /**
30
+ * Maximum number of retries for failed requests (429, 5xx).
31
+ * @default 2
32
+ */
33
+ maxRetries?: number;
34
+ /** Default headers added to every request. */
35
+ defaultHeaders?: Record<string, string>;
36
+ }
37
+ /** Metadata attached to every response object. */
38
+ export interface ResponseMeta {
39
+ statusCode: number;
40
+ headers: Headers;
41
+ requestId: string | undefined;
42
+ }
43
+ export declare function attachResponseMeta<T extends object>(obj: T, meta: ResponseMeta): T & {
44
+ lastResponse: ResponseMeta;
45
+ };
46
+ /**
47
+ * Core HTTP client for the Airstore API.
48
+ *
49
+ * Handles authentication, automatic retries with exponential backoff,
50
+ * timeout, and per-request option overrides.
51
+ */
52
+ export declare class CoreClient {
53
+ readonly apiKey: string;
54
+ readonly baseURL: string;
55
+ readonly timeout: number;
56
+ readonly maxRetries: number;
57
+ readonly defaultHeaders: Record<string, string>;
58
+ constructor(opts?: ClientOptions);
59
+ /** Make an API request with retry and timeout. */
60
+ request<T>(method: string, path: string, body?: unknown, params?: Record<string, string>, reqOpts?: RequestOptions): Promise<T & {
61
+ lastResponse: ResponseMeta;
62
+ }>;
63
+ /**
64
+ * Build full URL with query params.
65
+ *
66
+ * Uses string concatenation to preserve the base path prefix (e.g. `/api/v1`).
67
+ * `new URL(path, base)` would resolve absolute paths against the origin,
68
+ * dropping the base path — so we avoid it.
69
+ */
70
+ private _buildURL;
71
+ /** Build request headers. */
72
+ private _buildHeaders;
73
+ /** Calculate backoff with jitter. */
74
+ private _backoffMs;
75
+ /** Sleep helper. */
76
+ private _sleep;
77
+ /**
78
+ * Make a raw HTTP request to any API path.
79
+ * Escape hatch for endpoints not yet covered by the SDK.
80
+ */
81
+ rawRequest(method: string, path: string, opts?: {
82
+ body?: unknown;
83
+ params?: Record<string, string>;
84
+ } & RequestOptions): Promise<Response>;
85
+ }
86
+ //# sourceMappingURL=client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/client.ts"],"names":[],"mappings":"AAQA,sF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AC5C,OAAO,CAAC,CAAC,EACb,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,EACZ,IAAI,CAAC,EAAE,OAAO,EACd,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC/B,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,CAAC,GAAG;QAAE,YAAY,EAAE,YAAY,CAAA;KAAE,CAAC;IAqG9C;;;;;;OAMG;IACH,OAAO,CAAC,SAAS;IAajB,6BAA6B;IAC7B,OAAO,CAAC,aAAa;IAUrB,qCAAqC;IACrC,OAAO,CAAC,UAAU;IAsBlB,oBAAoB;IACpB,OAAO,CAAC,MAAM;IAId;;;OAGG;IACG,UAAU,CACd,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,EACZ,IAAI,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,OAAO,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;KAAE,GAAG,cAAc,GAC1E,OAAO,CAAC,QAAQ,CAAC;CA8BrB"}
@@ -0,0 +1,61 @@
1
+ /**
2
+ * Base error for all Airstore SDK errors.
3
+ */
4
+ export declare class AirstoreError extends Error {
5
+ readonly cause?: unknown | undefined;
6
+ constructor(message: string, cause?: unknown | undefined);
7
+ }
8
+ /**
9
+ * Error returned by the Airstore API.
10
+ *
11
+ * Contains the HTTP status code, response headers, and optional request ID
12
+ * for debugging. Use the semantic subclasses (AuthenticationError, NotFoundError, etc.)
13
+ * for targeted catch blocks.
14
+ */
15
+ export declare class APIError extends AirstoreError {
16
+ readonly status: number;
17
+ readonly headers: Headers;
18
+ readonly requestId: string | undefined;
19
+ constructor(status: number, message: string, headers: Headers, requestId: string | undefined);
20
+ /**
21
+ * Generate the appropriate APIError subclass for a given HTTP status.
22
+ */
23
+ static generate(status: number, errorBody: unknown, message: string, headers: Headers): APIError;
24
+ }
25
+ /** 401 - Invalid or missing API key. */
26
+ export declare class AuthenticationError extends APIError {
27
+ constructor(message: string, headers: Headers, requestId: string | undefined);
28
+ }
29
+ /** 403 - Token lacks permission for this operation. */
30
+ export declare class PermissionDeniedError extends APIError {
31
+ constructor(message: string, headers: Headers, requestId: string | undefined);
32
+ }
33
+ /** 404 - Resource not found. */
34
+ export declare class NotFoundError extends APIError {
35
+ constructor(message: string, headers: Headers, requestId: string | undefined);
36
+ }
37
+ /** 409 - Conflicting operation. */
38
+ export declare class ConflictError extends APIError {
39
+ constructor(message: string, headers: Headers, requestId: string | undefined);
40
+ }
41
+ /** 422 - Validation failed. */
42
+ export declare class UnprocessableEntityError extends APIError {
43
+ constructor(message: string, headers: Headers, requestId: string | undefined);
44
+ }
45
+ /** 429 - Rate limit exceeded. Retry after the period indicated by Retry-After header. */
46
+ export declare class RateLimitError extends APIError {
47
+ constructor(message: string, headers: Headers, requestId: string | undefined);
48
+ }
49
+ /** 5xx - Server-side error. Safe to retry with backoff. */
50
+ export declare class InternalServerError extends APIError {
51
+ constructor(status: number, message: string, headers: Headers, requestId: string | undefined);
52
+ }
53
+ /** Network-level connection failure (DNS, TCP, TLS). */
54
+ export declare class APIConnectionError extends AirstoreError {
55
+ constructor(message: string, cause?: unknown);
56
+ }
57
+ /** Request timed out. */
58
+ export declare class APIConnectionTimeoutError extends APIConnectionError {
59
+ constructor(message?: string);
60
+ }
61
+ //# sourceMappingURL=errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/errors.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,qBAAa,aAAc,SAAQ,KAAK;aACO,KAAK,CAAC,EAAE,OAAO;gBAAhD,OAAO,EAAE,MAAM,EAAkB,KAAK,CAAC,EAAE,OAAO,YAAA;CAI7D;AAED;;;;;;GAMG;AACH,qBAAa,QAAS,SAAQ,aAAa;IACzC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,OAAO,EAAE,OAAO,CAA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AAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,GAAG,SAAS;CAI7F;AAED,wDAAwD;AACxD,qBAAa,kBAAmB,SAAQ,aAAa;gBACvC,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,OAAO;CAI7C;AAED,yBAAyB;AACzB,qBAAa,yBAA0B,SAAQ,kBAAkB;gBACnD,OAAO,GAAE,MAA4B;CAIlD"}
@@ -0,0 +1,21 @@
1
+ /** @module @airstore/sdk */
2
+ export { Airstore, Airstore as default } from './airstore.js';
3
+ export type { ClientOptions, RequestOptions, ResponseMeta } from './client.js';
4
+ export { AirstoreError, APIError, AuthenticationError, PermissionDeniedError, NotFoundError, ConflictError, UnprocessableEntityError, RateLimitError, InternalServerError, APIConnectionError, APIConnectionTimeoutError, } from './errors.js';
5
+ export { Workspaces } from './resources/workspaces.js';
6
+ export { Connections } from './resources/connections.js';
7
+ export { SmartFolders } from './resources/smart-folders.js';
8
+ export { Tokens } from './resources/tokens.js';
9
+ export { Members } from './resources/members.js';
10
+ export { OAuth } from './resources/oauth.js';
11
+ export { Filesystem } from './resources/filesystem.js';
12
+ export type { PaginatedList, IntegrationType, MemberRole, OutputFormat } from './types/shared.js';
13
+ export type { Workspace, WorkspaceCreateParams } from './types/workspaces.js';
14
+ export type { Connection, ConnectionCreateParams } from './types/connections.js';
15
+ export type { SmartFolder, SmartFolderCreateParams, SmartFolderUpdateParams } from './types/smart-folders.js';
16
+ export type { Token, TokenCreateParams, TokenCreated } from './types/tokens.js';
17
+ export type { Member, MemberCreateParams } from './types/members.js';
18
+ export type { OAuthSession, OAuthSessionCreateParams, OAuthSessionStatus, OAuthPollOptions } from './types/oauth.js';
19
+ export type { VirtualFile, DirectoryListing, TreeListing } from './types/filesystem.js';
20
+ export { VERSION } from './version.js';
21
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":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E,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACrH,YAAY,EAAE,WAAW,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAGxF,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC"}
@@ -0,0 +1,50 @@
1
+ import type { CoreClient, RequestOptions } from '../client.js';
2
+ import type { Connection, ConnectionCreateParams } from '../types/connections.js';
3
+ /**
4
+ * Manage connections (integrations) within a workspace.
5
+ *
6
+ * Connections store OAuth tokens or API keys for external services like
7
+ * Gmail, GitHub, Notion, etc. Pass existing tokens directly to avoid
8
+ * requiring users to re-authenticate.
9
+ *
10
+ * @example
11
+ * ```ts
12
+ * await airstore.connections.create("ws_abc", {
13
+ * integrationType: "gmail",
14
+ * accessToken: existingAccessToken,
15
+ * refreshToken: existingRefreshToken,
16
+ * });
17
+ * ```
18
+ */
19
+ export declare class Connections {
20
+ private readonly client;
21
+ constructor(client: CoreClient);
22
+ /**
23
+ * Create a connection by passing existing OAuth credentials or API keys.
24
+ *
25
+ * @param workspaceId - Workspace external ID.
26
+ * @param params - Connection creation parameters.
27
+ * @param options - Per-request overrides.
28
+ * @returns The created connection.
29
+ */
30
+ create(workspaceId: string, params: ConnectionCreateParams, options?: RequestOptions): Promise<Connection>;
31
+ /**
32
+ * List all connections in a workspace.
33
+ *
34
+ * @param workspaceId - Workspace external ID.
35
+ * @param options - Per-request overrides.
36
+ * @returns Array of connections.
37
+ */
38
+ list(workspaceId: string, options?: RequestOptions): Promise<Connection[]>;
39
+ /**
40
+ * Delete a connection.
41
+ *
42
+ * @param workspaceId - Workspace external ID.
43
+ * @param connectionId - Connection external ID.
44
+ * @param options - Per-request overrides.
45
+ *
46
+ * @throws {NotFoundError} If the connection doesn't exist.
47
+ */
48
+ del(workspaceId: string, connectionId: string, options?: RequestOptions): Promise<void>;
49
+ }
50
+ //# sourceMappingURL=connections.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"connections.d.ts","sourceRoot":"","sources":["../../../src/resources/connections.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC/D,OAAO,KAAK,EAAE,UAAU,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AAElF;;;;;;;;;;;;;;;GAeG;AACH,qBAAa,WAAW;IACV,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,UAAU;IAE/C;;;;;;;OAOG;IACG,MAAM,CACV,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,sBAAsB,EAC9B,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,UAAU,CAAC;IAmBtB;;;;;;OAMG;IACG,IAAI,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC;IAWhF;;;;;;;;OAQG;IACG,GAAG,CACP,WAAW,EAAE,MAAM,EACnB,YAAY,EAAE,MAAM,EACpB,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,IAAI,CAAC;CASjB"}
@@ -0,0 +1,81 @@
1
+ import type { CoreClient, RequestOptions } from '../client.js';
2
+ import type { VirtualFile, TreeListing } from '../types/filesystem.js';
3
+ /**
4
+ * Read-only access to the workspace virtual filesystem.
5
+ *
6
+ * The filesystem provides a unified view of all connected integrations,
7
+ * smart folders, tools, and user-uploaded files.
8
+ *
9
+ * @example
10
+ * ```ts
11
+ * const listing = await airstore.fs.list("ws_abc", { path: "/" });
12
+ * const content = await airstore.fs.read("ws_abc", {
13
+ * path: "/Sources/gmail/inbox/email.txt",
14
+ * });
15
+ * ```
16
+ */
17
+ export declare class Filesystem {
18
+ private readonly client;
19
+ constructor(client: CoreClient);
20
+ /**
21
+ * List directory contents.
22
+ *
23
+ * @param workspaceId - Workspace external ID.
24
+ * @param opts - Listing options.
25
+ * @param opts.path - Directory path to list. Defaults to root.
26
+ * @param options - Per-request overrides.
27
+ * @returns Array of files and directories.
28
+ */
29
+ list(workspaceId: string, opts?: {
30
+ path?: string;
31
+ }, options?: RequestOptions): Promise<VirtualFile[]>;
32
+ /**
33
+ * Read file contents as a string.
34
+ *
35
+ * @param workspaceId - Workspace external ID.
36
+ * @param opts - Read options.
37
+ * @param opts.path - File path to read.
38
+ * @param opts.offset - Byte offset to start reading from.
39
+ * @param opts.length - Number of bytes to read.
40
+ * @param options - Per-request overrides.
41
+ * @returns File contents as a string.
42
+ *
43
+ * @throws {NotFoundError} If the file doesn't exist.
44
+ */
45
+ read(workspaceId: string, opts: {
46
+ path: string;
47
+ offset?: number;
48
+ length?: number;
49
+ }, options?: RequestOptions): Promise<string>;
50
+ /**
51
+ * Get a directory tree for efficient prefetching.
52
+ *
53
+ * Returns a flat list of all entries under the given path. Supports
54
+ * pagination via `continuationToken` for large directories.
55
+ *
56
+ * @param workspaceId - Workspace external ID.
57
+ * @param opts - Tree options.
58
+ * @param opts.path - Root path for the tree. Defaults to root.
59
+ * @param opts.maxKeys - Maximum number of entries to return.
60
+ * @param opts.continuationToken - Token from a previous truncated response.
61
+ * @param options - Per-request overrides.
62
+ * @returns Tree listing with entries and pagination info.
63
+ */
64
+ tree(workspaceId: string, opts?: {
65
+ path?: string;
66
+ maxKeys?: number;
67
+ continuationToken?: string;
68
+ }, options?: RequestOptions): Promise<TreeListing>;
69
+ /**
70
+ * Get file or directory metadata.
71
+ *
72
+ * @param workspaceId - Workspace external ID.
73
+ * @param path - Absolute path to stat.
74
+ * @param options - Per-request overrides.
75
+ * @returns File metadata.
76
+ *
77
+ * @throws {NotFoundError} If the path doesn't exist.
78
+ */
79
+ stat(workspaceId: string, path: string, options?: RequestOptions): Promise<VirtualFile>;
80
+ }
81
+ //# sourceMappingURL=filesystem.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"filesystem.d.ts","sourceRoot":"","sources":["../../../src/resources/filesystem.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC/D,OAAO,KAAK,EAAE,WAAW,EAAoB,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAEzF;;;;;;;;;;;;;GAaG;AACH,qBAAa,UAAU;IACT,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,UAAU;IAE/C;;;;;;;;OAQG;IACG,IAAI,CACR,WAAW,EAAE,MAAM,EACnB,IAAI,GAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAA;KAAO,EAC5B,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,WAAW,EAAE,CAAC;IAczB;;;;;;;;;;;;OAYG;IACG,IAAI,CACR,WAAW,EAAE,MAAM,EACnB,IAAI,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,EACxD,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,MAAM,CAAC;IAalB;;;;;;;;;;;;;OAaG;IACG,IAAI,CACR,WAAW,EAAE,MAAM,EACnB,IAAI,GAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAC;QAAC,iBAAiB,CAAC,EAAE,MAAM,CAAA;KAAO,EAC1E,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,WAAW,CAAC;IAiBvB;;;;;;;;;OASG;IACG,IAAI,CACR,WAAW,EAAE,MAAM,EACnB,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,WAAW,CAAC;CASxB"}
@@ -0,0 +1,8 @@
1
+ export { Workspaces } from './workspaces.js';
2
+ export { Connections } from './connections.js';
3
+ export { SmartFolders } from './smart-folders.js';
4
+ export { Tokens } from './tokens.js';
5
+ export { Members } from './members.js';
6
+ export { OAuth } from './oauth.js';
7
+ export { Filesystem } from './filesystem.js';
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/resources/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC"}