glitch-javascript-sdk 2.0.0 → 2.0.1
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/cjs/index.js +222 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/api/MarketingAgencies.d.ts +174 -0
- package/dist/esm/api/index.d.ts +2 -0
- package/dist/esm/index.d.ts +2 -0
- package/dist/esm/index.js +222 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/routes/MarketingAgenciesRoute.d.ts +7 -0
- package/dist/index.d.ts +173 -0
- package/package.json +1 -1
- package/src/api/MarketingAgencies.ts +210 -0
- package/src/api/index.ts +3 -1
- package/src/index.ts +3 -1
- package/src/routes/MarketingAgenciesRoute.ts +36 -0
package/dist/cjs/index.js
CHANGED
|
@@ -27588,6 +27588,226 @@ var AIUsage = /** @class */ (function () {
|
|
|
27588
27588
|
return AIUsage;
|
|
27589
27589
|
}());
|
|
27590
27590
|
|
|
27591
|
+
var MarketingAgenciesRoute = /** @class */ (function () {
|
|
27592
|
+
function MarketingAgenciesRoute() {
|
|
27593
|
+
}
|
|
27594
|
+
MarketingAgenciesRoute.routes = {
|
|
27595
|
+
// CRUD for agencies
|
|
27596
|
+
list: { url: '/marketing-agencies', method: HTTP_METHODS.GET },
|
|
27597
|
+
create: { url: '/marketing-agencies', method: HTTP_METHODS.POST },
|
|
27598
|
+
view: { url: '/marketing-agencies/{id}', method: HTTP_METHODS.GET },
|
|
27599
|
+
update: { url: '/marketing-agencies/{id}', method: HTTP_METHODS.PUT },
|
|
27600
|
+
delete: { url: '/marketing-agencies/{id}', method: HTTP_METHODS.DELETE },
|
|
27601
|
+
// Administrator management
|
|
27602
|
+
addAdministrator: { url: '/marketing-agencies/{id}/administrators', method: HTTP_METHODS.POST },
|
|
27603
|
+
removeAdministrator: { url: '/marketing-agencies/{id}/administrators/{user_id}', method: HTTP_METHODS.DELETE },
|
|
27604
|
+
// Logo management
|
|
27605
|
+
setLogo: { url: '/marketing-agencies/{id}/logo', method: HTTP_METHODS.POST },
|
|
27606
|
+
// Case Study management
|
|
27607
|
+
addCaseStudy: { url: '/marketing-agencies/{id}/case-studies', method: HTTP_METHODS.POST },
|
|
27608
|
+
removeCaseStudy: { url: '/marketing-agencies/{id}/case-studies/{media_id}', method: HTTP_METHODS.DELETE },
|
|
27609
|
+
updateCaseStudyOrder: { url: '/marketing-agencies/{id}/case-studies/order', method: HTTP_METHODS.POST },
|
|
27610
|
+
// Invitation management
|
|
27611
|
+
invite: { url: '/marketing-agencies/{id}/invites', method: HTTP_METHODS.POST },
|
|
27612
|
+
listInvites: { url: '/marketing-agencies/{id}/invites', method: HTTP_METHODS.GET },
|
|
27613
|
+
revokeInvite: { url: '/marketing-agencies/{id}/invites/{invite_id}', method: HTTP_METHODS.DELETE },
|
|
27614
|
+
getInviteDetails: { url: '/marketing-agencies/invites/details', method: HTTP_METHODS.GET },
|
|
27615
|
+
acceptInvite: { url: '/marketing-agencies/invites/accept', method: HTTP_METHODS.POST },
|
|
27616
|
+
};
|
|
27617
|
+
return MarketingAgenciesRoute;
|
|
27618
|
+
}());
|
|
27619
|
+
|
|
27620
|
+
var MarketingAgencies = /** @class */ (function () {
|
|
27621
|
+
function MarketingAgencies() {
|
|
27622
|
+
}
|
|
27623
|
+
/**
|
|
27624
|
+
* List all marketing agencies.
|
|
27625
|
+
*
|
|
27626
|
+
* @see https://api.glitch.fun/api/documentation#/Marketing%20Agencies/getMarketing-agencies
|
|
27627
|
+
*
|
|
27628
|
+
* @param params Optional query parameters (e.g., is_admin, sort_by, sort_order, page, per_page).
|
|
27629
|
+
* @returns promise
|
|
27630
|
+
*/
|
|
27631
|
+
MarketingAgencies.list = function (params) {
|
|
27632
|
+
return Requests.processRoute(MarketingAgenciesRoute.routes.list, undefined, undefined, params);
|
|
27633
|
+
};
|
|
27634
|
+
/**
|
|
27635
|
+
* Create a new marketing agency.
|
|
27636
|
+
*
|
|
27637
|
+
* @see https://api.glitch.fun/api/documentation#/Marketing%20Agencies/postMarketing-agencies
|
|
27638
|
+
*
|
|
27639
|
+
* @param data The data for the new agency.
|
|
27640
|
+
* @returns Promise
|
|
27641
|
+
*/
|
|
27642
|
+
MarketingAgencies.create = function (data) {
|
|
27643
|
+
return Requests.processRoute(MarketingAgenciesRoute.routes.create, data);
|
|
27644
|
+
};
|
|
27645
|
+
/**
|
|
27646
|
+
* Retrieve a single marketing agency by its ID.
|
|
27647
|
+
*
|
|
27648
|
+
* @see https://api.glitch.fun/api/documentation#/Marketing%20Agencies/getMarketing-agencies-id
|
|
27649
|
+
*
|
|
27650
|
+
* @param id The UUID of the agency to retrieve.
|
|
27651
|
+
* @returns promise
|
|
27652
|
+
*/
|
|
27653
|
+
MarketingAgencies.view = function (id) {
|
|
27654
|
+
return Requests.processRoute(MarketingAgenciesRoute.routes.view, {}, { id: id });
|
|
27655
|
+
};
|
|
27656
|
+
/**
|
|
27657
|
+
* Update a marketing agency.
|
|
27658
|
+
*
|
|
27659
|
+
* @see https://api.glitch.fun/api/documentation#/Marketing%20Agencies/putMarketing-agencies-id
|
|
27660
|
+
*
|
|
27661
|
+
* @param id The UUID of the agency to update.
|
|
27662
|
+
* @param data The data to update.
|
|
27663
|
+
* @returns promise
|
|
27664
|
+
*/
|
|
27665
|
+
MarketingAgencies.update = function (id, data) {
|
|
27666
|
+
return Requests.processRoute(MarketingAgenciesRoute.routes.update, data, { id: id });
|
|
27667
|
+
};
|
|
27668
|
+
/**
|
|
27669
|
+
* Deletes a marketing agency.
|
|
27670
|
+
*
|
|
27671
|
+
* @see https://api.glitch.fun/api/documentation#/Marketing%20Agencies/deleteMarketing-agencies-id
|
|
27672
|
+
*
|
|
27673
|
+
* @param id The UUID of the agency to delete.
|
|
27674
|
+
* @returns promise
|
|
27675
|
+
*/
|
|
27676
|
+
MarketingAgencies.delete = function (id) {
|
|
27677
|
+
return Requests.processRoute(MarketingAgenciesRoute.routes.delete, {}, { id: id });
|
|
27678
|
+
};
|
|
27679
|
+
/**
|
|
27680
|
+
* Add a user as an administrator to an agency.
|
|
27681
|
+
*
|
|
27682
|
+
* @see https://api.glitch.fun/api/documentation#/Marketing%20Agencies/postMarketing-agencies-id-administrators
|
|
27683
|
+
*
|
|
27684
|
+
* @param id The UUID of the agency.
|
|
27685
|
+
* @param data The data containing the user_id to add.
|
|
27686
|
+
* @returns Promise
|
|
27687
|
+
*/
|
|
27688
|
+
MarketingAgencies.addAdministrator = function (id, data) {
|
|
27689
|
+
return Requests.processRoute(MarketingAgenciesRoute.routes.addAdministrator, data, { id: id });
|
|
27690
|
+
};
|
|
27691
|
+
/**
|
|
27692
|
+
* Remove a user as an administrator from an agency.
|
|
27693
|
+
*
|
|
27694
|
+
* @see https://api.glitch.fun/api/documentation#/Marketing%20Agencies/deleteMarketing-agencies-id-administrators-user_id
|
|
27695
|
+
*
|
|
27696
|
+
* @param id The UUID of the agency.
|
|
27697
|
+
* @param user_id The UUID of the user to remove.
|
|
27698
|
+
* @returns Promise
|
|
27699
|
+
*/
|
|
27700
|
+
MarketingAgencies.removeAdministrator = function (id, user_id) {
|
|
27701
|
+
return Requests.processRoute(MarketingAgenciesRoute.routes.removeAdministrator, {}, { id: id, user_id: user_id });
|
|
27702
|
+
};
|
|
27703
|
+
/**
|
|
27704
|
+
* Set the logo for an agency.
|
|
27705
|
+
*
|
|
27706
|
+
* @see https://api.glitch.fun/api/documentation#/Marketing%20Agencies/postMarketing-agencies-id-logo
|
|
27707
|
+
*
|
|
27708
|
+
* @param id The UUID of the agency.
|
|
27709
|
+
* @param data The data containing the media_id for the logo.
|
|
27710
|
+
* @returns Promise
|
|
27711
|
+
*/
|
|
27712
|
+
MarketingAgencies.setLogo = function (id, data) {
|
|
27713
|
+
return Requests.processRoute(MarketingAgenciesRoute.routes.setLogo, data, { id: id });
|
|
27714
|
+
};
|
|
27715
|
+
/**
|
|
27716
|
+
* Add a case study to an agency.
|
|
27717
|
+
*
|
|
27718
|
+
* @see https://api.glitch.fun/api/documentation#/Marketing%20Agencies/postMarketing-agencies-id-case-studies
|
|
27719
|
+
*
|
|
27720
|
+
* @param id The UUID of the agency.
|
|
27721
|
+
* @param data The data containing the media_id and optional order.
|
|
27722
|
+
* @returns Promise
|
|
27723
|
+
*/
|
|
27724
|
+
MarketingAgencies.addCaseStudy = function (id, data) {
|
|
27725
|
+
return Requests.processRoute(MarketingAgenciesRoute.routes.addCaseStudy, data, { id: id });
|
|
27726
|
+
};
|
|
27727
|
+
/**
|
|
27728
|
+
* Remove a case study from an agency.
|
|
27729
|
+
*
|
|
27730
|
+
* @see https://api.glitch.fun/api/documentation#/Marketing%20Agencies/deleteMarketing-agencies-id-case-studies-media_id
|
|
27731
|
+
*
|
|
27732
|
+
* @param id The UUID of the agency.
|
|
27733
|
+
* @param media_id The UUID of the media to remove.
|
|
27734
|
+
* @returns Promise
|
|
27735
|
+
*/
|
|
27736
|
+
MarketingAgencies.removeCaseStudy = function (id, media_id) {
|
|
27737
|
+
return Requests.processRoute(MarketingAgenciesRoute.routes.removeCaseStudy, {}, { id: id, media_id: media_id });
|
|
27738
|
+
};
|
|
27739
|
+
/**
|
|
27740
|
+
* Update the order of case studies for an agency.
|
|
27741
|
+
*
|
|
27742
|
+
* @see https://api.glitch.fun/api/documentation#/Marketing%20Agencies/postMarketing-agencies-id-case-studies-order
|
|
27743
|
+
*
|
|
27744
|
+
* @param id The UUID of the agency.
|
|
27745
|
+
* @param order_data An array of objects with media_id and new order.
|
|
27746
|
+
* @returns Promise
|
|
27747
|
+
*/
|
|
27748
|
+
MarketingAgencies.updateCaseStudyOrder = function (id, order_data) {
|
|
27749
|
+
return Requests.processRoute(MarketingAgenciesRoute.routes.updateCaseStudyOrder, { order_data: order_data }, { id: id });
|
|
27750
|
+
};
|
|
27751
|
+
/**
|
|
27752
|
+
* Invite a user to become an administrator of an agency.
|
|
27753
|
+
*
|
|
27754
|
+
* @see https://api.glitch.fun/api/documentation#/Marketing%20Agencies/postMarketing-agencies-id-invites
|
|
27755
|
+
*
|
|
27756
|
+
* @param id The UUID of the agency.
|
|
27757
|
+
* @param data The data containing the email of the user to invite.
|
|
27758
|
+
* @returns Promise
|
|
27759
|
+
*/
|
|
27760
|
+
MarketingAgencies.invite = function (id, data) {
|
|
27761
|
+
return Requests.processRoute(MarketingAgenciesRoute.routes.invite, data, { id: id });
|
|
27762
|
+
};
|
|
27763
|
+
/**
|
|
27764
|
+
* List all pending invitations for an agency.
|
|
27765
|
+
*
|
|
27766
|
+
* @see https://api.glitch.fun/api/documentation#/Marketing%20Agencies/getMarketing-agencies-id-invites
|
|
27767
|
+
*
|
|
27768
|
+
* @param id The UUID of the agency.
|
|
27769
|
+
* @returns Promise
|
|
27770
|
+
*/
|
|
27771
|
+
MarketingAgencies.listInvites = function (id) {
|
|
27772
|
+
return Requests.processRoute(MarketingAgenciesRoute.routes.listInvites, {}, { id: id });
|
|
27773
|
+
};
|
|
27774
|
+
/**
|
|
27775
|
+
* Revoke a pending invitation.
|
|
27776
|
+
*
|
|
27777
|
+
* @see https://api.glitch.fun/api/documentation#/Marketing%20Agencies/deleteMarketing-agencies-id-invites-invite_id
|
|
27778
|
+
*
|
|
27779
|
+
* @param id The UUID of the agency.
|
|
27780
|
+
* @param invite_id The UUID of the invitation to revoke.
|
|
27781
|
+
* @returns Promise
|
|
27782
|
+
*/
|
|
27783
|
+
MarketingAgencies.revokeInvite = function (id, invite_id) {
|
|
27784
|
+
return Requests.processRoute(MarketingAgenciesRoute.routes.revokeInvite, {}, { id: id, invite_id: invite_id });
|
|
27785
|
+
};
|
|
27786
|
+
/**
|
|
27787
|
+
* Get the details of a pending invitation using its token.
|
|
27788
|
+
*
|
|
27789
|
+
* @see https://api.glitch.fun/api/documentation#/Marketing%20Agencies/getMarketing-agencies-invites-details
|
|
27790
|
+
*
|
|
27791
|
+
* @param params An object containing the token.
|
|
27792
|
+
* @returns Promise
|
|
27793
|
+
*/
|
|
27794
|
+
MarketingAgencies.getInviteDetails = function (params) {
|
|
27795
|
+
return Requests.processRoute(MarketingAgenciesRoute.routes.getInviteDetails, undefined, undefined, params);
|
|
27796
|
+
};
|
|
27797
|
+
/**
|
|
27798
|
+
* Accept an invitation to become an administrator.
|
|
27799
|
+
*
|
|
27800
|
+
* @see https://api.glitch.fun/api/documentation#/Marketing%20Agencies/postMarketing-agencies-invites-accept
|
|
27801
|
+
*
|
|
27802
|
+
* @param data The data containing the invitation token.
|
|
27803
|
+
* @returns Promise
|
|
27804
|
+
*/
|
|
27805
|
+
MarketingAgencies.acceptInvite = function (data) {
|
|
27806
|
+
return Requests.processRoute(MarketingAgenciesRoute.routes.acceptInvite, data);
|
|
27807
|
+
};
|
|
27808
|
+
return MarketingAgencies;
|
|
27809
|
+
}());
|
|
27810
|
+
|
|
27591
27811
|
var Parser = /** @class */ (function () {
|
|
27592
27812
|
function Parser() {
|
|
27593
27813
|
}
|
|
@@ -28112,7 +28332,8 @@ var Glitch = /** @class */ (function () {
|
|
|
28112
28332
|
WebsiteAnalytics: WebsiteAnalytics,
|
|
28113
28333
|
Fingerprinting: Fingerprinting,
|
|
28114
28334
|
ShortLinks: ShortLinks,
|
|
28115
|
-
AIUsage: AIUsage
|
|
28335
|
+
AIUsage: AIUsage,
|
|
28336
|
+
MarketingAgencies: MarketingAgencies
|
|
28116
28337
|
};
|
|
28117
28338
|
Glitch.util = {
|
|
28118
28339
|
Requests: Requests,
|