@crowdstrike/foundry-js 0.14.0 → 0.16.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
@@ -115,6 +115,7 @@ To call API Integration, App should be initially provisioned, and configuration
115
115
  // we assume, that API Integration was created and operation Get Cities exists
116
116
 
117
117
  const apiIntegration = falcon.apiIntegration({
118
+ definitionId: '<api-integration-id from manifest.yml>',
118
119
  operationId: 'Get Cities',
119
120
  });
120
121
 
@@ -128,6 +129,7 @@ To call API Integration, App should be initially provisioned, and configuration
128
129
  }
129
130
  });
130
131
  // response.resources?.[0]?.status_code === 200
132
+ // date is at response.resources[0].response_body
131
133
  });
132
134
  ```
133
135
 
package/dist/api.d.ts CHANGED
@@ -70,7 +70,10 @@ export default class FalconApi<DATA extends LocalData = LocalData> {
70
70
  *
71
71
  * This establishes a connection to send messages between the extension and the Falcon Console. Only when established you will be able to call other APIs.
72
72
  */
73
- connect(): Promise<void>;
73
+ connect(): Promise<{
74
+ origin: string;
75
+ data?: DATA;
76
+ }>;
74
77
  /**
75
78
  * The ID of the Foundry app this UI extension belongs to.
76
79
  */
@@ -103,7 +106,7 @@ export default class FalconApi<DATA extends LocalData = LocalData> {
103
106
  */
104
107
  apiIntegration({ definitionId, operationId, }: {
105
108
  operationId: string;
106
- definitionId?: string;
109
+ definitionId: string;
107
110
  }): ApiIntegration<DATA>;
108
111
  /**
109
112
  * Create a {@link Collection} to write to and query Falcon's custom storage service.
package/dist/index.js CHANGED
@@ -3000,13 +3000,14 @@ class FalconApi {
3000
3000
  async connect() {
3001
3001
  const response = await this.bridge.postMessage({ type: 'connect' });
3002
3002
  if (response !== undefined) {
3003
- const { origin, data } = response;
3003
+ const { data, origin } = response;
3004
3004
  this.bridge.setOrigin(origin);
3005
3005
  this.data = data;
3006
3006
  this.updateTheme(data?.theme);
3007
3007
  this.isConnected = true;
3008
3008
  }
3009
3009
  this.resizeTracker = new ResizeTracker(this.bridge);
3010
+ return response;
3010
3011
  }
3011
3012
  /**
3012
3013
  * The ID of the Foundry app this UI extension belongs to.
@@ -3069,7 +3070,7 @@ class FalconApi {
3069
3070
  }
3070
3071
  const apiIntegration = new ApiIntegration(this, {
3071
3072
  operationId,
3072
- definitionId: definitionId ?? this.data?.app.id,
3073
+ definitionId: definitionId,
3073
3074
  });
3074
3075
  this.apiIntegrations.push(apiIntegration);
3075
3076
  return apiIntegration;