@icepanel/sdk 0.0.42 → 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.
package/README.md CHANGED
@@ -9,8 +9,7 @@ The IcePanel TypeScript library provides convenient access to the IcePanel APIs
9
9
 
10
10
  - [Installation](#installation)
11
11
  - [Reference](#reference)
12
- - [Helpers](#helpers)
13
- - [Usage](#usage)
12
+ - [Getting Started](#getting-started)
14
13
  - [Request and Response Types](#request-and-response-types)
15
14
  - [Exception Handling](#exception-handling)
16
15
  - [Advanced](#advanced)
@@ -27,29 +26,32 @@ The IcePanel TypeScript library provides convenient access to the IcePanel APIs
27
26
  ## Installation
28
27
 
29
28
  ```sh
30
- npm i @icepanel/sdk
29
+ npm i -s @icepanel/sdk
31
30
  ```
32
31
 
33
32
  ## Reference
34
33
 
35
34
  A full reference for this library is available [here](https://github.com/IcePanel/icepanel-js/blob/HEAD/./reference.md).
36
35
 
37
- ## Usage
36
+ ## Getting Started
38
37
 
39
38
  Use the following constant to specify the latest version.
40
39
  ```typescript
41
40
  import { IcePanelClient, LandscapeVersion } from "@icepanel/sdk";
42
41
 
42
+ const landscapeId = "YOUR_LANDSCAPE_ID";
43
+
43
44
  const client = new IcePanelClient({
44
45
  apiKey: "YOUR_API_KEY",
45
46
  apiVersion: "v1"
46
47
  });
47
48
  await client.model.objects.list({
48
- landscapeId: "YOUR_LANDSCAPE_ID",
49
+ landscapeId,
49
50
  versionId: LandscapeVersion.Latest
50
51
  });
51
52
  ```
52
53
 
54
+
53
55
  ## Request and Response Types
54
56
 
55
57
  The SDK exports all request and response types as TypeScript interfaces. Simply import them with the
@@ -43,8 +43,8 @@ function normalizeClientOptions(options) {
43
43
  const headers = (0, headers_js_1.mergeHeaders)({
44
44
  "X-Fern-Language": "JavaScript",
45
45
  "X-Fern-SDK-Name": "@icepanel/sdk",
46
- "X-Fern-SDK-Version": "0.0.38",
47
- "User-Agent": "@icepanel/sdk/0.0.38",
46
+ "X-Fern-SDK-Version": "0.0.43",
47
+ "User-Agent": "@icepanel/sdk/0.0.43",
48
48
  "X-Fern-Runtime": core.RUNTIME.type,
49
49
  "X-Fern-Runtime-Version": core.RUNTIME.version,
50
50
  }, options === null || options === void 0 ? void 0 : options.headers);
@@ -110,36 +110,19 @@ export interface DiagramsListRequest {
110
110
  * {
111
111
  * landscapeId: "landscapeId",
112
112
  * versionId: "versionId",
113
- * index: 1.1,
114
- * modelId: "modelId",
115
- * name: "name",
116
- * type: "app-diagram"
113
+ * body: {
114
+ * index: 1.1,
115
+ * modelId: "modelId",
116
+ * name: "name",
117
+ * type: "app-diagram"
118
+ * }
117
119
  * }
118
120
  */
119
121
  export interface DiagramCreateRequest {
120
122
  landscapeId: string;
121
123
  versionId: string;
122
124
  updateViewedAt?: boolean;
123
- commit?: number;
124
- description?: string;
125
- groupId?: string | null;
126
- index: number;
127
- labels?: Record<string, string>;
128
- /** model object id this object belongs to */
129
- modelId: string;
130
- name: string;
131
- parentId?: string | null;
132
- pinned?: boolean;
133
- pinnedAt?: string;
134
- pinnedIndex?: number;
135
- status?: IcePanel.DiagramStatus;
136
- /** Custom zoom levels for specific model objects within the diagram. The key is the modelObjectId and the value is the diagram id. */
137
- zoomOverrides?: Record<string, string | null> | null;
138
- handleId?: string;
139
- type: IcePanel.DiagramType;
140
- comments?: Record<string, IcePanel.DiagramComment>;
141
- connections?: Record<string, IcePanel.DiagramConnection>;
142
- objects?: Record<string, IcePanel.DiagramObject>;
125
+ body: IcePanel.DiagramCreate;
143
126
  }
144
127
  /**
145
128
  * @example
@@ -161,10 +144,12 @@ export interface DiagramFindRequest {
161
144
  * landscapeId: "landscapeId",
162
145
  * versionId: "versionId",
163
146
  * diagramId: "diagramId",
164
- * index: 1.1,
165
- * modelId: "modelId",
166
- * name: "name",
167
- * type: "app-diagram"
147
+ * body: {
148
+ * index: 1.1,
149
+ * modelId: "modelId",
150
+ * name: "name",
151
+ * type: "app-diagram"
152
+ * }
168
153
  * }
169
154
  */
170
155
  export interface DiagramUpsertRequest {
@@ -172,26 +157,7 @@ export interface DiagramUpsertRequest {
172
157
  versionId: string;
173
158
  diagramId: string;
174
159
  updateViewedAt?: boolean;
175
- commit?: number;
176
- description?: string;
177
- groupId?: string | null;
178
- index: number;
179
- labels?: Record<string, string>;
180
- /** model object id this object belongs to */
181
- modelId: string;
182
- name: string;
183
- parentId?: string | null;
184
- pinned?: boolean;
185
- pinnedAt?: string;
186
- pinnedIndex?: number;
187
- status?: IcePanel.DiagramStatus;
188
- /** Custom zoom levels for specific model objects within the diagram. The key is the modelObjectId and the value is the diagram id. */
189
- zoomOverrides?: Record<string, string | null> | null;
190
- handleId?: string;
191
- type: IcePanel.DiagramType;
192
- comments?: Record<string, IcePanel.DiagramComment>;
193
- connections?: Record<string, IcePanel.DiagramConnection>;
194
- objects?: Record<string, IcePanel.DiagramObject>;
160
+ body: IcePanel.DiagramCreate;
195
161
  }
196
162
  /**
197
163
  * @example
@@ -49,10 +49,12 @@ export declare class DiagramsClient {
49
49
  * await client.diagrams.create({
50
50
  * landscapeId: "landscapeId",
51
51
  * versionId: "versionId",
52
- * index: 1.1,
53
- * modelId: "modelId",
54
- * name: "name",
55
- * type: "app-diagram"
52
+ * body: {
53
+ * index: 1.1,
54
+ * modelId: "modelId",
55
+ * name: "name",
56
+ * type: "app-diagram"
57
+ * }
56
58
  * })
57
59
  */
58
60
  create(request: IcePanel.DiagramCreateRequest, requestOptions?: DiagramsClient.RequestOptions): core.HttpResponsePromise<IcePanel.DiagramsCreateResponse>;
@@ -91,10 +93,12 @@ export declare class DiagramsClient {
91
93
  * landscapeId: "landscapeId",
92
94
  * versionId: "versionId",
93
95
  * diagramId: "diagramId",
94
- * index: 1.1,
95
- * modelId: "modelId",
96
- * name: "name",
97
- * type: "app-diagram"
96
+ * body: {
97
+ * index: 1.1,
98
+ * modelId: "modelId",
99
+ * name: "name",
100
+ * type: "app-diagram"
101
+ * }
98
102
  * })
99
103
  */
100
104
  upsert(request: IcePanel.DiagramUpsertRequest, requestOptions?: DiagramsClient.RequestOptions): core.HttpResponsePromise<IcePanel.DiagramsUpsertResponse>;
@@ -157,10 +157,12 @@ class DiagramsClient {
157
157
  * await client.diagrams.create({
158
158
  * landscapeId: "landscapeId",
159
159
  * versionId: "versionId",
160
- * index: 1.1,
161
- * modelId: "modelId",
162
- * name: "name",
163
- * type: "app-diagram"
160
+ * body: {
161
+ * index: 1.1,
162
+ * modelId: "modelId",
163
+ * name: "name",
164
+ * type: "app-diagram"
165
+ * }
164
166
  * })
165
167
  */
166
168
  create(request, requestOptions) {
@@ -169,7 +171,7 @@ class DiagramsClient {
169
171
  __create(request, requestOptions) {
170
172
  return __awaiter(this, void 0, void 0, function* () {
171
173
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
172
- const { landscapeId, versionId, updateViewedAt } = request, _body = __rest(request, ["landscapeId", "versionId", "updateViewedAt"]);
174
+ const { landscapeId, versionId, updateViewedAt, body: _body } = request;
173
175
  const _queryParams = {};
174
176
  if (updateViewedAt != null) {
175
177
  _queryParams.updateViewedAt = updateViewedAt.toString();
@@ -294,10 +296,12 @@ class DiagramsClient {
294
296
  * landscapeId: "landscapeId",
295
297
  * versionId: "versionId",
296
298
  * diagramId: "diagramId",
297
- * index: 1.1,
298
- * modelId: "modelId",
299
- * name: "name",
300
- * type: "app-diagram"
299
+ * body: {
300
+ * index: 1.1,
301
+ * modelId: "modelId",
302
+ * name: "name",
303
+ * type: "app-diagram"
304
+ * }
301
305
  * })
302
306
  */
303
307
  upsert(request, requestOptions) {
@@ -306,7 +310,7 @@ class DiagramsClient {
306
310
  __upsert(request, requestOptions) {
307
311
  return __awaiter(this, void 0, void 0, function* () {
308
312
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
309
- const { landscapeId, versionId, diagramId, updateViewedAt } = request, _body = __rest(request, ["landscapeId", "versionId", "diagramId", "updateViewedAt"]);
313
+ const { landscapeId, versionId, diagramId, updateViewedAt, body: _body } = request;
310
314
  const _queryParams = {};
311
315
  if (updateViewedAt != null) {
312
316
  _queryParams.updateViewedAt = updateViewedAt.toString();
@@ -1999,6 +1999,28 @@ export interface Diagram {
1999
1999
  version: number;
2000
2000
  versionId: string;
2001
2001
  }
2002
+ export interface DiagramCreate {
2003
+ commit?: number;
2004
+ description?: string;
2005
+ groupId?: string | null;
2006
+ index: number;
2007
+ labels?: Record<string, string>;
2008
+ /** model object id this object belongs to */
2009
+ modelId: string;
2010
+ name: string;
2011
+ parentId?: string | null;
2012
+ pinned?: boolean;
2013
+ pinnedAt?: string;
2014
+ pinnedIndex?: number;
2015
+ status?: IcePanel.DiagramStatus;
2016
+ /** Custom zoom levels for specific model objects within the diagram. The key is the modelObjectId and the value is the diagram id. */
2017
+ zoomOverrides?: Record<string, string | null> | null;
2018
+ handleId?: string;
2019
+ type: IcePanel.DiagramType;
2020
+ comments?: Record<string, IcePanel.DiagramComment>;
2021
+ connections?: Record<string, IcePanel.DiagramConnection>;
2022
+ objects?: Record<string, IcePanel.DiagramObject>;
2023
+ }
2002
2024
  export declare const DiagramObjectShape: {
2003
2025
  readonly Area: "area";
2004
2026
  readonly Box: "box";
@@ -4402,6 +4424,7 @@ export type SearchResultData = IcePanel.ModelObject | IcePanel.ModelConnection |
4402
4424
  export interface SearchResult {
4403
4425
  data?: IcePanel.SearchResultData;
4404
4426
  id: string;
4427
+ name: string;
4405
4428
  score: number;
4406
4429
  type: IcePanel.SearchIndexType;
4407
4430
  }
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "0.0.38";
1
+ export declare const SDK_VERSION = "0.0.43";
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SDK_VERSION = void 0;
4
- exports.SDK_VERSION = "0.0.38";
4
+ exports.SDK_VERSION = "0.0.43";
@@ -6,8 +6,8 @@ export function normalizeClientOptions(options) {
6
6
  const headers = mergeHeaders({
7
7
  "X-Fern-Language": "JavaScript",
8
8
  "X-Fern-SDK-Name": "@icepanel/sdk",
9
- "X-Fern-SDK-Version": "0.0.38",
10
- "User-Agent": "@icepanel/sdk/0.0.38",
9
+ "X-Fern-SDK-Version": "0.0.43",
10
+ "User-Agent": "@icepanel/sdk/0.0.43",
11
11
  "X-Fern-Runtime": core.RUNTIME.type,
12
12
  "X-Fern-Runtime-Version": core.RUNTIME.version,
13
13
  }, options === null || options === void 0 ? void 0 : options.headers);
@@ -110,36 +110,19 @@ export interface DiagramsListRequest {
110
110
  * {
111
111
  * landscapeId: "landscapeId",
112
112
  * versionId: "versionId",
113
- * index: 1.1,
114
- * modelId: "modelId",
115
- * name: "name",
116
- * type: "app-diagram"
113
+ * body: {
114
+ * index: 1.1,
115
+ * modelId: "modelId",
116
+ * name: "name",
117
+ * type: "app-diagram"
118
+ * }
117
119
  * }
118
120
  */
119
121
  export interface DiagramCreateRequest {
120
122
  landscapeId: string;
121
123
  versionId: string;
122
124
  updateViewedAt?: boolean;
123
- commit?: number;
124
- description?: string;
125
- groupId?: string | null;
126
- index: number;
127
- labels?: Record<string, string>;
128
- /** model object id this object belongs to */
129
- modelId: string;
130
- name: string;
131
- parentId?: string | null;
132
- pinned?: boolean;
133
- pinnedAt?: string;
134
- pinnedIndex?: number;
135
- status?: IcePanel.DiagramStatus;
136
- /** Custom zoom levels for specific model objects within the diagram. The key is the modelObjectId and the value is the diagram id. */
137
- zoomOverrides?: Record<string, string | null> | null;
138
- handleId?: string;
139
- type: IcePanel.DiagramType;
140
- comments?: Record<string, IcePanel.DiagramComment>;
141
- connections?: Record<string, IcePanel.DiagramConnection>;
142
- objects?: Record<string, IcePanel.DiagramObject>;
125
+ body: IcePanel.DiagramCreate;
143
126
  }
144
127
  /**
145
128
  * @example
@@ -161,10 +144,12 @@ export interface DiagramFindRequest {
161
144
  * landscapeId: "landscapeId",
162
145
  * versionId: "versionId",
163
146
  * diagramId: "diagramId",
164
- * index: 1.1,
165
- * modelId: "modelId",
166
- * name: "name",
167
- * type: "app-diagram"
147
+ * body: {
148
+ * index: 1.1,
149
+ * modelId: "modelId",
150
+ * name: "name",
151
+ * type: "app-diagram"
152
+ * }
168
153
  * }
169
154
  */
170
155
  export interface DiagramUpsertRequest {
@@ -172,26 +157,7 @@ export interface DiagramUpsertRequest {
172
157
  versionId: string;
173
158
  diagramId: string;
174
159
  updateViewedAt?: boolean;
175
- commit?: number;
176
- description?: string;
177
- groupId?: string | null;
178
- index: number;
179
- labels?: Record<string, string>;
180
- /** model object id this object belongs to */
181
- modelId: string;
182
- name: string;
183
- parentId?: string | null;
184
- pinned?: boolean;
185
- pinnedAt?: string;
186
- pinnedIndex?: number;
187
- status?: IcePanel.DiagramStatus;
188
- /** Custom zoom levels for specific model objects within the diagram. The key is the modelObjectId and the value is the diagram id. */
189
- zoomOverrides?: Record<string, string | null> | null;
190
- handleId?: string;
191
- type: IcePanel.DiagramType;
192
- comments?: Record<string, IcePanel.DiagramComment>;
193
- connections?: Record<string, IcePanel.DiagramConnection>;
194
- objects?: Record<string, IcePanel.DiagramObject>;
160
+ body: IcePanel.DiagramCreate;
195
161
  }
196
162
  /**
197
163
  * @example
@@ -49,10 +49,12 @@ export declare class DiagramsClient {
49
49
  * await client.diagrams.create({
50
50
  * landscapeId: "landscapeId",
51
51
  * versionId: "versionId",
52
- * index: 1.1,
53
- * modelId: "modelId",
54
- * name: "name",
55
- * type: "app-diagram"
52
+ * body: {
53
+ * index: 1.1,
54
+ * modelId: "modelId",
55
+ * name: "name",
56
+ * type: "app-diagram"
57
+ * }
56
58
  * })
57
59
  */
58
60
  create(request: IcePanel.DiagramCreateRequest, requestOptions?: DiagramsClient.RequestOptions): core.HttpResponsePromise<IcePanel.DiagramsCreateResponse>;
@@ -91,10 +93,12 @@ export declare class DiagramsClient {
91
93
  * landscapeId: "landscapeId",
92
94
  * versionId: "versionId",
93
95
  * diagramId: "diagramId",
94
- * index: 1.1,
95
- * modelId: "modelId",
96
- * name: "name",
97
- * type: "app-diagram"
96
+ * body: {
97
+ * index: 1.1,
98
+ * modelId: "modelId",
99
+ * name: "name",
100
+ * type: "app-diagram"
101
+ * }
98
102
  * })
99
103
  */
100
104
  upsert(request: IcePanel.DiagramUpsertRequest, requestOptions?: DiagramsClient.RequestOptions): core.HttpResponsePromise<IcePanel.DiagramsUpsertResponse>;
@@ -121,10 +121,12 @@ export class DiagramsClient {
121
121
  * await client.diagrams.create({
122
122
  * landscapeId: "landscapeId",
123
123
  * versionId: "versionId",
124
- * index: 1.1,
125
- * modelId: "modelId",
126
- * name: "name",
127
- * type: "app-diagram"
124
+ * body: {
125
+ * index: 1.1,
126
+ * modelId: "modelId",
127
+ * name: "name",
128
+ * type: "app-diagram"
129
+ * }
128
130
  * })
129
131
  */
130
132
  create(request, requestOptions) {
@@ -133,7 +135,7 @@ export class DiagramsClient {
133
135
  __create(request, requestOptions) {
134
136
  return __awaiter(this, void 0, void 0, function* () {
135
137
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
136
- const { landscapeId, versionId, updateViewedAt } = request, _body = __rest(request, ["landscapeId", "versionId", "updateViewedAt"]);
138
+ const { landscapeId, versionId, updateViewedAt, body: _body } = request;
137
139
  const _queryParams = {};
138
140
  if (updateViewedAt != null) {
139
141
  _queryParams.updateViewedAt = updateViewedAt.toString();
@@ -258,10 +260,12 @@ export class DiagramsClient {
258
260
  * landscapeId: "landscapeId",
259
261
  * versionId: "versionId",
260
262
  * diagramId: "diagramId",
261
- * index: 1.1,
262
- * modelId: "modelId",
263
- * name: "name",
264
- * type: "app-diagram"
263
+ * body: {
264
+ * index: 1.1,
265
+ * modelId: "modelId",
266
+ * name: "name",
267
+ * type: "app-diagram"
268
+ * }
265
269
  * })
266
270
  */
267
271
  upsert(request, requestOptions) {
@@ -270,7 +274,7 @@ export class DiagramsClient {
270
274
  __upsert(request, requestOptions) {
271
275
  return __awaiter(this, void 0, void 0, function* () {
272
276
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
273
- const { landscapeId, versionId, diagramId, updateViewedAt } = request, _body = __rest(request, ["landscapeId", "versionId", "diagramId", "updateViewedAt"]);
277
+ const { landscapeId, versionId, diagramId, updateViewedAt, body: _body } = request;
274
278
  const _queryParams = {};
275
279
  if (updateViewedAt != null) {
276
280
  _queryParams.updateViewedAt = updateViewedAt.toString();
@@ -1999,6 +1999,28 @@ export interface Diagram {
1999
1999
  version: number;
2000
2000
  versionId: string;
2001
2001
  }
2002
+ export interface DiagramCreate {
2003
+ commit?: number;
2004
+ description?: string;
2005
+ groupId?: string | null;
2006
+ index: number;
2007
+ labels?: Record<string, string>;
2008
+ /** model object id this object belongs to */
2009
+ modelId: string;
2010
+ name: string;
2011
+ parentId?: string | null;
2012
+ pinned?: boolean;
2013
+ pinnedAt?: string;
2014
+ pinnedIndex?: number;
2015
+ status?: IcePanel.DiagramStatus;
2016
+ /** Custom zoom levels for specific model objects within the diagram. The key is the modelObjectId and the value is the diagram id. */
2017
+ zoomOverrides?: Record<string, string | null> | null;
2018
+ handleId?: string;
2019
+ type: IcePanel.DiagramType;
2020
+ comments?: Record<string, IcePanel.DiagramComment>;
2021
+ connections?: Record<string, IcePanel.DiagramConnection>;
2022
+ objects?: Record<string, IcePanel.DiagramObject>;
2023
+ }
2002
2024
  export declare const DiagramObjectShape: {
2003
2025
  readonly Area: "area";
2004
2026
  readonly Box: "box";
@@ -4402,6 +4424,7 @@ export type SearchResultData = IcePanel.ModelObject | IcePanel.ModelConnection |
4402
4424
  export interface SearchResult {
4403
4425
  data?: IcePanel.SearchResultData;
4404
4426
  id: string;
4427
+ name: string;
4405
4428
  score: number;
4406
4429
  type: IcePanel.SearchIndexType;
4407
4430
  }
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "0.0.38";
1
+ export declare const SDK_VERSION = "0.0.43";
@@ -1 +1 @@
1
- export const SDK_VERSION = "0.0.38";
1
+ export const SDK_VERSION = "0.0.43";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@icepanel/sdk",
3
- "version": "0.0.42",
3
+ "version": "0.1.0",
4
4
  "private": false,
5
5
  "repository": {
6
6
  "type": "git",
package/reference.md CHANGED
@@ -398,10 +398,12 @@ await client.diagrams.list({
398
398
  await client.diagrams.create({
399
399
  landscapeId: "landscapeId",
400
400
  versionId: "versionId",
401
- index: 1.1,
402
- modelId: "modelId",
403
- name: "name",
404
- type: "app-diagram"
401
+ body: {
402
+ index: 1.1,
403
+ modelId: "modelId",
404
+ name: "name",
405
+ type: "app-diagram"
406
+ }
405
407
  });
406
408
 
407
409
  ```
@@ -508,10 +510,12 @@ await client.diagrams.upsert({
508
510
  landscapeId: "landscapeId",
509
511
  versionId: "versionId",
510
512
  diagramId: "diagramId",
511
- index: 1.1,
512
- modelId: "modelId",
513
- name: "name",
514
- type: "app-diagram"
513
+ body: {
514
+ index: 1.1,
515
+ modelId: "modelId",
516
+ name: "name",
517
+ type: "app-diagram"
518
+ }
515
519
  });
516
520
 
517
521
  ```