@linear/sdk 2.4.0 → 2.6.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/dist/index-umd.js CHANGED
@@ -1,11 +1,15 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
3
- typeof define === 'function' && define.amd ? define(['exports'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.Linear = {}));
5
- })(this, (function (exports) { 'use strict';
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('crypto')) :
3
+ typeof define === 'function' && define.amd ? define(['exports', 'crypto'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.Linear = {}, global.crypto));
5
+ })(this, (function (exports, crypto) { 'use strict';
6
+
7
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
8
+
9
+ var crypto__default = /*#__PURE__*/_interopDefaultLegacy(crypto);
6
10
 
7
11
  (function() {
8
- const env = {"npm_package_name":"@linear/sdk","npm_package_version":"2.4.0"};
12
+ const env = {"npm_package_name":"@linear/sdk","npm_package_version":"2.6.0"};
9
13
  try {
10
14
  if (process) {
11
15
  process.env = Object.assign({}, process.env);
@@ -1938,45 +1942,6 @@
1938
1942
  ...GithubOrgFragmentDoc.definitions,
1939
1943
  ],
1940
1944
  };
1941
- const OauthClientFragmentDoc = {
1942
- kind: "Document",
1943
- definitions: [
1944
- {
1945
- kind: "FragmentDefinition",
1946
- name: { kind: "Name", value: "OauthClient" },
1947
- typeCondition: { kind: "NamedType", name: { kind: "Name", value: "OauthClient" } },
1948
- selectionSet: {
1949
- kind: "SelectionSet",
1950
- selections: [
1951
- { kind: "Field", name: { kind: "Name", value: "__typename" } },
1952
- { kind: "Field", name: { kind: "Name", value: "imageUrl" } },
1953
- { kind: "Field", name: { kind: "Name", value: "description" } },
1954
- { kind: "Field", name: { kind: "Name", value: "redirectUris" } },
1955
- { kind: "Field", name: { kind: "Name", value: "developer" } },
1956
- { kind: "Field", name: { kind: "Name", value: "clientId" } },
1957
- { kind: "Field", name: { kind: "Name", value: "name" } },
1958
- { kind: "Field", name: { kind: "Name", value: "clientSecret" } },
1959
- { kind: "Field", name: { kind: "Name", value: "updatedAt" } },
1960
- { kind: "Field", name: { kind: "Name", value: "webhookResourceTypes" } },
1961
- { kind: "Field", name: { kind: "Name", value: "archivedAt" } },
1962
- { kind: "Field", name: { kind: "Name", value: "createdAt" } },
1963
- { kind: "Field", name: { kind: "Name", value: "id" } },
1964
- {
1965
- kind: "Field",
1966
- name: { kind: "Name", value: "creator" },
1967
- selectionSet: {
1968
- kind: "SelectionSet",
1969
- selections: [{ kind: "Field", name: { kind: "Name", value: "id" } }],
1970
- },
1971
- },
1972
- { kind: "Field", name: { kind: "Name", value: "developerUrl" } },
1973
- { kind: "Field", name: { kind: "Name", value: "webhookUrl" } },
1974
- { kind: "Field", name: { kind: "Name", value: "publicEnabled" } },
1975
- ],
1976
- },
1977
- },
1978
- ],
1979
- };
1980
1945
  const UserAuthorizedApplicationFragmentDoc = {
1981
1946
  kind: "Document",
1982
1947
  definitions: [
@@ -2419,54 +2384,6 @@
2419
2384
  },
2420
2385
  ],
2421
2386
  };
2422
- const AdminJobConfigurationPayloadFragmentDoc = {
2423
- kind: "Document",
2424
- definitions: [
2425
- {
2426
- kind: "FragmentDefinition",
2427
- name: { kind: "Name", value: "AdminJobConfigurationPayload" },
2428
- typeCondition: { kind: "NamedType", name: { kind: "Name", value: "AdminJobConfigurationPayload" } },
2429
- selectionSet: {
2430
- kind: "SelectionSet",
2431
- selections: [
2432
- { kind: "Field", name: { kind: "Name", value: "__typename" } },
2433
- { kind: "Field", name: { kind: "Name", value: "currentJob" } },
2434
- { kind: "Field", name: { kind: "Name", value: "delay" } },
2435
- { kind: "Field", name: { kind: "Name", value: "enabled" } },
2436
- { kind: "Field", name: { kind: "Name", value: "param" } },
2437
- ],
2438
- },
2439
- },
2440
- ],
2441
- };
2442
- const AdminJobStatusPayloadFragmentDoc = {
2443
- kind: "Document",
2444
- definitions: [
2445
- {
2446
- kind: "FragmentDefinition",
2447
- name: { kind: "Name", value: "AdminJobStatusPayload" },
2448
- typeCondition: { kind: "NamedType", name: { kind: "Name", value: "AdminJobStatusPayload" } },
2449
- selectionSet: {
2450
- kind: "SelectionSet",
2451
- selections: [
2452
- { kind: "Field", name: { kind: "Name", value: "__typename" } },
2453
- { kind: "Field", name: { kind: "Name", value: "availableJobs" } },
2454
- {
2455
- kind: "Field",
2456
- name: { kind: "Name", value: "configuration" },
2457
- selectionSet: {
2458
- kind: "SelectionSet",
2459
- selections: [{ kind: "FragmentSpread", name: { kind: "Name", value: "AdminJobConfigurationPayload" } }],
2460
- },
2461
- },
2462
- { kind: "Field", name: { kind: "Name", value: "cursor" } },
2463
- { kind: "Field", name: { kind: "Name", value: "startedAt" } },
2464
- ],
2465
- },
2466
- },
2467
- ...AdminJobConfigurationPayloadFragmentDoc.definitions,
2468
- ],
2469
- };
2470
2387
  const ApiKeyFragmentDoc = {
2471
2388
  kind: "Document",
2472
2389
  definitions: [
@@ -2844,6 +2761,7 @@
2844
2761
  { kind: "Field", name: { kind: "Name", value: "deletionRequestedAt" } },
2845
2762
  { kind: "Field", name: { kind: "Name", value: "archivedAt" } },
2846
2763
  { kind: "Field", name: { kind: "Name", value: "createdAt" } },
2764
+ { kind: "Field", name: { kind: "Name", value: "trialEndsAt" } },
2847
2765
  { kind: "Field", name: { kind: "Name", value: "id" } },
2848
2766
  { kind: "Field", name: { kind: "Name", value: "samlEnabled" } },
2849
2767
  { kind: "Field", name: { kind: "Name", value: "scimEnabled" } },
@@ -5333,6 +5251,80 @@
5333
5251
  ...NotificationSubscriptionFragmentDoc.definitions,
5334
5252
  ],
5335
5253
  };
5254
+ const OauthClientFragmentDoc = {
5255
+ kind: "Document",
5256
+ definitions: [
5257
+ {
5258
+ kind: "FragmentDefinition",
5259
+ name: { kind: "Name", value: "OauthClient" },
5260
+ typeCondition: { kind: "NamedType", name: { kind: "Name", value: "OauthClient" } },
5261
+ selectionSet: {
5262
+ kind: "SelectionSet",
5263
+ selections: [
5264
+ { kind: "Field", name: { kind: "Name", value: "__typename" } },
5265
+ { kind: "Field", name: { kind: "Name", value: "imageUrl" } },
5266
+ { kind: "Field", name: { kind: "Name", value: "description" } },
5267
+ { kind: "Field", name: { kind: "Name", value: "redirectUris" } },
5268
+ { kind: "Field", name: { kind: "Name", value: "developer" } },
5269
+ { kind: "Field", name: { kind: "Name", value: "clientId" } },
5270
+ { kind: "Field", name: { kind: "Name", value: "name" } },
5271
+ { kind: "Field", name: { kind: "Name", value: "clientSecret" } },
5272
+ { kind: "Field", name: { kind: "Name", value: "updatedAt" } },
5273
+ { kind: "Field", name: { kind: "Name", value: "webhookResourceTypes" } },
5274
+ { kind: "Field", name: { kind: "Name", value: "archivedAt" } },
5275
+ { kind: "Field", name: { kind: "Name", value: "createdAt" } },
5276
+ { kind: "Field", name: { kind: "Name", value: "id" } },
5277
+ {
5278
+ kind: "Field",
5279
+ name: { kind: "Name", value: "creator" },
5280
+ selectionSet: {
5281
+ kind: "SelectionSet",
5282
+ selections: [{ kind: "Field", name: { kind: "Name", value: "id" } }],
5283
+ },
5284
+ },
5285
+ { kind: "Field", name: { kind: "Name", value: "developerUrl" } },
5286
+ { kind: "Field", name: { kind: "Name", value: "webhookUrl" } },
5287
+ { kind: "Field", name: { kind: "Name", value: "webhookSecret" } },
5288
+ { kind: "Field", name: { kind: "Name", value: "publicEnabled" } },
5289
+ ],
5290
+ },
5291
+ },
5292
+ ],
5293
+ };
5294
+ const OauthClientConnectionFragmentDoc = {
5295
+ kind: "Document",
5296
+ definitions: [
5297
+ {
5298
+ kind: "FragmentDefinition",
5299
+ name: { kind: "Name", value: "OauthClientConnection" },
5300
+ typeCondition: { kind: "NamedType", name: { kind: "Name", value: "OauthClientConnection" } },
5301
+ selectionSet: {
5302
+ kind: "SelectionSet",
5303
+ selections: [
5304
+ { kind: "Field", name: { kind: "Name", value: "__typename" } },
5305
+ {
5306
+ kind: "Field",
5307
+ name: { kind: "Name", value: "nodes" },
5308
+ selectionSet: {
5309
+ kind: "SelectionSet",
5310
+ selections: [{ kind: "FragmentSpread", name: { kind: "Name", value: "OauthClient" } }],
5311
+ },
5312
+ },
5313
+ {
5314
+ kind: "Field",
5315
+ name: { kind: "Name", value: "pageInfo" },
5316
+ selectionSet: {
5317
+ kind: "SelectionSet",
5318
+ selections: [{ kind: "FragmentSpread", name: { kind: "Name", value: "PageInfo" } }],
5319
+ },
5320
+ },
5321
+ ],
5322
+ },
5323
+ },
5324
+ ...OauthClientFragmentDoc.definitions,
5325
+ ...PageInfoFragmentDoc.definitions,
5326
+ ],
5327
+ };
5336
5328
  const OrganizationCancelDeletePayloadFragmentDoc = {
5337
5329
  kind: "Document",
5338
5330
  definitions: [
@@ -9993,6 +9985,54 @@
9993
9985
  ...IntegrationPayloadFragmentDoc.definitions,
9994
9986
  ],
9995
9987
  };
9988
+ const IntegrationSlackIntakeDocument = {
9989
+ kind: "Document",
9990
+ definitions: [
9991
+ {
9992
+ kind: "OperationDefinition",
9993
+ operation: "mutation",
9994
+ name: { kind: "Name", value: "integrationSlackIntake" },
9995
+ variableDefinitions: [
9996
+ {
9997
+ kind: "VariableDefinition",
9998
+ variable: { kind: "Variable", name: { kind: "Name", value: "code" } },
9999
+ type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "String" } } },
10000
+ },
10001
+ {
10002
+ kind: "VariableDefinition",
10003
+ variable: { kind: "Variable", name: { kind: "Name", value: "redirectUri" } },
10004
+ type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "String" } } },
10005
+ },
10006
+ ],
10007
+ selectionSet: {
10008
+ kind: "SelectionSet",
10009
+ selections: [
10010
+ {
10011
+ kind: "Field",
10012
+ name: { kind: "Name", value: "integrationSlackIntake" },
10013
+ arguments: [
10014
+ {
10015
+ kind: "Argument",
10016
+ name: { kind: "Name", value: "code" },
10017
+ value: { kind: "Variable", name: { kind: "Name", value: "code" } },
10018
+ },
10019
+ {
10020
+ kind: "Argument",
10021
+ name: { kind: "Name", value: "redirectUri" },
10022
+ value: { kind: "Variable", name: { kind: "Name", value: "redirectUri" } },
10023
+ },
10024
+ ],
10025
+ selectionSet: {
10026
+ kind: "SelectionSet",
10027
+ selections: [{ kind: "FragmentSpread", name: { kind: "Name", value: "IntegrationPayload" } }],
10028
+ },
10029
+ },
10030
+ ],
10031
+ },
10032
+ },
10033
+ ...IntegrationPayloadFragmentDoc.definitions,
10034
+ ],
10035
+ };
9996
10036
  const IntegrationSlackOrgProjectUpdatesPostDocument = {
9997
10037
  kind: "Document",
9998
10038
  definitions: [
@@ -26640,7 +26680,6 @@
26640
26680
  GithubRepoFragmentDoc: GithubRepoFragmentDoc,
26641
26681
  GithubOrgFragmentDoc: GithubOrgFragmentDoc,
26642
26682
  GithubOAuthTokenPayloadFragmentDoc: GithubOAuthTokenPayloadFragmentDoc,
26643
- OauthClientFragmentDoc: OauthClientFragmentDoc,
26644
26683
  UserAuthorizedApplicationFragmentDoc: UserAuthorizedApplicationFragmentDoc,
26645
26684
  ApplicationFragmentDoc: ApplicationFragmentDoc,
26646
26685
  FrontSettingsFragmentDoc: FrontSettingsFragmentDoc,
@@ -26657,8 +26696,6 @@
26657
26696
  IntegrationSettingsFragmentDoc: IntegrationSettingsFragmentDoc,
26658
26697
  SamlConfigurationPayloadFragmentDoc: SamlConfigurationPayloadFragmentDoc,
26659
26698
  UserSettingsFragmentDoc: UserSettingsFragmentDoc,
26660
- AdminJobConfigurationPayloadFragmentDoc: AdminJobConfigurationPayloadFragmentDoc,
26661
- AdminJobStatusPayloadFragmentDoc: AdminJobStatusPayloadFragmentDoc,
26662
26699
  ApiKeyFragmentDoc: ApiKeyFragmentDoc,
26663
26700
  PageInfoFragmentDoc: PageInfoFragmentDoc,
26664
26701
  ApiKeyConnectionFragmentDoc: ApiKeyConnectionFragmentDoc,
@@ -26741,6 +26778,8 @@
26741
26778
  NotificationSubscriptionFragmentDoc: NotificationSubscriptionFragmentDoc,
26742
26779
  NotificationSubscriptionConnectionFragmentDoc: NotificationSubscriptionConnectionFragmentDoc,
26743
26780
  NotificationSubscriptionPayloadFragmentDoc: NotificationSubscriptionPayloadFragmentDoc,
26781
+ OauthClientFragmentDoc: OauthClientFragmentDoc,
26782
+ OauthClientConnectionFragmentDoc: OauthClientConnectionFragmentDoc,
26744
26783
  OrganizationCancelDeletePayloadFragmentDoc: OrganizationCancelDeletePayloadFragmentDoc,
26745
26784
  OrganizationDeletePayloadFragmentDoc: OrganizationDeletePayloadFragmentDoc,
26746
26785
  OrganizationExistsPayloadFragmentDoc: OrganizationExistsPayloadFragmentDoc,
@@ -26868,6 +26907,7 @@
26868
26907
  IntegrationSentryConnectDocument: IntegrationSentryConnectDocument,
26869
26908
  IntegrationSlackDocument: IntegrationSlackDocument,
26870
26909
  IntegrationSlackImportEmojisDocument: IntegrationSlackImportEmojisDocument,
26910
+ IntegrationSlackIntakeDocument: IntegrationSlackIntakeDocument,
26871
26911
  IntegrationSlackOrgProjectUpdatesPostDocument: IntegrationSlackOrgProjectUpdatesPostDocument,
26872
26912
  IntegrationSlackPersonalDocument: IntegrationSlackPersonalDocument,
26873
26913
  IntegrationSlackPostDocument: IntegrationSlackPostDocument,
@@ -27247,38 +27287,6 @@
27247
27287
  return undefined;
27248
27288
  }
27249
27289
  }
