Socket
Socket
Sign inDemoInstall

square

Package Overview
Dependencies
26
Maintainers
6
Versions
50
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 30.0.0 to 31.0.0

dist/cjs/models/bulkRetrieveTeamMemberBookingProfilesRequest.js

25

dist/cjs/api/bookingsApi.js

@@ -7,2 +7,4 @@ "use strict";

var bulkRetrieveBookingsResponse_1 = require("../models/bulkRetrieveBookingsResponse");
var bulkRetrieveTeamMemberBookingProfilesRequest_1 = require("../models/bulkRetrieveTeamMemberBookingProfilesRequest");
var bulkRetrieveTeamMemberBookingProfilesResponse_1 = require("../models/bulkRetrieveTeamMemberBookingProfilesResponse");
var cancelBookingRequest_1 = require("../models/cancelBookingRequest");

@@ -208,2 +210,25 @@ var cancelBookingResponse_1 = require("../models/cancelBookingResponse");

/**
* Retrieves one or more team members' booking profiles.
*
* @param body An object containing the fields to
* POST for the request. See the
* corresponding object definition for
* field details.
* @return Response from the API call
*/
BookingsApi.prototype.bulkRetrieveTeamMemberBookingProfiles = function (body, requestOptions) {
return tslib_1.__awaiter(this, void 0, void 0, function () {
var req, mapped;
return tslib_1.__generator(this, function (_a) {
req = this.createRequest('POST', '/v2/bookings/team-member-booking-profiles/bulk-retrieve');
mapped = req.prepareArgs({
body: [body, bulkRetrieveTeamMemberBookingProfilesRequest_1.bulkRetrieveTeamMemberBookingProfilesRequestSchema]
});
req.header('Content-Type', 'application/json');
req.json(mapped.body);
return [2 /*return*/, req.callAsJson(bulkRetrieveTeamMemberBookingProfilesResponse_1.bulkRetrieveTeamMemberBookingProfilesResponseSchema, requestOptions)];
});
});
};
/**
* Retrieves a team member's booking profile.

@@ -210,0 +235,0 @@ *

2

dist/cjs/api/checkoutApi.js

@@ -30,4 +30,2 @@ "use strict";

* api#checkout-api-highlights).
* We recommend that you use the new [CreatePaymentLink](api-endpoint:Checkout-CreatePaymentLink)
* endpoint in place of this previously released endpoint.
*

@@ -34,0 +32,0 @@ * @param locationId The ID of the business location to associate the checkout

@@ -8,3 +8,5 @@ "use strict";

var getDeviceCodeResponse_1 = require("../models/getDeviceCodeResponse");
var getDeviceResponse_1 = require("../models/getDeviceResponse");
var listDeviceCodesResponse_1 = require("../models/listDeviceCodesResponse");
var listDevicesResponse_1 = require("../models/listDevicesResponse");
var schema_1 = require("../schema");

@@ -18,2 +20,35 @@ var baseApi_1 = require("./baseApi");

/**
* List devices associated with the merchant. Currently, only Terminal API
* devices are supported.
*
* @param cursor A pagination cursor returned by a previous call to this endpoint. Provide this
* cursor to retrieve the next set of results for the original query. See
* [Pagination](https://developer.squareup.com/docs/build-basics/common-api-
* patterns/pagination) for more information.
* @param sortOrder The order in which results are listed. - `ASC` - Oldest to newest. - `DESC` - Newest
* to oldest (default).
* @param limit The number of results to return in a single page.
* @param locationId If present, only returns devices at the target location.
* @return Response from the API call
*/
DevicesApi.prototype.listDevices = function (cursor, sortOrder, limit, locationId, requestOptions) {
return tslib_1.__awaiter(this, void 0, void 0, function () {
var req, mapped;
return tslib_1.__generator(this, function (_a) {
req = this.createRequest('GET', '/v2/devices');
mapped = req.prepareArgs({
cursor: [cursor, (0, schema_1.optional)((0, schema_1.string)())],
sortOrder: [sortOrder, (0, schema_1.optional)((0, schema_1.string)())],
limit: [limit, (0, schema_1.optional)((0, schema_1.number)())],
locationId: [locationId, (0, schema_1.optional)((0, schema_1.string)())]
});
req.query('cursor', mapped.cursor);
req.query('sort_order', mapped.sortOrder);
req.query('limit', mapped.limit);
req.query('location_id', mapped.locationId);
return [2 /*return*/, req.callAsJson(listDevicesResponse_1.listDevicesResponseSchema, requestOptions)];
});
});
};
/**
* Lists all DeviceCodes associated with the merchant.

@@ -91,6 +126,23 @@ *

};
/**
* Retrieves Device with the associated `device_id`.
*
* @param deviceId The unique ID for the desired `Device`.
* @return Response from the API call
*/
DevicesApi.prototype.getDevice = function (deviceId, requestOptions) {
return tslib_1.__awaiter(this, void 0, void 0, function () {
var req, mapped;
return tslib_1.__generator(this, function (_a) {
req = this.createRequest('GET');
mapped = req.prepareArgs({ deviceId: [deviceId, (0, schema_1.string)()] });
req.appendTemplatePath(templateObject_2 || (templateObject_2 = tslib_1.__makeTemplateObject(["/v2/devices/", ""], ["/v2/devices/", ""])), mapped.deviceId);
return [2 /*return*/, req.callAsJson(getDeviceResponse_1.getDeviceResponseSchema, requestOptions)];
});
});
};
return DevicesApi;
}(baseApi_1.BaseApi));
exports.DevicesApi = DevicesApi;
var templateObject_1;
var templateObject_1, templateObject_2;
//# sourceMappingURL=devicesApi.js.map

