repzo 1.0.59 → 1.0.60
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/lib/index.d.ts +17 -0
- package/lib/index.js +34 -0
- package/lib/types/index.d.ts +112 -0
- package/package.json +1 -1
- package/src/index.ts +49 -0
- package/src/types/index.ts +114 -0
package/lib/index.d.ts
CHANGED
|
@@ -610,6 +610,23 @@ export default class Repzo {
|
|
|
610
610
|
body: Service.Refund.Update.Body
|
|
611
611
|
) => Promise<Service.Refund.Update.Result>;
|
|
612
612
|
};
|
|
613
|
+
settlement: {
|
|
614
|
+
_path: string;
|
|
615
|
+
find: (
|
|
616
|
+
params?: Service.Settlement.Find.Params
|
|
617
|
+
) => Promise<Service.Settlement.Find.Result>;
|
|
618
|
+
get: (
|
|
619
|
+
id: Service.Settlement.Get.ID,
|
|
620
|
+
params?: Service.Settlement.Get.Params
|
|
621
|
+
) => Promise<Service.Settlement.Get.Result>;
|
|
622
|
+
create: (
|
|
623
|
+
body: Service.Settlement.Create.Body
|
|
624
|
+
) => Promise<Service.Settlement.Create.Result>;
|
|
625
|
+
update: (
|
|
626
|
+
id: Service.Settlement.Update.ID,
|
|
627
|
+
body: Service.Settlement.Update.Body
|
|
628
|
+
) => Promise<Service.Settlement.Update.Result>;
|
|
629
|
+
};
|
|
613
630
|
transfer: {
|
|
614
631
|
_path: string;
|
|
615
632
|
find: (
|
package/lib/index.js
CHANGED
|
@@ -1256,6 +1256,40 @@ export default class Repzo {
|
|
|
1256
1256
|
return res;
|
|
1257
1257
|
},
|
|
1258
1258
|
};
|
|
1259
|
+
this.settlement = {
|
|
1260
|
+
_path: "/settlement",
|
|
1261
|
+
find: async (params) => {
|
|
1262
|
+
let res = await this._fetch(
|
|
1263
|
+
this.svAPIEndpoint,
|
|
1264
|
+
this.settlement._path,
|
|
1265
|
+
params
|
|
1266
|
+
);
|
|
1267
|
+
return res;
|
|
1268
|
+
},
|
|
1269
|
+
get: async (id, params) => {
|
|
1270
|
+
return await this._fetch(
|
|
1271
|
+
this.svAPIEndpoint,
|
|
1272
|
+
this.settlement._path + `/${id}`,
|
|
1273
|
+
params
|
|
1274
|
+
);
|
|
1275
|
+
},
|
|
1276
|
+
create: async (body) => {
|
|
1277
|
+
let res = await this._create(
|
|
1278
|
+
this.svAPIEndpoint,
|
|
1279
|
+
this.settlement._path,
|
|
1280
|
+
body
|
|
1281
|
+
);
|
|
1282
|
+
return res;
|
|
1283
|
+
},
|
|
1284
|
+
update: async (id, body) => {
|
|
1285
|
+
let res = await this._update(
|
|
1286
|
+
this.svAPIEndpoint,
|
|
1287
|
+
this.settlement._path + `/${id}`,
|
|
1288
|
+
body
|
|
1289
|
+
);
|
|
1290
|
+
return res;
|
|
1291
|
+
},
|
|
1292
|
+
};
|
|
1259
1293
|
this.transfer = {
|
|
1260
1294
|
_path: "/transfer",
|
|
1261
1295
|
find: async (params) => {
|
package/lib/types/index.d.ts
CHANGED
|
@@ -5060,6 +5060,7 @@ export declare namespace Service {
|
|
|
5060
5060
|
client_id: string;
|
|
5061
5061
|
client_name: string;
|
|
5062
5062
|
creator: AdminCreator | RepCreator;
|
|
5063
|
+
implemented_by?: AdminCreator | RepCreator;
|
|
5063
5064
|
time?: number;
|
|
5064
5065
|
serial_number: SerialNumber;
|
|
5065
5066
|
route?: string;
|
|
@@ -5194,6 +5195,117 @@ export declare namespace Service {
|
|
|
5194
5195
|
}
|
|
5195
5196
|
export {};
|
|
5196
5197
|
}
|
|
5198
|
+
namespace Settlement {
|
|
5199
|
+
export interface SettlementSchema {
|
|
5200
|
+
_id: string;
|
|
5201
|
+
amount: number;
|
|
5202
|
+
creator: {
|
|
5203
|
+
_id: string;
|
|
5204
|
+
type: "admin" | "rep";
|
|
5205
|
+
admin?: string;
|
|
5206
|
+
rep?: string;
|
|
5207
|
+
name: string;
|
|
5208
|
+
};
|
|
5209
|
+
origin: {
|
|
5210
|
+
_id: string;
|
|
5211
|
+
type: "rep";
|
|
5212
|
+
name: string;
|
|
5213
|
+
rep?: string;
|
|
5214
|
+
};
|
|
5215
|
+
time?: number;
|
|
5216
|
+
serial_number: SerialNumber;
|
|
5217
|
+
paytime: string;
|
|
5218
|
+
note?: string;
|
|
5219
|
+
payment_type: "check" | "cash";
|
|
5220
|
+
check_id?: string;
|
|
5221
|
+
teams: string[];
|
|
5222
|
+
company_namespace: string[];
|
|
5223
|
+
sync_id: string;
|
|
5224
|
+
transaction_processed: boolean;
|
|
5225
|
+
createdAt: Date;
|
|
5226
|
+
updatedAt: Date;
|
|
5227
|
+
}
|
|
5228
|
+
export interface CreateBody {
|
|
5229
|
+
amount: number;
|
|
5230
|
+
time?: number;
|
|
5231
|
+
serial_number: SerialNumber;
|
|
5232
|
+
paytime: string;
|
|
5233
|
+
note?: string;
|
|
5234
|
+
payment_type: "check" | "cash";
|
|
5235
|
+
check_id?: string;
|
|
5236
|
+
teams: string[];
|
|
5237
|
+
company_namespace: string[];
|
|
5238
|
+
sync_id: string;
|
|
5239
|
+
transaction_processed: boolean;
|
|
5240
|
+
}
|
|
5241
|
+
export interface UpdateBody {
|
|
5242
|
+
_id?: string;
|
|
5243
|
+
amount?: number;
|
|
5244
|
+
creator?: {
|
|
5245
|
+
_id: string;
|
|
5246
|
+
type: "admin" | "rep";
|
|
5247
|
+
admin?: string;
|
|
5248
|
+
rep?: string;
|
|
5249
|
+
name: string;
|
|
5250
|
+
};
|
|
5251
|
+
origin?: {
|
|
5252
|
+
_id: string;
|
|
5253
|
+
type: "rep";
|
|
5254
|
+
name: string;
|
|
5255
|
+
rep?: string;
|
|
5256
|
+
};
|
|
5257
|
+
time?: number;
|
|
5258
|
+
serial_number?: SerialNumber;
|
|
5259
|
+
paytime?: string;
|
|
5260
|
+
note?: string;
|
|
5261
|
+
payment_type?: "check" | "cash";
|
|
5262
|
+
check_id?: string;
|
|
5263
|
+
teams?: string[];
|
|
5264
|
+
company_namespace?: string[];
|
|
5265
|
+
sync_id?: string;
|
|
5266
|
+
transaction_processed?: boolean;
|
|
5267
|
+
}
|
|
5268
|
+
type SettlementSchemaWithPopulatedKeys = SettlementSchema & {
|
|
5269
|
+
teams_populated?: string[] | Team.TeamSchema[];
|
|
5270
|
+
};
|
|
5271
|
+
type PopulatedKeys = "teams";
|
|
5272
|
+
export namespace Find {
|
|
5273
|
+
type Params = DefaultPaginationQueryParams & {
|
|
5274
|
+
_id?: string[] | string;
|
|
5275
|
+
"creator._id"?: string[] | string;
|
|
5276
|
+
"origin._id"?: string[] | string;
|
|
5277
|
+
amount?: number;
|
|
5278
|
+
payment_type?: string;
|
|
5279
|
+
from_createdAt?: number;
|
|
5280
|
+
to_createdAt?: number;
|
|
5281
|
+
from_updatedAt?: number;
|
|
5282
|
+
[key: string]: any;
|
|
5283
|
+
populatedKeys?: PopulatedKeys[];
|
|
5284
|
+
};
|
|
5285
|
+
interface Result extends DefaultPaginationResult {
|
|
5286
|
+
data: SettlementSchemaWithPopulatedKeys[];
|
|
5287
|
+
absolute_total: number;
|
|
5288
|
+
page_total: number;
|
|
5289
|
+
}
|
|
5290
|
+
}
|
|
5291
|
+
export namespace Get {
|
|
5292
|
+
type ID = string;
|
|
5293
|
+
interface Params {
|
|
5294
|
+
populatedKeys?: PopulatedKeys[];
|
|
5295
|
+
}
|
|
5296
|
+
type Result = SettlementSchemaWithPopulatedKeys;
|
|
5297
|
+
}
|
|
5298
|
+
export namespace Create {
|
|
5299
|
+
type Body = CreateBody;
|
|
5300
|
+
type Result = SettlementSchema;
|
|
5301
|
+
}
|
|
5302
|
+
export namespace Update {
|
|
5303
|
+
type ID = string;
|
|
5304
|
+
type Body = UpdateBody;
|
|
5305
|
+
type Result = SettlementSchema;
|
|
5306
|
+
}
|
|
5307
|
+
export {};
|
|
5308
|
+
}
|
|
5197
5309
|
namespace Cycle {
|
|
5198
5310
|
type CycleStatus = "pending" | "approved" | "processing" | "rejected";
|
|
5199
5311
|
export interface Schema {
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -1792,6 +1792,55 @@ export default class Repzo {
|
|
|
1792
1792
|
},
|
|
1793
1793
|
};
|
|
1794
1794
|
|
|
1795
|
+
settlement = {
|
|
1796
|
+
_path: "/settlement",
|
|
1797
|
+
|
|
1798
|
+
find: async (
|
|
1799
|
+
params?: Service.Settlement.Find.Params
|
|
1800
|
+
): Promise<Service.Settlement.Find.Result> => {
|
|
1801
|
+
let res: Service.Settlement.Find.Result = await this._fetch(
|
|
1802
|
+
this.svAPIEndpoint,
|
|
1803
|
+
this.settlement._path,
|
|
1804
|
+
params
|
|
1805
|
+
);
|
|
1806
|
+
return res;
|
|
1807
|
+
},
|
|
1808
|
+
|
|
1809
|
+
get: async (
|
|
1810
|
+
id: Service.Settlement.Get.ID,
|
|
1811
|
+
params?: Service.Settlement.Get.Params
|
|
1812
|
+
): Promise<Service.Settlement.Get.Result> => {
|
|
1813
|
+
return await this._fetch(
|
|
1814
|
+
this.svAPIEndpoint,
|
|
1815
|
+
this.settlement._path + `/${id}`,
|
|
1816
|
+
params
|
|
1817
|
+
);
|
|
1818
|
+
},
|
|
1819
|
+
|
|
1820
|
+
create: async (
|
|
1821
|
+
body: Service.Settlement.Create.Body
|
|
1822
|
+
): Promise<Service.Settlement.Create.Result> => {
|
|
1823
|
+
let res = await this._create(
|
|
1824
|
+
this.svAPIEndpoint,
|
|
1825
|
+
this.settlement._path,
|
|
1826
|
+
body
|
|
1827
|
+
);
|
|
1828
|
+
return res;
|
|
1829
|
+
},
|
|
1830
|
+
|
|
1831
|
+
update: async (
|
|
1832
|
+
id: Service.Settlement.Update.ID,
|
|
1833
|
+
body: Service.Settlement.Update.Body
|
|
1834
|
+
): Promise<Service.Settlement.Update.Result> => {
|
|
1835
|
+
let res: Service.Settlement.Update.Result = await this._update(
|
|
1836
|
+
this.svAPIEndpoint,
|
|
1837
|
+
this.settlement._path + `/${id}`,
|
|
1838
|
+
body
|
|
1839
|
+
);
|
|
1840
|
+
return res;
|
|
1841
|
+
},
|
|
1842
|
+
};
|
|
1843
|
+
|
|
1795
1844
|
transfer = {
|
|
1796
1845
|
_path: "/transfer",
|
|
1797
1846
|
find: async (
|
package/src/types/index.ts
CHANGED
|
@@ -5066,6 +5066,7 @@ export namespace Service {
|
|
|
5066
5066
|
client_id: string;
|
|
5067
5067
|
client_name: string;
|
|
5068
5068
|
creator: AdminCreator | RepCreator;
|
|
5069
|
+
implemented_by?: AdminCreator | RepCreator;
|
|
5069
5070
|
time?: number;
|
|
5070
5071
|
serial_number: SerialNumber;
|
|
5071
5072
|
route?: string;
|
|
@@ -5195,7 +5196,120 @@ export namespace Service {
|
|
|
5195
5196
|
export type Result = RefundSchema;
|
|
5196
5197
|
}
|
|
5197
5198
|
}
|
|
5199
|
+
export namespace Settlement {
|
|
5200
|
+
export interface SettlementSchema {
|
|
5201
|
+
_id: string;
|
|
5202
|
+
amount: number;
|
|
5203
|
+
creator: {
|
|
5204
|
+
_id: string;
|
|
5205
|
+
type: "admin" | "rep";
|
|
5206
|
+
admin?: string;
|
|
5207
|
+
rep?: string;
|
|
5208
|
+
name: string;
|
|
5209
|
+
};
|
|
5210
|
+
origin: {
|
|
5211
|
+
_id: string;
|
|
5212
|
+
type: "rep";
|
|
5213
|
+
name: string;
|
|
5214
|
+
rep?: string;
|
|
5215
|
+
};
|
|
5216
|
+
time?: number;
|
|
5217
|
+
serial_number: SerialNumber;
|
|
5218
|
+
paytime: string;
|
|
5219
|
+
note?: string;
|
|
5220
|
+
payment_type: "check" | "cash";
|
|
5221
|
+
check_id?: string;
|
|
5222
|
+
teams: string[];
|
|
5223
|
+
company_namespace: string[];
|
|
5224
|
+
sync_id: string;
|
|
5225
|
+
transaction_processed: boolean;
|
|
5226
|
+
createdAt: Date;
|
|
5227
|
+
updatedAt: Date;
|
|
5228
|
+
}
|
|
5229
|
+
export interface CreateBody {
|
|
5230
|
+
amount: number;
|
|
5231
|
+
time?: number;
|
|
5232
|
+
serial_number: SerialNumber;
|
|
5233
|
+
paytime: string;
|
|
5234
|
+
note?: string;
|
|
5235
|
+
payment_type: "check" | "cash";
|
|
5236
|
+
check_id?: string;
|
|
5237
|
+
teams: string[];
|
|
5238
|
+
company_namespace: string[];
|
|
5239
|
+
sync_id: string;
|
|
5240
|
+
transaction_processed: boolean;
|
|
5241
|
+
}
|
|
5242
|
+
export interface UpdateBody {
|
|
5243
|
+
_id?: string;
|
|
5244
|
+
amount?: number;
|
|
5245
|
+
creator?: {
|
|
5246
|
+
_id: string;
|
|
5247
|
+
type: "admin" | "rep";
|
|
5248
|
+
admin?: string;
|
|
5249
|
+
rep?: string;
|
|
5250
|
+
name: string;
|
|
5251
|
+
};
|
|
5252
|
+
origin?: {
|
|
5253
|
+
_id: string;
|
|
5254
|
+
type: "rep";
|
|
5255
|
+
name: string;
|
|
5256
|
+
rep?: string;
|
|
5257
|
+
};
|
|
5258
|
+
time?: number;
|
|
5259
|
+
serial_number?: SerialNumber;
|
|
5260
|
+
paytime?: string;
|
|
5261
|
+
note?: string;
|
|
5262
|
+
payment_type?: "check" | "cash";
|
|
5263
|
+
check_id?: string;
|
|
5264
|
+
teams?: string[];
|
|
5265
|
+
company_namespace?: string[];
|
|
5266
|
+
sync_id?: string;
|
|
5267
|
+
transaction_processed?: boolean;
|
|
5268
|
+
}
|
|
5269
|
+
|
|
5270
|
+
type SettlementSchemaWithPopulatedKeys = SettlementSchema & {
|
|
5271
|
+
teams_populated?: string[] | Team.TeamSchema[];
|
|
5272
|
+
};
|
|
5273
|
+
type PopulatedKeys = "teams";
|
|
5274
|
+
export namespace Find {
|
|
5275
|
+
export type Params = DefaultPaginationQueryParams & {
|
|
5276
|
+
_id?: string[] | string;
|
|
5277
|
+
"creator._id"?: string[] | string;
|
|
5278
|
+
"origin._id"?: string[] | string;
|
|
5279
|
+
amount?: number;
|
|
5280
|
+
payment_type?: string;
|
|
5281
|
+
from_createdAt?: number;
|
|
5282
|
+
to_createdAt?: number;
|
|
5283
|
+
from_updatedAt?: number;
|
|
5284
|
+
[key: string]: any; // integration_meta.
|
|
5285
|
+
populatedKeys?: PopulatedKeys[];
|
|
5286
|
+
};
|
|
5287
|
+
export interface Result extends DefaultPaginationResult {
|
|
5288
|
+
data: SettlementSchemaWithPopulatedKeys[];
|
|
5289
|
+
absolute_total: number;
|
|
5290
|
+
page_total: number;
|
|
5291
|
+
}
|
|
5292
|
+
}
|
|
5293
|
+
|
|
5294
|
+
export namespace Get {
|
|
5295
|
+
export type ID = string;
|
|
5296
|
+
export interface Params {
|
|
5297
|
+
populatedKeys?: PopulatedKeys[];
|
|
5298
|
+
}
|
|
5299
|
+
export type Result = SettlementSchemaWithPopulatedKeys;
|
|
5300
|
+
}
|
|
5198
5301
|
|
|
5302
|
+
export namespace Create {
|
|
5303
|
+
export type Body = CreateBody;
|
|
5304
|
+
export type Result = SettlementSchema;
|
|
5305
|
+
}
|
|
5306
|
+
|
|
5307
|
+
export namespace Update {
|
|
5308
|
+
export type ID = string;
|
|
5309
|
+
export type Body = UpdateBody;
|
|
5310
|
+
export type Result = SettlementSchema;
|
|
5311
|
+
}
|
|
5312
|
+
}
|
|
5199
5313
|
export namespace Cycle {
|
|
5200
5314
|
type CycleStatus = "pending" | "approved" | "processing" | "rejected";
|
|
5201
5315
|
export interface Schema {
|