27250
- /**
27251
- * AdminJobConfigurationPayload model
27252
- *
27253
- * @param request - function to call the graphql client
27254
- * @param data - L.AdminJobConfigurationPayloadFragment response data
27255
- */
27256
- class AdminJobConfigurationPayload extends Request {
27257
- constructor(request, data) {
27258
- var _a, _b;
27259
- super(request);
27260
- this.currentJob = (_a = data.currentJob) !== null && _a !== void 0 ? _a : undefined;
27261
- this.delay = data.delay;
27262
- this.enabled = data.enabled;
27263
- this.param = (_b = data.param) !== null && _b !== void 0 ? _b : undefined;
27264
- }
27265
- }
27266
- /**
27267
- * AdminJobStatusPayload model
27268
- *
27269
- * @param request - function to call the graphql client
27270
- * @param data - L.AdminJobStatusPayloadFragment response data
27271
- */
27272
- class AdminJobStatusPayload extends Request {
27273
- constructor(request, data) {
27274
- var _a, _b;
27275
- super(request);
27276
- this.availableJobs = data.availableJobs;
27277
- this.cursor = (_a = data.cursor) !== null && _a !== void 0 ? _a : undefined;
27278
- this.startedAt = (_b = parseDate(data.startedAt)) !== null && _b !== void 0 ? _b : undefined;
27279
- this.configuration = new AdminJobConfigurationPayload(request, data.configuration);
27280
- }
27281
- }
27282
27290
  /**
27283
27291
  * An API key. Grants access to the user's resources.
27284
27292
  *
@@ -29457,7 +29465,7 @@
29457
29465
  */
29458
29466
  class OauthClient extends Request {
29459
29467
  constructor(request, data) {
29460
- var _a, _b, _c, _d, _e, _f;
29468
+ var _a, _b, _c, _d, _e, _f, _g;
29461
29469
  super(request);
29462
29470
  this.archivedAt = (_a = parseDate(data.archivedAt)) !== null && _a !== void 0 ? _a : undefined;
29463
29471
  this.clientId = data.clientId;
@@ -29473,7 +29481,8 @@
29473
29481
  this.redirectUris = data.redirectUris;
29474
29482
  this.updatedAt = (_e = parseDate(data.updatedAt)) !== null && _e !== void 0 ? _e : new Date();
29475
29483
  this.webhookResourceTypes = data.webhookResourceTypes;
29476
- this.webhookUrl = (_f = data.webhookUrl) !== null && _f !== void 0 ? _f : undefined;
29484
+ this.webhookSecret = (_f = data.webhookSecret) !== null && _f !== void 0 ? _f : undefined;
29485
+ this.webhookUrl = (_g = data.webhookUrl) !== null && _g !== void 0 ? _g : undefined;
29477
29486
  this._creator = data.creator;
29478
29487
  }
29479
29488
  /** The user who created the OAuthClient. */
@@ -29540,6 +29549,18 @@
29540
29549
  return new UserQuery(this._request).fetch(this._user.id);
29541
29550
  }