@@ -394,3 +394,3 @@ "use strict";

});
req.appendTemplatePath(templateObject_8 || (templateObject_8 = tslib_1.__makeTemplateObject(["/v2/loyalty/programs/", "/promotions/", ""], ["/v2/loyalty/programs/", "/promotions/", ""])), mapped.promotionId, mapped.programId);
req.appendTemplatePath(templateObject_8 || (templateObject_8 = tslib_1.__makeTemplateObject(["/v2/loyalty/programs/", "/promotions/", ""], ["/v2/loyalty/programs/", "/promotions/", ""])), mapped.programId, mapped.promotionId);
return [2 /*return*/, req.callAsJson(retrieveLoyaltyPromotionResponse_1.retrieveLoyaltyPromotionResponseSchema, requestOptions)];

@@ -424,3 +424,3 @@ });

});
req.appendTemplatePath(templateObject_9 || (templateObject_9 = tslib_1.__makeTemplateObject(["/v2/loyalty/programs/", "/promotions/", "/cancel"], ["/v2/loyalty/programs/", "/promotions/", "/cancel"])), mapped.promotionId, mapped.programId);
req.appendTemplatePath(templateObject_9 || (templateObject_9 = tslib_1.__makeTemplateObject(["/v2/loyalty/programs/", "/promotions/", "/cancel"], ["/v2/loyalty/programs/", "/promotions/", "/cancel"])), mapped.programId, mapped.promotionId);
return [2 /*return*/, req.callAsJson(cancelLoyaltyPromotionResponse_1.cancelLoyaltyPromotionResponseSchema, requestOptions)];

@@ -427,0 +427,0 @@ });

@@ -73,5 +73,3 @@ "use strict";

* If an account has more than one OAuth access token for your application, this
* endpoint revokes all of them, regardless of which token you specify. When an
* OAuth access token is revoked, all of the active subscriptions associated
* with that OAuth token are canceled immediately.
* endpoint revokes all of them, regardless of which token you specify.
*

@@ -78,0 +76,0 @@ * __Important:__ The `Authorization` header for this endpoint must have the

@@ -57,3 +57,3 @@ "use strict";

