@nr1e/gohighlevel 0.0.0-snapshot-20260118221324 → 0.0.0-snapshot-20260119000508

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 (76) hide show
  1. package/README.md +2 -1
  2. package/dist/client.d.mts +12 -4
  3. package/dist/client.d.mts.map +1 -1
  4. package/dist/client.mjs +23 -0
  5. package/dist/client.mjs.map +1 -1
  6. package/dist/contacts/get-contact.d.mts +95 -0
  7. package/dist/contacts/get-contact.d.mts.map +1 -0
  8. package/dist/contacts/get-contact.mjs +16 -0
  9. package/dist/contacts/get-contact.mjs.map +1 -0
  10. package/dist/contacts/index.d.mts +2 -0
  11. package/dist/contacts/index.d.mts.map +1 -0
  12. package/dist/contacts/index.mjs +2 -0
  13. package/dist/contacts/index.mjs.map +1 -0
  14. package/dist/index.d.mts +0 -1
  15. package/dist/index.d.mts.map +1 -1
  16. package/dist/index.mjs +0 -1
  17. package/dist/index.mjs.map +1 -1
  18. package/dist/{invoice → invoices}/get-invoice.d.mts +10 -9
  19. package/dist/invoices/get-invoice.d.mts.map +1 -0
  20. package/dist/{invoice → invoices}/get-invoice.mjs +2 -2
  21. package/dist/invoices/get-invoice.mjs.map +1 -0
  22. package/dist/invoices/index.d.mts +2 -0
  23. package/dist/invoices/index.d.mts.map +1 -0
  24. package/dist/invoices/index.mjs +2 -0
  25. package/dist/invoices/index.mjs.map +1 -0
  26. package/dist/locations/get-location.d.mts +68 -0
  27. package/dist/locations/get-location.d.mts.map +1 -0
  28. package/dist/locations/get-location.mjs +15 -0
  29. package/dist/locations/get-location.mjs.map +1 -0
  30. package/dist/locations/index.d.mts +2 -0
  31. package/dist/locations/index.d.mts.map +1 -0
  32. package/dist/locations/index.mjs +2 -0
  33. package/dist/locations/index.mjs.map +1 -0
  34. package/dist/oauth/get-access-token.d.mts +26 -0
  35. package/dist/oauth/get-access-token.d.mts.map +1 -0
  36. package/dist/oauth/get-access-token.mjs +48 -0
  37. package/dist/oauth/get-access-token.mjs.map +1 -0
  38. package/dist/oauth/index.d.mts +3 -0
  39. package/dist/oauth/index.d.mts.map +1 -0
  40. package/dist/oauth/index.mjs +3 -0
  41. package/dist/oauth/index.mjs.map +1 -0
  42. package/dist/oauth/refresh-access-token.d.mts +26 -0
  43. package/dist/oauth/refresh-access-token.d.mts.map +1 -0
  44. package/dist/oauth/refresh-access-token.mjs +48 -0
  45. package/dist/oauth/refresh-access-token.mjs.map +1 -0
  46. package/dist/payments/create-custom-provider-config.d.mts +41 -0
  47. package/dist/payments/create-custom-provider-config.d.mts.map +1 -0
  48. package/dist/payments/create-custom-provider-config.mjs +20 -0
  49. package/dist/payments/create-custom-provider-config.mjs.map +1 -0
  50. package/dist/payments/create-custom-provider-integration.d.mts +44 -0
  51. package/dist/payments/create-custom-provider-integration.d.mts.map +1 -0
  52. package/dist/payments/create-custom-provider-integration.mjs +20 -0
  53. package/dist/payments/create-custom-provider-integration.mjs.map +1 -0
  54. package/dist/payments/get-custom-provider-config.d.mts +33 -0
  55. package/dist/payments/get-custom-provider-config.d.mts.map +1 -0
  56. package/dist/payments/get-custom-provider-config.mjs +18 -0
  57. package/dist/payments/get-custom-provider-config.mjs.map +1 -0
  58. package/dist/payments/index.d.mts +5 -0
  59. package/dist/payments/index.d.mts.map +1 -0
  60. package/dist/payments/index.mjs +5 -0
  61. package/dist/payments/index.mjs.map +1 -0
  62. package/dist/payments/send-payment-captured-event.d.mts +25 -0
  63. package/dist/payments/send-payment-captured-event.d.mts.map +1 -0
  64. package/dist/payments/send-payment-captured-event.mjs +19 -0
  65. package/dist/payments/send-payment-captured-event.mjs.map +1 -0
  66. package/package.json +21 -4
  67. package/dist/invoice/get-invoice.d.mts.map +0 -1
  68. package/dist/invoice/get-invoice.mjs.map +0 -1
  69. package/dist/invoice/index.d.mts +0 -3
  70. package/dist/invoice/index.d.mts.map +0 -1
  71. package/dist/invoice/index.mjs +0 -3
  72. package/dist/invoice/index.mjs.map +0 -1
  73. package/dist/invoice/invoice-version.d.mts +0 -2
  74. package/dist/invoice/invoice-version.d.mts.map +0 -1
  75. package/dist/invoice/invoice-version.mjs +0 -2
  76. package/dist/invoice/invoice-version.mjs.map +0 -1
package/README.md CHANGED
@@ -26,7 +26,8 @@ pnpm i @nr1e/gohighlevel
26
26
  Create a client and use it to fetch an invoice
27
27
 