29542
29551
  }
29552
+ /**
29553
+ * OauthClientConnection model
29554
+ *
29555
+ * @param request - function to call the graphql client
29556
+ * @param fetch - function to trigger a refetch of this OauthClientConnection model
29557
+ * @param data - OauthClientConnection response data
29558
+ */
29559
+ class OauthClientConnection extends Connection {
29560
+ constructor(request, fetch, data) {
29561
+ super(request, fetch, data.nodes.map(node => new OauthClient(request, node)), new PageInfo(request, data.pageInfo));
29562
+ }
29563
+ }
29543
29564
  /**
29544
29565
  * An organization. Organizations are root-level objects that contain user accounts and teams.
29545
29566
  *
@@ -29548,7 +29569,7 @@
29548
29569
  */
29549
29570
  class Organization extends Request {
29550
29571
  constructor(request, data) {
29551
- var _a, _b, _c, _d, _e, _f;
29572
+ var _a, _b, _c, _d, _e, _f, _g;
29552
29573
  super(request);
29553
29574
  this.allowedAuthServices = data.allowedAuthServices;
29554
29575
  this.archivedAt = (_a = parseDate(data.archivedAt)) !== null && _a !== void 0 ? _a : undefined;
@@ -29567,7 +29588,8 @@
29567
29588
  this.roadmapEnabled = data.roadmapEnabled;
29568
29589
  this.samlEnabled = data.samlEnabled;
29569
29590
  this.scimEnabled = data.scimEnabled;
29570
- this.updatedAt = (_f = parseDate(data.updatedAt)) !== null && _f !== void 0 ? _f : new Date();
29591
+ this.trialEndsAt = (_f = parseDate(data.trialEndsAt)) !== null && _f !== void 0 ? _f : undefined;
29592
+ this.updatedAt = (_g = parseDate(data.updatedAt)) !== null && _g !== void 0 ? _g : new Date();
29571
29593
  this.urlKey = data.urlKey;
29572
29594
  this.userCount = data.userCount;
29573
29595
  this.subscription = data.subscription ? new PaidSubscription(request, data.subscription) : undefined;
@@ -33183,6 +33205,33 @@
33183
33205
  });
33184
33206
  }
33185
33207
  }
33208
+ /**
33209
+ * A fetchable IntegrationSlackIntake Mutation
33210
+ *
33211
+ * @param request - function to call the graphql client
33212
+ */
33213
+ class IntegrationSlackIntakeMutation extends Request {
33214
+ constructor(request) {
33215
+ super(request);
33216
+ }
33217
+ /**
33218
+ * Call the IntegrationSlackIntake mutation and return a IntegrationPayload
33219
+ *
33220
+ * @param code - required code to pass to integrationSlackIntake
33221
+ * @param redirectUri - required redirectUri to pass to integrationSlackIntake
33222
+ * @returns parsed response from IntegrationSlackIntakeMutation
33223
+ */
33224
+ fetch(code, redirectUri) {
33225
+ return __awaiter(this, void 0, void 0, function* () {
33226
+ const response = yield this._request(IntegrationSlackIntakeDocument, {
33227
+ code,
33228
+ redirectUri,
33229
+ });
33230
+ const data = response.integrationSlackIntake;
33231
+ return new IntegrationPayload(this._request, data);
33232
+ });
33233
+ }
33234
+ }
33186
33235
  /**
33187
33236
  * A fetchable IntegrationSlackOrgProjectUpdatesPost Mutation
33188
33237
  *
@@ -40149,6 +40198,16 @@
40149
40198
  integrationSlackImportEmojis(code, redirectUri) {
40150
40199
  return new IntegrationSlackImportEmojisMutation(this._request).fetch(code, redirectUri);
40151
40200
  }
40201
+ /**
40202
+ * Integrates the organization with Slack for issue intake.
40203
+ *
40204
+ * @param code - required code to pass to integrationSlackIntake
40205
+ * @param redirectUri - required redirectUri to pass to integrationSlackIntake
40206
+ * @returns IntegrationPayload
40207
+ */
40208
+ integrationSlackIntake(code, redirectUri) {
40209
+ return new IntegrationSlackIntakeMutation(this._request).fetch(code, redirectUri);
40210
+ }
40152
40211
  /**
40153
40212
  * Slack integration for organization level project update notifications.
40154
40213
  *
@@ -41946,8 +42005,41 @@
41946
42005
  }
41947
42006
  }
41948
42007
 
41949
- exports.AdminJobConfigurationPayload = AdminJobConfigurationPayload;
41950
- exports.AdminJobStatusPayload = AdminJobStatusPayload;
42008
+ const LINEAR_WEBHOOK_SIGNATURE_HEADER = "linear-signature";
42009
+ const LINEAR_WEBHOOK_TS_FIELD = "webhookTimestamp";
42010
+ /**
42011
+ * Provides helper functions to work with Linear webhooks
42012
+ */
42013
+ class LinearWebhooks {
42014
+ constructor(secret) {
42015
+ this.secret = secret;
42016
+ }
42017
+ /**
42018
+ * Verify the webhook signature
42019
+ * @param rawBody The webhook request raw body.
42020
+ * @param signature The signature to verify.
42021
+ * @param timestamp The `webhookTimestamp` field from the request parsed body.
42022
+ */
42023
+ verify(rawBody, signature, timestamp) {
42024
+ const verificationBuffer = Buffer.from(crypto__default["default"].createHmac("sha256", this.secret).update(rawBody).digest("hex"));
42025
+ const signatureBuffer = Buffer.from(signature);
42026
+ if (verificationBuffer.length !== signatureBuffer.length) {
42027
+ throw new Error("Invalid webhook signature");
42028
+ }
42029
+ if (!crypto__default["default"].timingSafeEqual(verificationBuffer, signatureBuffer)) {
42030
+ throw new Error("Invalid webhook signature");
42031
+ }
42032
+ if (timestamp) {
42033
+ const timeDiff = Math.abs(new Date().getTime() - timestamp);
42034
+ // Throw error if more than one minute delta between provided ts and current time
42035
+ if (timeDiff > 1000 * 60) {
42036
+ throw new Error("Invalid webhook timestamp");
42037
+ }
42038
+ }
42039
+ return true;
42040
+ }
42041
+ }
42042
+
41951
42043
  exports.AdministrableTeamsQuery = AdministrableTeamsQuery;
41952
42044
  exports.AirbyteIntegrationConnectMutation = AirbyteIntegrationConnectMutation;
41953
42045
  exports.ApiKey = ApiKey;
@@ -42146,6 +42238,7 @@
42146
42238
  exports.IntegrationSentryConnectMutation = IntegrationSentryConnectMutation;
42147
42239
  exports.IntegrationSettings = IntegrationSettings;
42148
42240
  exports.IntegrationSlackImportEmojisMutation = IntegrationSlackImportEmojisMutation;
42241
+ exports.IntegrationSlackIntakeMutation = IntegrationSlackIntakeMutation;
42149
42242
  exports.IntegrationSlackMutation = IntegrationSlackMutation;
42150
42243
  exports.IntegrationSlackOrgProjectUpdatesPostMutation = IntegrationSlackOrgProjectUpdatesPostMutation;
42151
42244
  exports.IntegrationSlackPersonalMutation = IntegrationSlackPersonalMutation;
@@ -42220,6 +42313,8 @@
42220
42313
  exports.JiraProjectData = JiraProjectData;
42221
42314
  exports.JiraSettings = JiraSettings;
42222
42315
  exports.JoinOrganizationFromOnboardingMutation = JoinOrganizationFromOnboardingMutation;
42316
+ exports.LINEAR_WEBHOOK_SIGNATURE_HEADER = LINEAR_WEBHOOK_SIGNATURE_HEADER;
42317
+ exports.LINEAR_WEBHOOK_TS_FIELD = LINEAR_WEBHOOK_TS_FIELD;
42223
42318
  exports.LeaveOrganizationMutation = LeaveOrganizationMutation;
42224
42319
  exports.LinearClient = LinearClient;
42225
42320
  exports.LinearConnection = LinearConnection;
@@ -42228,6 +42323,7 @@
42228
42323
  exports.LinearGraphQLClient = LinearGraphQLClient;
42229
42324
  exports.LinearGraphQLError = LinearGraphQLError;
42230
42325
  exports.LinearSdk = LinearSdk;
42326
+ exports.LinearWebhooks = LinearWebhooks;
42231
42327
  exports.LockTimeoutLinearError = LockTimeoutLinearError;
42232
42328
  exports.LogoutMutation = LogoutMutation;
42233
42329
  exports.LogoutResponse = LogoutResponse;
@@ -42247,6 +42343,7 @@
42247
42343
  exports.OauthClient = OauthClient;
42248
42344
  exports.OauthClientApproval = OauthClientApproval;
42249
42345
  exports.OauthClientApprovalNotification = OauthClientApprovalNotification;
42346
+ exports.OauthClientConnection = OauthClientConnection;
42250
42347
  exports.Organization = Organization;
42251
42348
  exports.OrganizationCancelDeletePayload = OrganizationCancelDeletePayload;
42252
42349
  exports.OrganizationDeleteChallengeMutation = OrganizationDeleteChallengeMutation;