/** Current SDK version */
exports.SDK_VERSION = '30.0.0';
exports.SDK_VERSION = '31.0.0';
var Client = /** @class */ (function () {

@@ -69,3 +69,3 @@ function Client(config) {

: this._config.timeout;
this._userAgent = (0, core_4.updateUserAgent)('Square-TypeScript-SDK/30.0.0 ({api-version}) {engine}/{engine-version} ({os-info}) {detail}', this._config.squareVersion, this._config.userAgentDetail);
this._userAgent = (0, core_4.updateUserAgent)('Square-TypeScript-SDK/31.0.0 ({api-version}) {engine}/{engine-version} ({os-info}) {detail}', this._config.squareVersion, this._config.userAgentDetail);
this._requestBuilderFactory = createRequestHandlerFactory(function (server) { return getBaseUri(server, _this._config); }, (0, authentication_1.accessTokenAuthenticationProvider)(this._config), new clientAdapter_1.HttpClient(core_5.AbortError, {

@@ -72,0 +72,0 @@ timeout: this._timeout,

@@ -8,3 +8,3 @@ "use strict";

timeout: 60000,
squareVersion: '2023-08-16',
squareVersion: '2023-09-25',
additionalHeaders: {},

@@ -11,0 +11,0 @@ userAgentDetail: '',

@@ -5,6 +5,14 @@ "use strict";

var schema_1 = require("../schema");
var component_1 = require("./component");
var deviceAttributes_1 = require("./deviceAttributes");
var deviceStatus_1 = require("./deviceStatus");
exports.deviceSchema = (0, schema_1.object)({
id: ['id', (0, schema_1.optional)((0, schema_1.string)())],
name: ['name', (0, schema_1.optional)((0, schema_1.nullable)((0, schema_1.string)()))]
attributes: ['attributes', (0, schema_1.lazy)(function () { return deviceAttributes_1.deviceAttributesSchema; })],
components: [
'components',
(0, schema_1.optional)((0, schema_1.nullable)((0, schema_1.array)((0, schema_1.lazy)(function () { return component_1.componentSchema; })))),
],
status: ['status', (0, schema_1.optional)((0, schema_1.lazy)(function () { return deviceStatus_1.deviceStatusSchema; }))]
});
//# sourceMappingURL=device.js.map

@@ -8,4 +8,5 @@ "use strict";

locationId: ['location_id', (0, schema_1.optional)((0, schema_1.nullable)((0, schema_1.string)()))],
priceMoney: ['price_money', (0, schema_1.optional)((0, schema_1.lazy)(function () { return money_1.moneySchema; }))]
priceMoney: ['price_money', (0, schema_1.optional)((0, schema_1.lazy)(function () { return money_1.moneySchema; }))],
soldOut: ['sold_out', (0, schema_1.optional)((0, schema_1.boolean)())]
});
//# sourceMappingURL=modifierLocationOverrides.js.map

@@ -6,8 +6,8 @@ "use strict";

exports.taxIdsSchema = (0, schema_1.object)({
euVat: ['eu_vat', (0, schema_1.optional)((0, schema_1.nullable)((0, schema_1.string)()))],
frSiret: ['fr_siret', (0, schema_1.optional)((0, schema_1.nullable)((0, schema_1.string)()))],
frNaf: ['fr_naf', (0, schema_1.optional)((0, schema_1.nullable)((0, schema_1.string)()))],
esNif: ['es_nif', (0, schema_1.optional)((0, schema_1.nullable)((0, schema_1.string)()))],
euVat: ['eu_vat', (0, schema_1.optional)((0, schema_1.string)())],
frSiret: ['fr_siret', (0, schema_1.optional)((0, schema_1.string)())],
frNaf: ['fr_naf', (0, schema_1.optional)((0, schema_1.string)())],
esNif: ['es_nif', (0, schema_1.optional)((0, schema_1.string)())],
jpQii: ['jp_qii', (0, schema_1.optional)((0, schema_1.string)())]
});
//# sourceMappingURL=taxIds.js.map

@@ -5,3 +5,3 @@ "use strict";

var schema_1 = require("../schema");
var device_1 = require("./device");
var v1Device_1 = require("./v1Device");
var v1Money_1 = require("./v1Money");

@@ -18,3 +18,3 @@ var v1PaymentItemization_1 = require("./v1PaymentItemization");

creatorId: ['creator_id', (0, schema_1.optional)((0, schema_1.nullable)((0, schema_1.string)()))],
device: ['device', (0, schema_1.optional)((0, schema_1.lazy)(function () { return device_1.deviceSchema; }))],
device: ['device', (0, schema_1.optional)((0, schema_1.lazy)(function () { return v1Device_1.v1DeviceSchema; }))],
paymentUrl: ['payment_url', (0, schema_1.optional)((0, schema_1.nullable)((0, schema_1.string)()))],

@@ -21,0 +21,0 @@ receiptUrl: ['receipt_url', (0, schema_1.optional)((0, schema_1.nullable)((0, schema_1.string)()))],

import { bulkRetrieveBookingsRequestSchema, } from '../models/bulkRetrieveBookingsRequest';
import { bulkRetrieveBookingsResponseSchema, } from '../models/bulkRetrieveBookingsResponse';
import { bulkRetrieveTeamMemberBookingProfilesRequestSchema, } from '../models/bulkRetrieveTeamMemberBookingProfilesRequest';
import { bulkRetrieveTeamMemberBookingProfilesResponseSchema, } from '../models/bulkRetrieveTeamMemberBookingProfilesResponse';
import { cancelBookingRequestSchema, } from '../models/cancelBookingRequest';

@@ -169,2 +171,20 @@ import { cancelBookingResponseSchema, } from '../models/cancelBookingResponse';

/**
* Retrieves one or more team members' booking profiles.
*
* @param body An object containing the fields to
* POST for the request. See the
* corresponding object definition for
* field details.
* @return Response from the API call
*/
async bulkRetrieveTeamMemberBookingProfiles(body, requestOptions) {
const req = this.createRequest('POST', '/v2/bookings/team-member-booking-profiles/bulk-retrieve');
const mapped = req.prepareArgs({
body: [body, bulkRetrieveTeamMemberBookingProfilesRequestSchema],
});
req.header('Content-Type', 'application/json');
req.json(mapped.body);
return req.callAsJson(bulkRetrieveTeamMemberBookingProfilesResponseSchema, requestOptions);
}
/**
* Retrieves a team member's booking profile.

@@ -171,0 +191,0 @@ *

@@ -22,4 +22,2 @@ import { createCheckoutRequestSchema, } from '../models/createCheckoutRequest';

* api#checkout-api-highlights).
* We recommend that you use the new [CreatePaymentLink](api-endpoint:Checkout-CreatePaymentLink)
* endpoint in place of this previously released endpoint.
*

@@ -26,0 +24,0 @@ * @param locationId The ID of the business location to associate the checkout

import { createDeviceCodeRequestSchema, } from '../models/createDeviceCodeRequest';
import { createDeviceCodeResponseSchema, } from '../models/createDeviceCodeResponse';
import { getDeviceCodeResponseSchema, } from '../models/getDeviceCodeResponse';
import { getDeviceResponseSchema, } from '../models/getDeviceResponse';
import { listDeviceCodesResponseSchema, } from '../models/listDeviceCodesResponse';
import { optional, string } from '../schema';
import { listDevicesResponseSchema, } from '../models/listDevicesResponse';
import { number, optional, string } from '../schema';
import { BaseApi } from './baseApi';
export class DevicesApi extends BaseApi {
/**
* List devices associated with the merchant. Currently, only Terminal API
* devices are supported.
*
* @param cursor A pagination cursor returned by a previous call to this endpoint. Provide this
* cursor to retrieve the next set of results for the original query. See
* [Pagination](https://developer.squareup.com/docs/build-basics/common-api-
* patterns/pagination) for more information.
* @param sortOrder The order in which results are listed. - `ASC` - Oldest to newest. - `DESC` - Newest
* to oldest (default).
* @param limit The number of results to return in a single page.
* @param locationId If present, only returns devices at the target location.
* @return Response from the API call
*/
async listDevices(cursor, sortOrder, limit, locationId, requestOptions) {
const req = this.createRequest('GET', '/v2/devices');
const mapped = req.prepareArgs({
cursor: [cursor, optional(string())],
sortOrder: [sortOrder, optional(string())],
limit: [limit, optional(number())],
locationId: [locationId, optional(string())],
});
req.query('cursor', mapped.cursor);
req.query('sort_order', mapped.sortOrder);
req.query('limit', mapped.limit);
req.query('location_id', mapped.locationId);
return req.callAsJson(listDevicesResponseSchema, requestOptions);
}
/**
* Lists all DeviceCodes associated with the merchant.

@@ -66,3 +96,15 @@ *

}
/**
* Retrieves Device with the associated `device_id`.
*
* @param deviceId The unique ID for the desired `Device`.
* @return Response from the API call
*/
async getDevice(deviceId, requestOptions) {
const req = this.createRequest('GET');
const mapped = req.prepareArgs({ deviceId: [deviceId, string()] });
req.appendTemplatePath `/v2/devices/${mapped.deviceId}`;
return req.callAsJson(getDeviceResponseSchema, requestOptions);
}
}
//# sourceMappingURL=devicesApi.js.map

@@ -328,3 +328,3 @@ import { accumulateLoyaltyPointsRequestSchema, } from '../models/accumulateLoyaltyPointsRequest';

});
req.appendTemplatePath `/v2/loyalty/programs/${mapped.promotionId}/promotions/${mapped.programId}`;
req.appendTemplatePath `/v2/loyalty/programs/${mapped.programId}/promotions/${mapped.promotionId}`;
return req.callAsJson(retrieveLoyaltyPromotionResponseSchema, requestOptions);

@@ -353,3 +353,3 @@ }

});
req.appendTemplatePath `/v2/loyalty/programs/${mapped.promotionId}/promotions/${mapped.programId}/cancel`;
req.appendTemplatePath `/v2/loyalty/programs/${mapped.programId}/promotions/${mapped.promotionId}/cancel`;
return req.callAsJson(cancelLoyaltyPromotionResponseSchema, requestOptions);