28
28
  ```typescript
29
- import {createGoHighLevelClient, getInvoice} from '@nr1e/gohighlevel';
29
+ import {createGoHighLevelClient} from '@nr1e/gohighlevel';
30
+ import {getInvoice} from '@nr1e/gohighlevel/invoices';
30
31
 
31
32
  const client = createGoHighLevelClient({
32
33
  accessToken: 'YOUR_ACCESS_TOKEN',
package/dist/client.d.mts CHANGED
@@ -1,16 +1,24 @@
1
- export interface GoHighLevelClientConfig {
1
+ export type GoHighLevelClientConfig = {
2
2
  readonly accessToken: string;
3
3
  readonly baseUrl?: string;
4
- }
5
- export interface GetInput {
4
+ };
5
+ export type GetInput = {
6
6
  readonly version: string;
7
7
  readonly path: string;
8
8
  readonly altId?: string;
9
9
  readonly altType?: string;
10
- }
10
+ readonly locationId?: string;
11
+ };
12
+ export type PostInput = {
13
+ readonly version: string;
14
+ readonly path: string;
15
+ readonly locationId?: string;
16
+ readonly body: object;
17
+ };
11
18
  export interface GoHighLevelClient {
12
19
  readonly baseUrl: string;
13
20
  readonly get: <T>(input: GetInput) => Promise<T>;
21
+ readonly post: <T>(input: PostInput) => Promise<T>;
14
22
  }
15
23
  export declare function createGoHighLevelClient(config: GoHighLevelClientConfig): GoHighLevelClient;
16
24
  //# sourceMappingURL=client.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.mts","sourceRoot":"","sources":["../src/client.mts"],"names":[],"mappings":"AAEA,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,MAAM,WAAW,QAAQ;IACvB,QAAQ,CAA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EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,QAAQ,KAAK,OAAO,CAAC,CAAC,CAAC,CAAC;IACjD,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,SAAS,KAAK,OAAO,CAAC,CAAC,CAAC,CAAC;CACpD;AAED,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,uBAAuB,GAC9B,iBAAiB,CA2DnB"}
package/dist/client.mjs CHANGED
@@ -16,6 +16,9 @@ export function createGoHighLevelClient(config) {
16
16
  url.searchParams.append('altType', 'location');
17
17
  }
18
18
  }
19
+ if (input.locationId) {
20
+ url.searchParams.append('locationId', input.locationId);
21
+ }
19
22
  const response = await fetch(url, {
20
23
  headers: {
21
24
  Accept: 'application/json',
@@ -29,9 +32,29 @@ export function createGoHighLevelClient(config) {
29
32
  }
30
33
  return (await response.json());
31
34
  };
35
+ const post = async (input) => {
36
+ const url = new URL(input.path, baseUrl);
37
+ if (input.locationId) {
38
+ url.searchParams.append('locationId', input.locationId);
39
+ }
40
+ const response = await fetch(url, {
41
+ headers: {
42
+ 'Content-Type': 'application/json',
43
+ 'Authorization': `Bearer ${accessToken}`,
44
+ 'Version': input.version,
45
+ },
46
+ method: 'POST',
47
+ body: JSON.stringify(input.body),
48
+ });
49
+ if (!response.ok) {
50
+ await handleError(response);
51
+ }
52
+ return (await response.json());
53
+ };
32
54
  return {
33
55
  baseUrl,
34
56
  get,
57
+ post,
35
58
  };
36
59
  }
37
60
  //# sourceMappingURL=client.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"client.mjs","sourceRoot":"","sources":["../src/client.mts"],"names":[],"mappings":"AAAA,OAAO,EAAC,WAAW,EAAC,MAAM,cAAc,CAAC;AAmBzC,MAAM,UAAU,uBAAuB,CACrC,MAA+B;IAE/B,IAAI,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC;QACxB,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;IAC7C,CAAC;IACD,MAAM,O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IAAI,EAAE,CAAM,CAAC;IACtC,CAAC,CAAC;IAEF,MAAM,IAAI,GAAG,KAAK,EAAM,KAAgB,EAAc,EAAE;QACtD,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,KAAK,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QACzC,IAAI,KAAK,CAAC,UAAU,EAAE,CAAC;YACrB,GAAG,CAAC,YAAY,CAAC,MAAM,CAAC,YAAY,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC;QAC1D,CAAC;QACD,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,GAAG,EAAE;YAChC,OAAO,EAAE;gBACP,cAAc,EAAE,kBAAkB;gBAClC,eAAe,EAAE,UAAU,WAAW,EAAE;gBACxC,SAAS,EAAE,KAAK,CAAC,OAAO;aACzB;YACD,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC;SACjC,CAAC,CAAC;QACH,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;YACjB,MAAM,WAAW,CAAC,QAAQ,CAAC,CAAC;QAC9B,CAAC;QACD,OAAO,CAAC,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAM,CAAC;IACtC,CAAC,CAAC;IAEF,OAAO;QACL,OAAO;QACP,GAAG;QACH,IAAI;KACL,CAAC;AACJ,CAAC"}
@@ -0,0 +1,95 @@
1
+ import { GoHighLevelClient } from '../client.mjs';
2
+ export type GetContactInput = {
3
+ contactId: string;
4
+ };
5
+ export interface DndSetting {
6
+ status: string;
7
+ message?: string;
8
+ code?: string;
9
+ }
10
+ export interface DndSettings {
11
+ Call?: DndSetting;
12
+ Email?: DndSetting;
13
+ SMS?: DndSetting;
14
+ WhatsApp?: DndSetting;
15
+ GMB?: DndSetting;
16
+ FB?: DndSetting;
17
+ }
18
+ export interface CustomField {
19
+ id?: string;
20
+ value?: string;
21
+ }
22
+ export interface AttributionSource {
23
+ url: string;
24
+ campaign?: string;
25
+ utmSource?: string;
26
+ utmMedium?: string;
27
+ utmContent?: string;
28
+ referrer?: string;
29
+ campaignId?: string;
30
+ fbclid?: string;
31
+ gclid?: string;
32
+ msclikid?: string;
33
+ dclid?: string;
34
+ fbc?: string;
35
+ fbp?: string;
36
+ fbEventId?: string;
37
+ userAgent?: string;
38
+ ip?: string;
39
+ medium?: string;
40
+ mediumId?: string;
41
+ }
42
+ export type Contact = {
43
+ id?: string;
44
+ name?: string;
45
+ locationId?: string;
46
+ firstName?: string;
47
+ lastName?: string;
48
+ email?: string;
49
+ emailLowerCase?: string;
50
+ timezone?: string;
51
+ companyName?: string;
52
+ phone?: string;
53
+ dnd?: boolean;
54
+ dndSettings?: DndSettings;
55
+ type?: string;
56
+ source?: string;
57
+ assignedTo?: string;
58
+ address1?: string;
59
+ city?: string;
60
+ state?: string;
61
+ country?: string;
62
+ postalCode?: string;
63
+ website?: string;
64
+ tags?: string[];
65
+ dateOfBirth?: string;
66
+ dateAdded?: string;
67
+ dateUpdated?: string;
68
+ attachments?: string;
69
+ ssn?: string;
70
+ keyword?: string;
71
+ firstNameLowerCase?: string;
72
+ fullNameLowerCase?: string;
73
+ lastNameLowerCase?: string;
74
+ lastActivity?: string;
75
+ customFields?: CustomField[];
76
+ businessId?: string;
77
+ attributionSource?: AttributionSource;
78
+ lastAttributionSource?: AttributionSource;
79
+ visitorId?: string;
80
+ };
81
+ export type GetContactOutput = {
82
+ contact: Contact;
83
+ traceId: string;
84
+ };
85
+ /**
86
+ * Returns a contact by ID.
87
+ *
88
+ * @see https://marketplace.gohighlevel.com/docs/ghl/contacts/get-contact
89
+ * @see https://github.com/GoHighLevel/highlevel-api-sdk/blob/main/lib/code/contacts/models/contacts.ts
90
+ *
91
+ * @param client
92
+ * @param input
93
+ */
94
+ export declare function getContact(client: GoHighLevelClient, input: GetContactInput): Promise<GetContactOutput>;
95
+ //# sourceMappingURL=get-contact.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-contact.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AAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,WAAW,EAAE,CAAC;IAC7B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;IACtC,qBAAqB,CAAC,EAAE,iBAAiB,CAAC;IAC1C,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF;;;;;;;;GAQG;AACH,wBAAsB,UAAU,CAC9B,MAAM,EAAE,iBAAiB,EACzB,KAAK,EAAE,eAAe,GACrB,OAAO,CAAC,gBAAgB,CAAC,CAK3B"}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Returns a contact by ID.
3
+ *
4
+ * @see https://marketplace.gohighlevel.com/docs/ghl/contacts/get-contact
5
+ * @see https://github.com/GoHighLevel/highlevel-api-sdk/blob/main/lib/code/contacts/models/contacts.ts
6
+ *
7
+ * @param client
8
+ * @param input
9
+ */
10
+ export async function getContact(client, input) {
11
+ return client.get({
12
+ version: '2021-07-28',
13
+ path: `/contacts/${input.contactId}`,
14
+ });
15
+ }
16
+ //# sourceMappingURL=get-contact.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-contact.mjs","sourceRoot":"","sources":["../../src/contacts/get-contact.mts"],"names":[],"mappings":"AA4FA;;;;;;;;GAQG;AACH,MAAM,CAAC,KAAK,UAAU,UAAU,CAC9B,MAAyB,EACzB,KAAsB;IAEtB,OAAO,MAAM,CAAC,GAAG,CAAmB;QAClC,OAAO,EAAE,YAAY;QACrB,IAAI,EAAE,aAAa,KAAK,CAAC,SAAS,EAAE;KACrC,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from './get-contact.mjs';
2
+ //# sourceMappingURL=index.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../src/contacts/index.mts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from './get-contact.mjs';
2
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../src/contacts/index.mts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC"}
package/dist/index.d.mts CHANGED
@@ -1,4 +1,3 @@
1
1
  export * from './client.mjs';
2
2
  export * from './errors.mjs';
3
- export * from './invoice/index.mjs';
4
3
  //# sourceMappingURL=index.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../src/index.mts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,qBAAqB,CAAC"}
1
+ {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../src/index.mts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC"}
package/dist/index.mjs CHANGED
@@ -1,4 +1,3 @@
1
1
  export * from './client.mjs';
2
2
  export * from './errors.mjs';
3
- export * from './invoice/index.mjs';
4
3
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../src/index.mts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,qBAAqB,CAAC"}
1
+ {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../src/index.mts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC"}
@@ -3,15 +3,6 @@ export type GetInvoiceInput = {
3
3
  locationId: string;
4
4
  invoiceId: string;
5
5
  };
6
- /**
7
- * Returns an Invoice by ID
8
- * @see https://marketplace.gohighlevel.com/docs/ghl/invoices/get-invoice
9
- * @see https://github.com/GoHighLevel/highlevel-api-sdk/blob/main/lib/code/invoices/models/invoices.ts
10
- *
11
- * @param client
12
- * @param input
13
- */
14
- export declare function getInvoice(client: GoHighLevelClient, input: GetInvoiceInput): Promise<GetInvoiceOutput>;
15
6
  export type GetInvoiceOutput = {
16
7
  _id: string;
17
8
  status: string;
@@ -60,4 +51,14 @@ export interface RemindersConfigurationOutput {
60
51
  [key: string]: unknown;
61
52
  };
62
53
  }
54
+ /**
55
+ * Returns an Invoice by ID
56
+ *
57
+ * @see https://marketplace.gohighlevel.com/docs/ghl/invoices/get-invoice
58
+ * @see https://github.com/GoHighLevel/highlevel-api-sdk/blob/main/lib/code/invoices/models/invoices.ts
59
+ *
60
+ * @param client
61
+ * @param input
62
+ */
63
+ export declare function getInvoice(client: GoHighLevelClient, input: GetInvoiceInput): Promise<GetInvoiceOutput>;
63
64
  //# sourceMappingURL=get-invoice.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-invoice.d.mts","sourceRoot":"","sources":["../../src/invoices/get-invoice.mts"],"names":[],"mappings":"AAAA,OAAO,EAAC,iBAAiB,EAAC,MAAM,eAAe,CAAC;AAEhD,MAAM,MAAM,eAAe,GAAG;IAC5B,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,OAAO,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,eAAe,EAAE;QAAC,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;KAAC,CAAC;IAC1C,aAAa,EAAE,MAAM,CAAC;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,cAAc,EAAE;QAAC,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;KAAC,CAAC;IACzC,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE;QAAC,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;KAAC,CAAC;IACpC,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,wBAAwB,CAAC,EAAE,OAAO,CAAC;IACnC,eAAe,CAAC,EAAE;QAAC,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;KAAC,CAAC;IAC3C,YAAY,EAAE,kBAAkB,CAAC;IACjC,sBAAsB,CAAC,EAAE,4BAA4B,CAAC;CACvD,CAAC;AAEF,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,GAAG,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,4BAA4B;IAC3C,4BAA4B,EAAE;QAC5B,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;KACxB,CAAC;IACF,gBAAgB,EAAE;QAChB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;KACxB,CAAC;CACH;AAED;;;;;;;;GAQG;AACH,wBAAsB,UAAU,CAC9B,MAAM,EAAE,iBAAiB,EACzB,KAAK,EAAE,eAAe,GACrB,OAAO,CAAC,gBAAgB,CAAC,CAM3B"}
@@ -1,6 +1,6 @@
1
- import { INVOICE_API_VERSION } from './invoice-version.mjs';
2
1
  /**
3
2
  * Returns an Invoice by ID
3
+ *
4
4
  * @see https://marketplace.gohighlevel.com/docs/ghl/invoices/get-invoice
5
5
  * @see https://github.com/GoHighLevel/highlevel-api-sdk/blob/main/lib/code/invoices/models/invoices.ts
6
6
  *
@@ -9,7 +9,7 @@ import { INVOICE_API_VERSION } from './invoice-version.mjs';
9
9
  */
10
10
  export async function getInvoice(client, input) {
11
11
  return client.get({
12
- version: INVOICE_API_VERSION,
12
+ version: '2021-07-28',
13
13
  path: `/invoices/${input.invoiceId}`,
14
14
  altId: input.locationId,
15
15
  });
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-invoice.mjs","sourceRoot":"","sources":["../../src/invoices/get-invoice.mts"],"names":[],"mappings":"AAkDA;;;;;;;;GAQG;AACH,MAAM,CAAC,KAAK,UAAU,UAAU,CAC9B,MAAyB,EACzB,KAAsB;IAEtB,OAAO,MAAM,CAAC,GAAG,CAAmB;QAClC,OAAO,EAAE,YAAY;QACrB,IAAI,EAAE,aAAa,KAAK,CAAC,SAAS,EAAE;QACpC,KAAK,EAAE,KAAK,CAAC,UAAU;KACxB,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from './get-invoice.mjs';
2
+ //# sourceMappingURL=index.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../src/invoices/index.mts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from './get-invoice.mjs';
2
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../src/invoices/index.mts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC"}
@@ -0,0 +1,68 @@
1
+ import { GoHighLevelClient } from '../client.mjs';
2
+ export type GetLocationInput = {
3
+ locationId: string;
4
+ };
5
+ export type Business = {
6
+ name?: string;
7
+ address?: string;
8
+ city?: string;
9
+ state?: string;
10
+ country?: string;
11
+ postalCode?: string;
12
+ website?: string;
13
+ timezone?: string;
14
+ logoUrl?: string;
15
+ };
16
+ export type Social = {
17
+ facebookUrl?: string;
18
+ googlePlus?: string;
19
+ linkedIn?: string;
20
+ foursquare?: string;
21
+ twitter?: string;
22
+ yelp?: string;
23
+ instagram?: string;
24
+ youtube?: string;
25
+ pinterest?: string;
26
+ blogRss?: string;
27
+ googlePlacesId?: string;
28
+ };
29
+ export type Settings = {
30
+ allowDuplicateContact?: boolean;
31
+ allowDuplicateOpportunity?: boolean;
32
+ allowFacebookNameMerge?: boolean;
33
+ disableContactTimezone?: boolean;
34
+ };
35
+ export type GetLocationOutput = {
36
+ id?: string;
37
+ companyId?: string;
38
+ name?: string;
39
+ domain?: string;
40
+ address?: string;
41
+ city?: string;
42
+ state?: string;
43
+ logoUrl?: string;
44
+ country?: string;
45
+ postalCode?: string;
46
+ website?: string;
47
+ timezone?: string;
48
+ firstName?: string;
49
+ lastName?: string;
50
+ email?: string;
51
+ phone?: string;
52
+ business?: Business;
53
+ social?: Social;
54
+ settings?: Settings;
55
+ reseller?: {
56
+ [key: string]: unknown;
57
+ };
58
+ };
59
+ /**
60
+ * Returns a Location by ID
61
+ * @see https://marketplace.gohighlevel.com/docs/ghl/locations/get-location
62
+ * @see https://github.com/GoHighLevel/highlevel-api-sdk/blob/main/lib/code/locations/models/locations.ts
63
+ *
64
+ * @param client
65
+ * @param input
66
+ */
67
+ export declare function getLocation(client: GoHighLevelClient, input: GetLocationInput): Promise<GetLocationOutput>;
68
+ //# sourceMappingURL=get-location.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-location.d.mts","sourceRoot":"","sources":["../../src/locations/get-location.mts"],"names":[],"mappings":"AAAA,OAAO,EAAC,iBAAiB,EAAC,MAAM,eAAe,CAAC;AAEhD,MAAM,MAAM,gBAAgB,GAAG;IAC7B,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,QAAQ,GAAG;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,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ACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,QAAQ,CAAC,EAAE;QAAC,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;KAAC,CAAC;CACrC,CAAC;AAEF;;;;;;;GAOG;AACH,wBAAsB,WAAW,CAC/B,MAAM,EAAE,iBAAiB,EACzB,KAAK,EAAE,gBAAgB,GACtB,OAAO,CAAC,iBAAiB,CAAC,CAK5B"}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Returns a Location by ID
3
+ * @see https://marketplace.gohighlevel.com/docs/ghl/locations/get-location
4
+ * @see https://github.com/GoHighLevel/highlevel-api-sdk/blob/main/lib/code/locations/models/locations.ts
5
+ *
6
+ * @param client
7
+ * @param input
8
+ */
9
+ export async function getLocation(client, input) {
10
+ return client.get({
11
+ version: '2021-07-28',
12
+ path: `/locations/${input.locationId}`,
13
+ });
14
+ }
15
+ //# sourceMappingURL=get-location.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-location.mjs","sourceRoot":"","sources":["../../src/locations/get-location.mts"],"names":[],"mappings":"AA8DA;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW,CAC/B,MAAyB,EACzB,KAAuB;IAEvB,OAAO,MAAM,CAAC,GAAG,CAAoB;QACnC,OAAO,EAAE,YAAY;QACrB,IAAI,EAAE,cAAc,KAAK,CAAC,UAAU,EAAE;KACvC,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from './get-location.mjs';
2
+ //# sourceMappingURL=index.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../src/locations/index.mts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from './get-location.mjs';
2
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../src/locations/index.mts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC"}
@@ -0,0 +1,26 @@
1
+ export type GetAccessTokenInput = {
2
+ clientId: string;
3
+ clientSecret: string;
4
+ code: string;
5
+ };
6
+ export type GetAccessTokenOutput = {
7
+ access_token: string;
8
+ token_type: string;
9
+ expires_in: number;
10
+ refresh_token: string;
11
+ scope: string;
12
+ userType: string;
13
+ companyId: string;
14
+ locationId: string;
15
+ userId: string;
16
+ };
17
+ /**
18
+ * Returns an access token given a code.
19
+ *
20
+ * @see https://marketplace.gohighlevel.com/docs/ghl/oauth/get-access-token
21
+ * @see https://github.com/GoHighLevel/highlevel-api-sdk/blob/main/lib/code/oauth/models/oauth.ts
22
+ *
23
+ * @param input
24
+ */
25
+ export declare function getAccessToken(input: GetAccessTokenInput): Promise<GetAccessTokenOutput>;
26
+ //# sourceMappingURL=get-access-token.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-access-token.d.mts","sourceRoot":"","sources":["../../src/oauth/get-access-token.mts"],"names":[],"mappings":"AAEA,MAAM,MAAM,mBAAmB,GAAG;IAChC,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG;IACjC,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF;;;;;;;GAOG;AACH,wBAAsB,cAAc,CAClC,KAAK,EAAE,mBAAmB,GACzB,OAAO,CAAC,oBAAoB,CAAC,CA4C/B"}
@@ -0,0 +1,48 @@
1
+ import { handleError } from '../errors.mjs';
2
+ /**
3
+ * Returns an access token given a code.
4
+ *
5
+ * @see https://marketplace.gohighlevel.com/docs/ghl/oauth/get-access-token
6
+ * @see https://github.com/GoHighLevel/highlevel-api-sdk/blob/main/lib/code/oauth/models/oauth.ts
7
+ *
8
+ * @param input
9
+ */
10
+ export async function getAccessToken(input) {
11
+ if (!input.clientId) {
12
+ throw new Error('clientId is required');
13
+ }
14
+ if (!input.clientSecret) {
15
+ throw new Error('clientSecret is required');
16
+ }
17
+ if (!input.code) {
18
+ throw new Error('code is required');
19
+ }
20
+ const response = await fetch('https://services.leadconnectorhq.com/oauth/token', {
21
+ method: 'POST',
22
+ headers: {
23
+ 'Content-Type': 'application/x-www-form-urlencoded',
24
+ },
25
+ body: new URLSearchParams({
26
+ client_id: input.clientId,
27
+ client_secret: input.clientSecret,
28
+ grant_type: 'authorization_code',
29
+ code: input.code,
30
+ }),
31
+ });
32
+ if (!response.ok) {
33
+ await handleError(response);
34
+ }
35
+ const result = (await response.json());
36
+ // Some validation
37
+ if (!result.access_token || result.access_token === '') {
38
+ throw new Error('The access_token field is missing or invalid');
39
+ }
40
+ if (!result.refresh_token || result.refresh_token === '') {
41
+ throw new Error('The refresh_token field is missing or invalid');
42
+ }
43
+ if (!result.locationId || result.locationId === '') {
44
+ throw new Error('The locationId field is missing or invalid');
45
+ }
46
+ return result;
47
+ }
48
+ //# sourceMappingURL=get-access-token.mjs.map
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,MAAM,CAAC,aAAa,IAAI,MAAM,CAAC,aAAa,KAAK,EAAE,EAAE,CAAC;QACzD,MAAM,IAAI,KAAK,CAAC,+CAA+C,CAAC,CAAC;IACnE,CAAC;IAED,IAAI,CAAC,MAAM,CAAC,UAAU,IAAI,MAAM,CAAC,UAAU,KAAK,EAAE,EAAE,CAAC;QACnD,MAAM,IAAI,KAAK,CAAC,4CAA4C,CAAC,CAAC;IAChE,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC"}
@@ -0,0 +1,3 @@
1
+ export * from './get-access-token.mjs';
2
+ export * from './get-access-token.mjs';
3
+ //# sourceMappingURL=index.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../src/oauth/index.mts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC"}
@@ -0,0 +1,3 @@
1
+ export * from './get-access-token.mjs';
2
+ export * from './get-access-token.mjs';
3
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../src/oauth/index.mts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC"}
@@ -0,0 +1,26 @@
1
+ export type RefreshAccessTokenInput = {
2
+ clientId: string;
3
+ clientSecret: string;
4
+ refreshToken: string;
5
+ };
6
+ export type RefreshAccessTokenOutput = {
7
+ access_token: string;
8
+ token_type: string;
9
+ expires_in: number;
10
+ refresh_token: string;
11
+ scope: string;
12
+ userType: string;
13
+ companyId: string;
14
+ locationId: string;
15
+ userId: string;
16
+ };
17
+ /**
18
+ * Returns an access token given refresh token.
19
+ *
20
+ * @see https://marketplace.gohighlevel.com/docs/ghl/oauth/get-access-token
21
+ * @see https://github.com/GoHighLevel/highlevel-api-sdk/blob/main/lib/code/oauth/models/oauth.ts
22
+ *
23
+ * @param input
24
+ */
25
+ export declare function refreshAccessToken(input: RefreshAccessTokenInput): Promise<RefreshAccessTokenOutput>;
26
+ //# sourceMappingURL=refresh-access-token.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"refresh-access-token.d.mts","sourceRoot":"","sources":["../../src/oauth/refresh-access-token.mts"],"names":[],"mappings":"AAEA,MAAM,MAAM,uBAAuB,GAAG;IACpC,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG;IACrC,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF;;;;;;;GAOG;AACH,wBAAsB,kBAAkB,CACtC,KAAK,EAAE,uBAAuB,GAC7B,OAAO,CAAC,wBAAwB,CAAC,CA4CnC"}
@@ -0,0 +1,48 @@
1
+ import { handleError } from '../errors.mjs';
2
+ /**
3
+ * Returns an access token given refresh token.
4
+ *
5
+ * @see https://marketplace.gohighlevel.com/docs/ghl/oauth/get-access-token
6
+ * @see https://github.com/GoHighLevel/highlevel-api-sdk/blob/main/lib/code/oauth/models/oauth.ts
7
+ *
8
+ * @param input
9
+ */
10
+ export async function refreshAccessToken(input) {
11
+ if (!input.clientId) {
12
+ throw new Error('clientId is required');
13
+ }
14
+ if (!input.clientSecret) {
15
+ throw new Error('clientSecret is required');
16
+ }
17
+ if (!input.refreshToken) {
18
+ throw new Error('refreshToken is required');
19
+ }
20
+ const response = await fetch('https://services.leadconnectorhq.com/oauth/token', {
21
+ method: 'POST',
22
+ headers: {
23
+ 'Content-Type': 'application/x-www-form-urlencoded',
24
+ },
25
+ body: new URLSearchParams({
26
+ client_id: input.clientId,
27
+ client_secret: input.clientSecret,
28
+ grant_type: 'refresh_token',
29
+ refreshToken: input.refreshToken,
30
+ }),
31
+ });
32
+ if (!response.ok) {
33
+ await handleError(response);
34
+ }
35
+ const result = (await response.json());
36
+ // Some validation
37
+ if (!result.access_token || result.access_token === '') {
38
+ throw new Error('The access_token field is missing or invalid');
39
+ }
40
+ if (!result.refresh_token || result.refresh_token === '') {
41
+ throw new Error('The refresh_token field is missing or invalid');
42
+ }
43
+ if (!result.locationId || result.locationId === '') {
44
+ throw new Error('The locationId field is missing or invalid');
45
+ }
46
+ return result;
47
+ }
48
+ //# sourceMappingURL=refresh-access-token.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"refresh-access-token.mjs","sourceRoot":"","sources":["../../src/oauth/refresh-access-token.mts"],"names":[],"mappings":"AAAA,OAAO,EAAC,WAAW,EAAC,MAAM,eAAe,CAAC;AAoB1C;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,kBAAkB,CACtC,KAA8B;IAE9B,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC;QACpB,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC;IAC1C,CAAC;IACD,IAAI,CAAC,KAAK,CAAC,YAAY,EAAE,CAAC;QACxB,MAAM,IAAI,KAAK,CAAC,0BAA0B,CAAC,CAAC;IAC9C,CAAC;IACD,IAAI,CAAC,KAAK,CAAC,YAAY,EAAE,CAAC;QACxB,MAAM,IAAI,KAAK,CAAC,0BAA0B,CAAC,CAAC;IAC9C,CAAC;IACD,MAAM,QAAQ,GAAG,MAAM,KAAK,CAC1B,kDAAkD,EAClD;QACE,MAAM,EAAE,MAAM;QACd,OAAO,EAAE;YACP,cAAc,EAAE,mCAAmC;SACpD;QACD,IAAI,EAAE,IAAI,eAAe,CAAC;YACxB,SAAS,EAAE,KAAK,CAAC,QAAQ;YACzB,aAAa,EAAE,KAAK,CAAC,YAAY;YACjC,UAAU,EAAE,eAAe;YAC3B,YAAY,EAAE,KAAK,CAAC,YAAY;SACjC,CAAC;KACH,CACF,CAAC;IACF,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;QACjB,MAAM,WAAW,CAAC,QAAQ,CAAC,CAAC;IAC9B,CAAC;IACD,MAAM,MAAM,GAAG,CAAC,MAAM,QAAQ,CAAC,IAAI,EAAE,CAA6B,CAAC;IAEnE,kBAAkB;IAClB,IAAI,CAAC,MAAM,CAAC,YAAY,IAAI,MAAM,CAAC,YAAY,KAAK,EAAE,EAAE,CAAC;QACvD,MAAM,IAAI,KAAK,CAAC,8CAA8C,CAAC,CAAC;IAClE,CAAC;IAED,IAAI,CAAC,MAAM,CAAC,aAAa,IAAI,MAAM,CAAC,aAAa,KAAK,EAAE,EAAE,CAAC;QACzD,MAAM,IAAI,KAAK,CAAC,+CAA+C,CAAC,CAAC;IACnE,CAAC;IAED,IAAI,CAAC,MAAM,CAAC,UAAU,IAAI,MAAM,CAAC,UAAU,KAAK,EAAE,EAAE,CAAC;QACnD,MAAM,IAAI,KAAK,CAAC,4CAA4C,CAAC,CAAC;IAChE,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC"}
@@ -0,0 +1,41 @@
1
+ import { GoHighLevelClient } from '../client.mjs';
2
+ export type CreateCustomProviderConfigInput = {
3
+ locationId: string;
4
+ live: {
5
+ apiKey: string;
6
+ publishableKey: string;
7
+ };
8
+ test: {
9
+ apiKey: string;
10
+ publishableKey: string;
11
+ };
12
+ };
13
+ export type CreateCustomProviderConfigOutput = {
14
+ name: string;
15
+ description: string;
16
+ paymentsUrl: string;
17
+ queryUrl: string;
18
+ imageUrl: string;
19
+ _id: string;
20
+ locationId: string;
21
+ marketplaceAppId: string;
22
+ paymentProvider?: {
23
+ [key: string]: unknown;
24
+ };
25
+ deleted: boolean;
26
+ createdAt: string;
27
+ updatedAt: string;
28
+ traceId?: string;
29
+ };
30
+ /**
31
+ * Creates a new custom payment provider configuration.
32
+ *
33
+ * @see https://help.gohighlevel.com/support/solutions/articles/155000002620-how-to-build-a-custom-payments-integration-on-the-platform
34
+ * @see https://marketplace.gohighlevel.com/docs/ghl/payments/create-config
35
+ * @see https://github.com/GoHighLevel/highlevel-api-sdk/blob/main/lib/code/payments/models/payments.ts
36
+ *
37
+ * @param client
38
+ * @param input
39
+ */
40
+ export declare function createCustomProviderConfig(client: GoHighLevelClient, input: CreateCustomProviderConfigInput): Promise<CreateCustomProviderConfigOutput>;
41
+ //# sourceMappingURL=create-custom-provider-config.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-custom-provider-config.d.mts","sourceRoot":"","sources":["../../src/payments/create-custom-provider-config.mts"],"names":[],"mappings":"AAAA,OAAO,EAAC,iBAAiB,EAAC,MAAM,eAAe,CAAC;AAEhD,MAAM,MAAM,+BAA+B,GAAG;IAC5C,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE;QACJ,MAAM,EAAE,MAAM,CAAC;QACf,cAAc,EAAE,MAAM,CAAC;KACxB,CAAC;IACF,IAAI,EAAE;QACJ,MAAM,EAAE,MAAM,CAAC;QACf,cAAc,EAAE,MAAM,CAAC;KACxB,CAAC;CACH,CAAC;AAEF,MAAM,MAAM,gCAAgC,GAAG;IAC7C,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,GAAG,EAAE,MAAM,CAAC;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,gBAAgB,EAAE,MAAM,CAAC;IACzB,eAAe,CAAC,EAAE;QAChB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;KACxB,CAAC;IACF,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF;;;;;;;;;GASG;AACH,wBAAsB,0BAA0B,CAC9C,MAAM,EAAE,iBAAiB,EACzB,KAAK,EAAE,+BAA+B,GACrC,OAAO,CAAC,gCAAgC,CAAC,CAQ3C"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Creates a new custom payment provider configuration.
3
+ *
4
+ * @see https://help.gohighlevel.com/support/solutions/articles/155000002620-how-to-build-a-custom-payments-integration-on-the-platform
5
+ * @see https://marketplace.gohighlevel.com/docs/ghl/payments/create-config
6
+ * @see https://github.com/GoHighLevel/highlevel-api-sdk/blob/main/lib/code/payments/models/payments.ts
7
+ *
8
+ * @param client
9
+ * @param input
10
+ */
11
+ export async function createCustomProviderConfig(client, input) {
12
+ const { locationId, ...body } = input;
13
+ return client.post({
14
+ version: '2021-07-28',
15
+ path: '/payments/custom-provider/connect',
16
+ locationId,
17
+ body,
18
+ });
19
+ }
20
+ //# sourceMappingURL=create-custom-provider-config.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-custom-provider-config.mjs","sourceRoot":"","sources":["../../src/payments/create-custom-provider-config.mts"],"names":[],"mappings":"AAgCA;;;;;;;;;GASG;AACH,MAAM,CAAC,KAAK,UAAU,0BAA0B,CAC9C,MAAyB,EACzB,KAAsC;IAEtC,MAAM,EAAC,UAAU,EAAE,GAAG,IAAI,EAAC,GAAG,KAAK,CAAC;IACpC,OAAO,MAAM,CAAC,IAAI,CAAmC;QACnD,OAAO,EAAE,YAAY;QACrB,IAAI,EAAE,mCAAmC;QACzC,UAAU;QACV,IAAI;KACL,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,44 @@
1
+ import { GoHighLevelClient } from '../client.mjs';
2
+ export type CreateCustomProviderIntegrationInput = {
3
+ locationId: string;
4
+ name: string;
5
+ description: string;
6
+ paymentsUrl: string;
7
+ queryUrl: string;
8
+ imageUrl: string;
9
+ supportsSubscriptionSchedule: boolean;
10
+ };
11
+ export type CreateCustomProviderIntegrationOutput = {
12
+ name: string;
13
+ description: string;
14
+ paymentsUrl: string;
15
+ queryUrl: string;
16
+ imageUrl: string;
17
+ _id: string;
18
+ locationId: string;
19
+ marketplaceAppId: string;
20
+ providerConfig: {
21
+ live: {
22
+ liveMode: boolean;
23
+ };
24
+ test: {
25
+ liveMode: boolean;
26
+ };
27
+ };
28
+ deleted: boolean;
29
+ createdAt: string;
30
+ updatedAt: string;
31
+ traceId?: string;
32
+ };
33
+ /**
34
+ * Creates a new payment provider.
35
+ *
36
+ * @see https://help.gohighlevel.com/support/solutions/articles/155000002620-how-to-build-a-custom-payments-integration-on-the-platform
37
+ * @see https://marketplace.gohighlevel.com/docs/ghl/payments/create-integration
38
+ * @see https://github.com/GoHighLevel/highlevel-api-sdk/blob/main/lib/code/payments/models/payments.ts
39
+ *
40
+ * @param client
41
+ * @param input
42
+ */
43
+ export declare function createCustomProviderIntegration(client: GoHighLevelClient, input: CreateCustomProviderIntegrationInput): Promise<CreateCustomProviderIntegrationOutput>;
44
+ //# sourceMappingURL=create-custom-provider-integration.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-custom-provider-integration.d.mts","sourceRoot":"","sources":["../../src/payments/create-custom-provider-integration.mts"],"names":[],"mappings":"AAAA,OAAO,EAAC,iBAAiB,EAAC,MAAM,eAAe,CAAC;AAEhD,MAAM,MAAM,oCAAoC,GAAG;IACjD,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,4BAA4B,EAAE,OAAO,CAAC;CACvC,CAAC;AAEF,MAAM,MAAM,qCAAqC,GAAG;IAClD,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,GAAG,EAAE,MAAM,CAAC;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,gBAAgB,EAAE,MAAM,CAAC;IACzB,cAAc,EAAE;QACd,IAAI,EAAE;YACJ,QAAQ,EAAE,OAAO,CAAC;SACnB,CAAC;QACF,IAAI,EAAE;YACJ,QAAQ,EAAE,OAAO,CAAC;SACnB,CAAC;KACH,CAAC;IACF,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF;;;;;;;;;GASG;AACH,wBAAsB,+BAA+B,CACnD,MAAM,EAAE,iBAAiB,EACzB,KAAK,EAAE,oCAAoC,GAC1C,OAAO,CAAC,qCAAqC,CAAC,CAQhD"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Creates a new payment provider.
3
+ *
4
+ * @see https://help.gohighlevel.com/support/solutions/articles/155000002620-how-to-build-a-custom-payments-integration-on-the-platform
5
+ * @see https://marketplace.gohighlevel.com/docs/ghl/payments/create-integration
6
+ * @see https://github.com/GoHighLevel/highlevel-api-sdk/blob/main/lib/code/payments/models/payments.ts
7
+ *
8
+ * @param client
9
+ * @param input
10
+ */
11
+ export async function createCustomProviderIntegration(client, input) {
12
+ const { locationId, ...body } = input;
13
+ return client.post({
14
+ version: '2021-07-28',
15
+ path: '/payments/custom-provider/provider',
16
+ locationId,
17
+ body,
18
+ });
19
+ }
20
+ //# sourceMappingURL=create-custom-provider-integration.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-custom-provider-integration.mjs","sourceRoot":"","sources":["../../src/payments/create-custom-provider-integration.mts"],"names":[],"mappings":"AAmCA;;;;;;;;;GASG;AACH,MAAM,CAAC,KAAK,UAAU,+BAA+B,CACnD,MAAyB,EACzB,KAA2C;IAE3C,MAAM,EAAC,UAAU,EAAE,GAAG,IAAI,EAAC,GAAG,KAAK,CAAC;IACpC,OAAO,MAAM,CAAC,IAAI,CAAwC;QACxD,OAAO,EAAE,YAAY;QACrB,IAAI,EAAE,oCAAoC;QAC1C,UAAU;QACV,IAAI;KACL,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,33 @@
1
+ import { GoHighLevelClient } from '../client.mjs';
2
+ export type GetCustomProviderConfigInput = {
3
+ locationId: string;
4
+ };
5
+ export type GetCustomProviderConfigOutput = {
6
+ name: string;
7
+ description: string;
8
+ paymentsUrl: string;
9
+ queryUrl: string;
10
+ imageUrl: string;
11
+ _id: string;
12
+ locationId: string;
13
+ marketplaceAppId: string;
14
+ paymentProvider?: {
15
+ [key: string]: unknown;
16
+ };
17
+ deleted: boolean;
18
+ createdAt: string;
19
+ updatedAt: string;
20
+ traceId?: string;
21
+ };
22
+ /**
23
+ * Returns a custom payment provider configuration.
24
+ *
25
+ * @see https://help.gohighlevel.com/support/solutions/articles/155000002620-how-to-build-a-custom-payments-integration-on-the-platform
26
+ * @see https://marketplace.gohighlevel.com/docs/ghl/payments/fetch-config
27
+ * @see https://github.com/GoHighLevel/highlevel-api-sdk/blob/main/lib/code/payments/models/payments.ts
28
+ *
29
+ * @param client
30
+ * @param input
31
+ */
32
+ export declare function getCustomProviderConfig(client: GoHighLevelClient, input: GetCustomProviderConfigInput): Promise<GetCustomProviderConfigOutput>;
33
+ //# sourceMappingURL=get-custom-provider-config.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-custom-provider-config.d.mts","sourceRoot":"","sources":["../../src/payments/get-custom-provider-config.mts"],"names":[],"mappings":"AAAA,OAAO,EAAC,iBAAiB,EAAC,MAAM,eAAe,CAAC;AAEhD,MAAM,MAAM,4BAA4B,GAAG;IACzC,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,6BAA6B,GAAG;IAC1C,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,GAAG,EAAE,MAAM,CAAC;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,gBAAgB,EAAE,MAAM,CAAC;IACzB,eAAe,CAAC,EAAE;QAChB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;KACxB,CAAC;IACF,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF;;;;;;;;;GASG;AACH,wBAAsB,uBAAuB,CAC3C,MAAM,EAAE,iBAAiB,EACzB,KAAK,EAAE,4BAA4B,GAClC,OAAO,CAAC,6BAA6B,CAAC,CAMxC"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Returns a custom payment provider configuration.
3
+ *
4
+ * @see https://help.gohighlevel.com/support/solutions/articles/155000002620-how-to-build-a-custom-payments-integration-on-the-platform
5
+ * @see https://marketplace.gohighlevel.com/docs/ghl/payments/fetch-config
6
+ * @see https://github.com/GoHighLevel/highlevel-api-sdk/blob/main/lib/code/payments/models/payments.ts
7
+ *
8
+ * @param client
9
+ * @param input
10
+ */
11
+ export async function getCustomProviderConfig(client, input) {
12
+ return client.get({
13
+ version: '2021-07-28',
14
+ path: '/payments/custom-provider/connect',
15
+ locationId: input.locationId,
16
+ });
17
+ }
18
+ //# sourceMappingURL=get-custom-provider-config.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-custom-provider-config.mjs","sourceRoot":"","sources":["../../src/payments/get-custom-provider-config.mts"],"names":[],"mappings":"AAwBA;;;;;;;;;GASG;AACH,MAAM,CAAC,KAAK,UAAU,uBAAuB,CAC3C,MAAyB,EACzB,KAAmC;IAEnC,OAAO,MAAM,CAAC,GAAG,CAAgC;QAC/C,OAAO,EAAE,YAAY;QACrB,IAAI,EAAE,mCAAmC;QACzC,UAAU,EAAE,KAAK,CAAC,UAAU;KAC7B,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,5 @@
1
+ export * from './create-custom-provider-integration.mjs';
2
+ export * from './create-custom-provider-config.mjs';
3
+ export * from './get-custom-provider-config.mjs';
4
+ export * from './send-payment-captured-event.mjs';
5
+ //# sourceMappingURL=index.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../src/payments/index.mts"],"names":[],"mappings":"AAAA,cAAc,0CAA0C,CAAC;AACzD,cAAc,qCAAqC,CAAC;AACpD,cAAc,kCAAkC,CAAC;AACjD,cAAc,mCAAmC,CAAC"}
@@ -0,0 +1,5 @@
1
+ export * from './create-custom-provider-integration.mjs';
2
+ export * from './create-custom-provider-config.mjs';
3
+ export * from './get-custom-provider-config.mjs';
4
+ export * from './send-payment-captured-event.mjs';
5
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../src/payments/index.mts"],"names":[],"mappings":"AAAA,cAAc,0CAA0C,CAAC;AACzD,cAAc,qCAAqC,CAAC;AACpD,cAAc,kCAAkC,CAAC;AACjD,cAAc,mCAAmC,CAAC"}
@@ -0,0 +1,25 @@
1
+ import { GoHighLevelClient } from '../client.mjs';
2
+ export type ChargeStatus = 'succeeded' | 'failed' | 'pending';
3
+ export type ChargeSnapshot = {
4
+ status: ChargeStatus;
5
+ amount: number;
6
+ chargeId: string;
7
+ chargedAt: number;
8
+ };
9
+ export type SendPaymentCapturedEventInput = {
10
+ chargeId: string;
11
+ ghlTransactionId: string;
12
+ chargeSnapshot: ChargeSnapshot;
13
+ locationId: string;
14
+ agency: string;
15
+ };
16
+ /**
17
+ * Sends a webhook request for a custom payment provider.
18
+ *
19
+ * @see https://help.gohighlevel.com/support/solutions/articles/155000002620-how-to-build-a-custom-payments-integration-on-the-platform
20
+ *
21
+ * @param client
22
+ * @param input
23
+ */
24
+ export declare function sendPaymentCapturedEvent(client: GoHighLevelClient, input: SendPaymentCapturedEventInput): Promise<void>;
25
+ //# sourceMappingURL=send-payment-captured-event.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"send-payment-captured-event.d.mts","sourceRoot":"","sources":["../../src/payments/send-payment-captured-event.mts"],"names":[],"mappings":"AAAA,OAAO,EAAC,iBAAiB,EAAC,MAAM,eAAe,CAAC;AAEhD,MAAM,MAAM,YAAY,GAAG,WAAW,GAAG,QAAQ,GAAG,SAAS,CAAC;AAE9D,MAAM,MAAM,cAAc,GAAG;IAC3B,MAAM,EAAE,YAAY,CAAC;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,6BAA6B,GAAG;IAC1C,QAAQ,EAAE,MAAM,CAAC;IACjB,gBAAgB,EAAE,MAAM,CAAC;IACzB,cAAc,EAAE,cAAc,CAAC;IAC/B,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF;;;;;;;GAOG;AACH,wBAAsB,wBAAwB,CAC5C,MAAM,EAAE,iBAAiB,EACzB,KAAK,EAAE,6BAA6B,GACnC,OAAO,CAAC,IAAI,CAAC,CASf"}
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Sends a webhook request for a custom payment provider.
3
+ *
4
+ * @see https://help.gohighlevel.com/support/solutions/articles/155000002620-how-to-build-a-custom-payments-integration-on-the-platform
5
+ *
6
+ * @param client
7
+ * @param input
8
+ */
9
+ export async function sendPaymentCapturedEvent(client, input) {
10
+ return client.post({
11
+ version: '2021-07-28',
12
+ path: '/payments/custom-provider/webhook',
13
+ body: {
14
+ event: 'payment.captured',
15
+ ...input,
16
+ },
17
+ });
18
+ }
19
+ //# sourceMappingURL=send-payment-captured-event.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"send-payment-captured-event.mjs","sourceRoot":"","sources":["../../src/payments/send-payment-captured-event.mts"],"names":[],"mappings":"AAmBA;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,wBAAwB,CAC5C,MAAyB,EACzB,KAAoC;IAEpC,OAAO,MAAM,CAAC,IAAI,CAAC;QACjB,OAAO,EAAE,YAAY;QACrB,IAAI,EAAE,mCAAmC;QACzC,IAAI,EAAE;YACJ,KAAK,EAAE,kBAAkB;YACzB,GAAG,KAAK;SACT;KACF,CAAC,CAAC;AACL,CAAC"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@nr1e/gohighlevel",
3
3
  "description": "Unofficial Go High Level client",
4
- "version": "0.0.0-snapshot-20260118221324",
4
+ "version": "0.0.0-snapshot-20260119000508",
5
5
  "type": "module",
6
6
  "author": "NR1E, Inc.",
7
7
  "publishConfig": {
@@ -26,13 +26,30 @@
26
26
  "typescript-eslint": "8.38.0",
27
27
  "vitest": "4.0.6"
28
28
  },
29
- "dependencies": {
30
- "tslib": "^2.8.1"
31
- },
32
29
  "exports": {
33
30
  ".": {
34
31
  "import": "./dist/index.mjs",
35
32
  "types": "./dist/index.d.mts"
33
+ },
34
+ "./contacts": {
35
+ "import": "./dist/contacts/index.mjs",
36
+ "types": "./dist/contacts/index.d.mts"
37
+ },
38
+ "./invoices": {
39
+ "import": "./dist/invoices/index.mjs",
40
+ "types": "./dist/invoices/index.d.mts"
41
+ },
42
+ "./locations": {
43
+ "import": "./dist/locations/index.mjs",
44
+ "types": "./dist/locations/index.d.mts"
45
+ },
46
+ "./oauth": {
47
+ "import": "./dist/oauth/index.mjs",
48
+ "types": "./dist/oauth/index.d.mts"
49
+ },
50
+ "./payments": {
51
+ "import": "./dist/payments/index.mjs",
52
+ "types": "./dist/payments/index.d.mts"
36
53
  }
37
54
  },
38
55
  "scripts": {
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-invoice.d.mts","sourceRoot":"","sources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AAE,MAAM,GAAG,OAAO,CAAA;KAAC,CAAC;IAC3C,YAAY,EAAE,kBAAkB,CAAC;IACjC,sBAAsB,CAAC,EAAE,4BAA4B,CAAC;CACvD,CAAC;AAEF,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,GAAG,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,4BAA4B;IAC3C,4BAA4B,EAAE;QAC5B,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;KACxB,CAAC;IACF,gBAAgB,EAAE;QAChB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;KACxB,CAAC;CACH"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-invoice.mjs","sourceRoot":"","sources":["../../src/invoice/get-invoice.mts"],"names":[],"mappings":"AACA,OAAO,EAAC,mBAAmB,EAAC,MAAM,uBAAuB,CAAC;AAO1D;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,UAAU,CAC9B,MAAyB,EACzB,KAAsB;IAEtB,OAAO,MAAM,CAAC,GAAG,CAAmB;QAClC,OAAO,EAAE,mBAAmB;QAC5B,IAAI,EAAE,aAAa,KAAK,CAAC,SAAS,EAAE;QACpC,KAAK,EAAE,KAAK,CAAC,UAAU;KACxB,CAAC,CAAC;AACL,CAAC"}
@@ -1,3 +0,0 @@
1
- export * from './get-invoice.mjs';
2
- export * from './invoice-version.mjs';
3
- //# sourceMappingURL=index.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../src/invoice/index.mts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC"}
@@ -1,3 +0,0 @@
1
- export * from './get-invoice.mjs';
2
- export * from './invoice-version.mjs';
3
- //# sourceMappingURL=index.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../src/invoice/index.mts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC"}
@@ -1,2 +0,0 @@
1
- export declare const INVOICE_API_VERSION = "2021-07-28";
2
- //# sourceMappingURL=invoice-version.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"invoice-version.d.mts","sourceRoot":"","sources":["../../src/invoice/invoice-version.mts"],"names":[],"mappings":"AAAA,eAAO,MAAM,mBAAmB,eAAe,CAAC"}
@@ -1,2 +0,0 @@
1
- export const INVOICE_API_VERSION = '2021-07-28';
2
- //# sourceMappingURL=invoice-version.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"invoice-version.mjs","sourceRoot":"","sources":["../../src/invoice/invoice-version.mts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,mBAAmB,GAAG,YAAY,CAAC"}