@@ -356,0 +356,0 @@ }

@@ -60,5 +60,3 @@ import { obtainTokenRequestSchema, } from '../models/obtainTokenRequest';

* If an account has more than one OAuth access token for your application, this
* endpoint revokes all of them, regardless of which token you specify. When an
* OAuth access token is revoked, all of the active subscriptions associated
* with that OAuth token are canceled immediately.
* endpoint revokes all of them, regardless of which token you specify.
*

@@ -65,0 +63,0 @@ * __Important:__ The `Authorization` header for this endpoint must have the

@@ -53,3 +53,3 @@ import { ApplePayApi } from './api/applePayApi';

/** Current SDK version */
export const SDK_VERSION = '30.0.0';
export const SDK_VERSION = '31.0.0';
export class Client {

@@ -64,3 +64,3 @@ constructor(config) {

: this._config.timeout;
this._userAgent = updateUserAgent('Square-TypeScript-SDK/30.0.0 ({api-version}) {engine}/{engine-version} ({os-info}) {detail}', this._config.squareVersion, this._config.userAgentDetail);
this._userAgent = updateUserAgent('Square-TypeScript-SDK/31.0.0 ({api-version}) {engine}/{engine-version} ({os-info}) {detail}', this._config.squareVersion, this._config.userAgentDetail);
this._requestBuilderFactory = createRequestHandlerFactory(server => getBaseUri(server, this._config), accessTokenAuthenticationProvider(this._config), new HttpClient(AbortError, {

@@ -67,0 +67,0 @@ timeout: this._timeout,

@@ -5,3 +5,3 @@ import { Environment } from './configuration';

timeout: 60000,
squareVersion: '2023-08-16',
squareVersion: '2023-09-25',
additionalHeaders: {},

@@ -8,0 +8,0 @@ userAgentDetail: '',

@@ -1,6 +0,14 @@

import { nullable, object, optional, string } from '../schema';
import { array, lazy, nullable, object, optional, string, } from '../schema';
import { componentSchema } from './component';
import { deviceAttributesSchema } from './deviceAttributes';
import { deviceStatusSchema } from './deviceStatus';
export const deviceSchema = object({
id: ['id', optional(string())],
name: ['name', optional(nullable(string()))],
attributes: ['attributes', lazy(() => deviceAttributesSchema)],
components: [
'components',
optional(nullable(array(lazy(() => componentSchema)))),
],
status: ['status', optional(lazy(() => deviceStatusSchema))],
});
//# sourceMappingURL=device.js.map

@@ -1,2 +0,2 @@

import { lazy, nullable, object, optional, string } from '../schema';
import { boolean, lazy, nullable, object, optional, string, } from '../schema';
import { moneySchema } from './money';

@@ -6,3 +6,4 @@ export const modifierLocationOverridesSchema = object({

priceMoney: ['price_money', optional(lazy(() => moneySchema))],
soldOut: ['sold_out', optional(boolean())],
});
//# sourceMappingURL=modifierLocationOverrides.js.map

@@ -1,9 +0,9 @@

import { nullable, object, optional, string } from '../schema';
import { object, optional, string } from '../schema';
export const taxIdsSchema = object({
euVat: ['eu_vat', optional(nullable(string()))],
frSiret: ['fr_siret', optional(nullable(string()))],
frNaf: ['fr_naf', optional(nullable(string()))],
esNif: ['es_nif', optional(nullable(string()))],
euVat: ['eu_vat', optional(string())],
frSiret: ['fr_siret', optional(string())],
frNaf: ['fr_naf', optional(string())],
esNif: ['es_nif', optional(string())],
jpQii: ['jp_qii', optional(string())],
});
//# sourceMappingURL=taxIds.js.map
import { array, boolean, lazy, nullable, object, optional, string, } from '../schema';
import { deviceSchema } from './device';
import { v1DeviceSchema } from './v1Device';
import { v1MoneySchema } from './v1Money';

@@ -14,3 +14,3 @@ import { v1PaymentItemizationSchema, } from './v1PaymentItemization';

creatorId: ['creator_id', optional(nullable(string()))],
device: ['device', optional(lazy(() => deviceSchema))],
device: ['device', optional(lazy(() => v1DeviceSchema))],
paymentUrl: ['payment_url', optional(nullable(string()))],

@@ -17,0 +17,0 @@ receiptUrl: ['receipt_url', optional(nullable(string()))],

import { ApiResponse, RequestOptions } from '../core';
import { BulkRetrieveBookingsRequest } from '../models/bulkRetrieveBookingsRequest';
import { BulkRetrieveBookingsResponse } from '../models/bulkRetrieveBookingsResponse';
import { BulkRetrieveTeamMemberBookingProfilesRequest } from '../models/bulkRetrieveTeamMemberBookingProfilesRequest';
import { BulkRetrieveTeamMemberBookingProfilesResponse } from '../models/bulkRetrieveTeamMemberBookingProfilesResponse';
import { CancelBookingRequest } from '../models/cancelBookingRequest';

@@ -110,2 +112,12 @@ import { CancelBookingResponse } from '../models/cancelBookingResponse';

/**
* Retrieves one or more team members' booking profiles.
*
* @param body An object containing the fields to
* POST for the request. See the
* corresponding object definition for
* field details.
* @return Response from the API call
*/
bulkRetrieveTeamMemberBookingProfiles(body: BulkRetrieveTeamMemberBookingProfilesRequest, requestOptions?: RequestOptions): Promise<ApiResponse<BulkRetrieveTeamMemberBookingProfilesResponse>>;
/**
* Retrieves a team member's booking profile.

@@ -112,0 +124,0 @@ *

@@ -22,4 +22,2 @@ import { ApiResponse, RequestOptions } from '../core';

* api#checkout-api-highlights).
* We recommend that you use the new [CreatePaymentLink](api-endpoint:Checkout-CreatePaymentLink)
* endpoint in place of this previously released endpoint.
*

@@ -26,0 +24,0 @@ * @param locationId The ID of the business location to associate the checkout

@@ -5,6 +5,23 @@ import { ApiResponse, RequestOptions } from '../core';

import { GetDeviceCodeResponse } from '../models/getDeviceCodeResponse';
import { GetDeviceResponse } from '../models/getDeviceResponse';
import { ListDeviceCodesResponse } from '../models/listDeviceCodesResponse';
import { ListDevicesResponse } from '../models/listDevicesResponse';
import { BaseApi } from './baseApi';
export declare class DevicesApi extends BaseApi {
/**
* List devices associated with the merchant. Currently, only Terminal API
* devices are supported.
*
* @param cursor A pagination cursor returned by a previous call to this endpoint. Provide this
* cursor to retrieve the next set of results for the original query. See
* [Pagination](https://developer.squareup.com/docs/build-basics/common-api-
* patterns/pagination) for more information.
* @param sortOrder The order in which results are listed. - `ASC` - Oldest to newest. - `DESC` - Newest
* to oldest (default).
* @param limit The number of results to return in a single page.
* @param locationId If present, only returns devices at the target location.
* @return Response from the API call
*/
listDevices(cursor?: string, sortOrder?: string, limit?: number, locationId?: string, requestOptions?: RequestOptions): Promise<ApiResponse<ListDevicesResponse>>;
/**
* Lists all DeviceCodes associated with the merchant.

@@ -41,2 +58,9 @@ *

getDeviceCode(id: string, requestOptions?: RequestOptions): Promise<ApiResponse<GetDeviceCodeResponse>>;
/**
* Retrieves Device with the associated `device_id`.
*
* @param deviceId The unique ID for the desired `Device`.
* @return Response from the API call
*/
getDevice(deviceId: string, requestOptions?: RequestOptions): Promise<ApiResponse<GetDeviceResponse>>;
}

@@ -46,5 +46,3 @@ import { ApiResponse, RequestOptions } from '../core';

* If an account has more than one OAuth access token for your application, this
* endpoint revokes all of them, regardless of which token you specify. When an
* OAuth access token is revoked, all of the active subscriptions associated
* with that OAuth token are canceled immediately.
* endpoint revokes all of them, regardless of which token you specify.
*

@@ -51,0 +49,0 @@ * __Important:__ The `Authorization` header for this endpoint must have the

@@ -45,3 +45,3 @@ import { ApplePayApi } from './api/applePayApi';

/** Current SDK version */
export declare const SDK_VERSION = "30.0.0";
export declare const SDK_VERSION = "31.0.0";
export declare class Client implements ClientInterface {

@@ -48,0 +48,0 @@ private _config;

import { Schema } from '../schema';
import { Component } from './component';
import { DeviceAttributes } from './deviceAttributes';
import { DeviceStatus } from './deviceStatus';
export interface Device {
/** The device's Square-issued ID. */
/**
* A synthetic identifier for the device. The identifier includes a standardized prefix and
* is otherwise an opaque id generated from key device fields.
*/
id?: string;
/** The device's merchant-specified name. */
name?: string | null;
attributes: DeviceAttributes;
/** A list of components applicable to the device. */
components?: Component[] | null;
status?: DeviceStatus;
}
export declare const deviceSchema: Schema<Device>;
import { Schema } from '../schema';
/** An employee object that is used by the external API. */
/**
* An employee object that is used by the external API.
* DEPRECATED at version 2020-08-26. Replaced by [TeamMember](entity:TeamMember).
*/
export interface Employee {

@@ -16,3 +19,6 @@ /** UUID for this object. */

locationIds?: string[] | null;
/** The status of the Employee being retrieved. */
/**
* The status of the Employee being retrieved.
* DEPRECATED at version 2020-08-26. Replaced by [TeamMemberStatus](entity:TeamMemberStatus).
*/
status?: string;

@@ -19,0 +25,0 @@ /**

import { Schema } from '../schema';
export interface ListEmployeesRequest {
locationId?: string | null;
/** The status of the Employee being retrieved. */
/**
* The status of the Employee being retrieved.
* DEPRECATED at version 2020-08-26. Replaced by [TeamMemberStatus](entity:TeamMemberStatus).
*/
status?: string;

@@ -6,0 +9,0 @@ /** The number of employees to be returned on each page. */

@@ -16,3 +16,8 @@ import { Schema } from '../schema';

priceMoney?: Money;
/**
* Indicates whether the modifier is sold out at the specified location or not. As an example, for cheese (modifier) burger (item), when the modifier is sold out, it is the cheese, but not the burger, that is sold out.
* The seller can manually set this sold out status. Attempts by an application to set this attribute are ignored.
*/
soldOut?: boolean;
}
export declare const modifierLocationOverridesSchema: Schema<ModifierLocationOverrides>;

@@ -5,3 +5,6 @@ import { Schema } from '../schema';

export interface RetrieveEmployeeResponse {
/** An employee object that is used by the external API. */
/**
* An employee object that is used by the external API.
* DEPRECATED at version 2020-08-26. Replaced by [TeamMember](entity:TeamMember).
*/
employee?: Employee;

@@ -8,0 +11,0 @@ /** Any errors that occurred during the request. */

@@ -9,3 +9,3 @@ import { Schema } from '../schema';

*/
euVat?: string | null;
euVat?: string;
/**

@@ -15,3 +15,3 @@ * The SIRET (Système d'Identification du Répertoire des Entreprises et de leurs Etablissements)

*/
frSiret?: string | null;
frSiret?: string;
/**

@@ -22,3 +22,3 @@ * The French government uses the NAF (Nomenclature des Activités Françaises) to display and

*/
frNaf?: string | null;
frNaf?: string;
/**

@@ -28,6 +28,6 @@ * The NIF (Numero de Identificacion Fiscal) number is a nine-character tax identifier used in Spain.

*/
esNif?: string | null;
esNif?: string;
/**
* The QII (Qualified Invoice Issuer) number is a 14-character tax identifier used in Japan.
* If it is present, it has been validated. For example, `T1234567890123`.
* For example, `T1234567890123`.
*/

@@ -34,0 +34,0 @@ jpQii?: string;

@@ -10,3 +10,3 @@ import { Schema } from '../schema';

displayName?: string;
/** Indicates whether the team member can be booked through the Bookings API or the seller's online booking channel or site (`true) or not (`false`). */
/** Indicates whether the team member can be booked through the Bookings API or the seller's online booking channel or site (`true`) or not (`false`). */
isBookable?: boolean | null;

@@ -13,0 +13,0 @@ /** The URL of the team member's image for the bookings profile. */

import { Schema } from '../schema';
import { Device } from './device';
import { V1Device } from './v1Device';
import { V1Money } from './v1Money';

@@ -37,3 +37,3 @@ import { V1PaymentItemization } from './v1PaymentItemization';

creatorId?: string | null;
device?: Device;
device?: V1Device;
/** The URL of the payment's detail page in the merchant dashboard. The merchant must be signed in to the merchant dashboard to view this page. */

@@ -40,0 +40,0 @@ paymentUrl?: string | null;

{
"version": "30.0.0",
"version": "31.0.0",
"license": "MIT",

@@ -4,0 +4,0 @@ "sideEffects": false,

@@ -11,2 +11,10 @@ import { ApiResponse, RequestOptions } from '../core';

import {
BulkRetrieveTeamMemberBookingProfilesRequest,
bulkRetrieveTeamMemberBookingProfilesRequestSchema,
} from '../models/bulkRetrieveTeamMemberBookingProfilesRequest';
import {
BulkRetrieveTeamMemberBookingProfilesResponse,
bulkRetrieveTeamMemberBookingProfilesResponseSchema,
} from '../models/bulkRetrieveTeamMemberBookingProfilesResponse';
import {
CancelBookingRequest,

@@ -261,2 +269,30 @@ cancelBookingRequestSchema,

/**
* Retrieves one or more team members' booking profiles.
*
* @param body An object containing the fields to
* POST for the request. See the
* corresponding object definition for
* field details.
* @return Response from the API call
*/
async bulkRetrieveTeamMemberBookingProfiles(
body: BulkRetrieveTeamMemberBookingProfilesRequest,
requestOptions?: RequestOptions
): Promise<ApiResponse<BulkRetrieveTeamMemberBookingProfilesResponse>> {
const req = this.createRequest(
'POST',
'/v2/bookings/team-member-booking-profiles/bulk-retrieve'
);
const mapped = req.prepareArgs({
body: [body, bulkRetrieveTeamMemberBookingProfilesRequestSchema],
});
req.header('Content-Type', 'application/json');
req.json(mapped.body);
return req.callAsJson(
bulkRetrieveTeamMemberBookingProfilesResponseSchema,
requestOptions
);
}
/**
* Retrieves a team member's booking profile.

@@ -263,0 +299,0 @@ *

@@ -51,4 +51,2 @@ import { ApiResponse, RequestOptions } from '../core';

* api#checkout-api-highlights).
* We recommend that you use the new [CreatePaymentLink](api-endpoint:Checkout-CreatePaymentLink)
* endpoint in place of this previously released endpoint.
*

@@ -55,0 +53,0 @@ * @param locationId The ID of the business location to associate the checkout

@@ -15,6 +15,14 @@ import { ApiResponse, RequestOptions } from '../core';

import {
GetDeviceResponse,
getDeviceResponseSchema,
} from '../models/getDeviceResponse';
import {
ListDeviceCodesResponse,
listDeviceCodesResponseSchema,
} from '../models/listDeviceCodesResponse';
import { optional, string } from '../schema';
import {
ListDevicesResponse,
listDevicesResponseSchema,
} from '../models/listDevicesResponse';
import { number, optional, string } from '../schema';
import { BaseApi } from './baseApi';

@@ -24,2 +32,37 @@

/**
* List devices associated with the merchant. Currently, only Terminal API
* devices are supported.
*
* @param cursor A pagination cursor returned by a previous call to this endpoint. Provide this
* cursor to retrieve the next set of results for the original query. See
* [Pagination](https://developer.squareup.com/docs/build-basics/common-api-
* patterns/pagination) for more information.
* @param sortOrder The order in which results are listed. - `ASC` - Oldest to newest. - `DESC` - Newest
* to oldest (default).
* @param limit The number of results to return in a single page.
* @param locationId If present, only returns devices at the target location.
* @return Response from the API call
*/
async listDevices(
cursor?: string,
sortOrder?: string,
limit?: number,
locationId?: string,
requestOptions?: RequestOptions
): Promise<ApiResponse<ListDevicesResponse>> {
const req = this.createRequest('GET', '/v2/devices');
const mapped = req.prepareArgs({
cursor: [cursor, optional(string())],
sortOrder: [sortOrder, optional(string())],
limit: [limit, optional(number())],
locationId: [locationId, optional(string())],
});
req.query('cursor', mapped.cursor);
req.query('sort_order', mapped.sortOrder);
req.query('limit', mapped.limit);
req.query('location_id', mapped.locationId);
return req.callAsJson(listDevicesResponseSchema, requestOptions);
}
/**
* Lists all DeviceCodes associated with the merchant.

@@ -96,2 +139,18 @@ *

}
/**
* Retrieves Device with the associated `device_id`.
*
* @param deviceId The unique ID for the desired `Device`.
* @return Response from the API call
*/
async getDevice(
deviceId: string,
requestOptions?: RequestOptions
): Promise<ApiResponse<GetDeviceResponse>> {
const req = this.createRequest('GET');
const mapped = req.prepareArgs({ deviceId: [deviceId, string()] });
req.appendTemplatePath`/v2/devices/${mapped.deviceId}`;
return req.callAsJson(getDeviceResponseSchema, requestOptions);
}
}

@@ -471,3 +471,3 @@ import { ApiResponse, RequestOptions } from '../core';

});
req.appendTemplatePath`/v2/loyalty/programs/${mapped.promotionId}/promotions/${mapped.programId}`;
req.appendTemplatePath`/v2/loyalty/programs/${mapped.programId}/promotions/${mapped.promotionId}`;
return req.callAsJson(

@@ -504,3 +504,3 @@ retrieveLoyaltyPromotionResponseSchema,

});
req.appendTemplatePath`/v2/loyalty/programs/${mapped.promotionId}/promotions/${mapped.programId}/cancel`;
req.appendTemplatePath`/v2/loyalty/programs/${mapped.programId}/promotions/${mapped.promotionId}/cancel`;
return req.callAsJson(cancelLoyaltyPromotionResponseSchema, requestOptions);

@@ -507,0 +507,0 @@ }

@@ -89,5 +89,3 @@ import { ApiResponse, RequestOptions } from '../core';

* If an account has more than one OAuth access token for your application, this
* endpoint revokes all of them, regardless of which token you specify. When an
* OAuth access token is revoked, all of the active subscriptions associated
* with that OAuth token are canceled immediately.
* endpoint revokes all of them, regardless of which token you specify.
*

@@ -94,0 +92,0 @@ * __Important:__ The `Authorization` header for this endpoint must have the

@@ -70,3 +70,3 @@ import { ApplePayApi } from './api/applePayApi';

/** Current SDK version */
export const SDK_VERSION = '30.0.0';
export const SDK_VERSION = '31.0.0';
export class Client implements ClientInterface {

@@ -135,3 +135,3 @@ private _config: Readonly<Configuration>;

this._userAgent = updateUserAgent(
'Square-TypeScript-SDK/30.0.0 ({api-version}) {engine}/{engine-version} ({os-info}) {detail}',
'Square-TypeScript-SDK/31.0.0 ({api-version}) {engine}/{engine-version} ({os-info}) {detail}',
this._config.squareVersion,

@@ -138,0 +138,0 @@ this._config.userAgentDetail

@@ -7,3 +7,3 @@ import { Configuration, Environment } from './configuration';

timeout: 60000,
squareVersion: '2023-08-16',
squareVersion: '2023-09-25',
additionalHeaders: {},

@@ -10,0 +10,0 @@ userAgentDetail: '',

@@ -1,8 +0,24 @@

import { nullable, object, optional, Schema, string } from '../schema';
import {
array,
lazy,
nullable,
object,
optional,
Schema,
string,
} from '../schema';
import { Component, componentSchema } from './component';
import { DeviceAttributes, deviceAttributesSchema } from './deviceAttributes';
import { DeviceStatus, deviceStatusSchema } from './deviceStatus';
export interface Device {
/** The device's Square-issued ID. */
/**
* A synthetic identifier for the device. The identifier includes a standardized prefix and
* is otherwise an opaque id generated from key device fields.
*/
id?: string;
/** The device's merchant-specified name. */
name?: string | null;
attributes: DeviceAttributes;
/** A list of components applicable to the device. */
components?: Component[] | null;
status?: DeviceStatus;
}

@@ -12,3 +28,8 @@

id: ['id', optional(string())],
name: ['name', optional(nullable(string()))],
attributes: ['attributes', lazy(() => deviceAttributesSchema)],
components: [
'components',
optional(nullable(array(lazy(() => componentSchema)))),
],
status: ['status', optional(lazy(() => deviceStatusSchema))],
});

@@ -11,3 +11,6 @@ import {

/** An employee object that is used by the external API. */
/**
* An employee object that is used by the external API.
* DEPRECATED at version 2020-08-26. Replaced by [TeamMember](entity:TeamMember).
*/
export interface Employee {

@@ -26,3 +29,6 @@ /** UUID for this object. */

locationIds?: string[] | null;
/** The status of the Employee being retrieved. */
/**
* The status of the Employee being retrieved.
* DEPRECATED at version 2020-08-26. Replaced by [TeamMemberStatus](entity:TeamMemberStatus).
*/
status?: string;

@@ -29,0 +35,0 @@ /**

@@ -5,3 +5,6 @@ import { nullable, number, object, optional, Schema, string } from '../schema';

locationId?: string | null;
/** The status of the Employee being retrieved. */
/**
* The status of the Employee being retrieved.
* DEPRECATED at version 2020-08-26. Replaced by [TeamMemberStatus](entity:TeamMemberStatus).
*/
status?: string;

@@ -8,0 +11,0 @@ /** The number of employees to be returned on each page. */

@@ -1,2 +0,10 @@

import { lazy, nullable, object, optional, Schema, string } from '../schema';
import {
boolean,
lazy,
nullable,
object,
optional,
Schema,
string,
} from '../schema';
import { Money, moneySchema } from './money';

@@ -17,2 +25,7 @@

priceMoney?: Money;
/**
* Indicates whether the modifier is sold out at the specified location or not. As an example, for cheese (modifier) burger (item), when the modifier is sold out, it is the cheese, but not the burger, that is sold out.
* The seller can manually set this sold out status. Attempts by an application to set this attribute are ignored.
*/
soldOut?: boolean;
}

@@ -24,3 +37,4 @@

priceMoney: ['price_money', optional(lazy(() => moneySchema))],
soldOut: ['sold_out', optional(boolean())],
}
);

@@ -6,3 +6,6 @@ import { array, lazy, object, optional, Schema } from '../schema';

export interface RetrieveEmployeeResponse {
/** An employee object that is used by the external API. */
/**
* An employee object that is used by the external API.
* DEPRECATED at version 2020-08-26. Replaced by [TeamMember](entity:TeamMember).
*/
employee?: Employee;

@@ -9,0 +12,0 @@ /** Any errors that occurred during the request. */

@@ -1,2 +0,2 @@

import { nullable, object, optional, Schema, string } from '../schema';
import { object, optional, Schema, string } from '../schema';

@@ -10,3 +10,3 @@ /** Identifiers for the location used by various governments for tax purposes. */

*/
euVat?: string | null;
euVat?: string;
/**

@@ -16,3 +16,3 @@ * The SIRET (Système d'Identification du Répertoire des Entreprises et de leurs Etablissements)

*/
frSiret?: string | null;
frSiret?: string;
/**

@@ -23,3 +23,3 @@ * The French government uses the NAF (Nomenclature des Activités Françaises) to display and

*/
frNaf?: string | null;
frNaf?: string;
/**

@@ -29,6 +29,6 @@ * The NIF (Numero de Identificacion Fiscal) number is a nine-character tax identifier used in Spain.

*/
esNif?: string | null;
esNif?: string;
/**
* The QII (Qualified Invoice Issuer) number is a 14-character tax identifier used in Japan.
* If it is present, it has been validated. For example, `T1234567890123`.
* For example, `T1234567890123`.
*/

@@ -39,7 +39,7 @@ jpQii?: string;

export const taxIdsSchema: Schema<TaxIds> = object({
euVat: ['eu_vat', optional(nullable(string()))],
frSiret: ['fr_siret', optional(nullable(string()))],
frNaf: ['fr_naf', optional(nullable(string()))],
esNif: ['es_nif', optional(nullable(string()))],
euVat: ['eu_vat', optional(string())],
frSiret: ['fr_siret', optional(string())],
frNaf: ['fr_naf', optional(string())],
esNif: ['es_nif', optional(string())],
jpQii: ['jp_qii', optional(string())],
});

@@ -11,3 +11,3 @@ import { boolean, nullable, object, optional, Schema, string } from '../schema';

displayName?: string;
/** Indicates whether the team member can be booked through the Bookings API or the seller's online booking channel or site (`true) or not (`false`). */
/** Indicates whether the team member can be booked through the Bookings API or the seller's online booking channel or site (`true`) or not (`false`). */
isBookable?: boolean | null;

@@ -14,0 +14,0 @@ /** The URL of the team member's image for the bookings profile. */

@@ -11,3 +11,3 @@ import {

} from '../schema';
import { Device, deviceSchema } from './device';
import { V1Device, v1DeviceSchema } from './v1Device';
import { V1Money, v1MoneySchema } from './v1Money';

@@ -54,3 +54,3 @@ import {

creatorId?: string | null;
device?: Device;
device?: V1Device;
/** The URL of the payment's detail page in the merchant dashboard. The merchant must be signed in to the merchant dashboard to view this page. */

@@ -104,3 +104,3 @@ paymentUrl?: string | null;

creatorId: ['creator_id', optional(nullable(string()))],
device: ['device', optional(lazy(() => deviceSchema))],
device: ['device', optional(lazy(() => v1DeviceSchema))],
paymentUrl: ['payment_url', optional(nullable(string()))],

@@ -107,0 +107,0 @@ receiptUrl: ['receipt_url', optional(nullable(string()))],

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc